Search Over 30,000 FREE Plugins from the Official WordPress Plugin Directory Repository

Z-URL Preview

A plugin to embed a preview of a link, similar to facebook

This plugin fetches an excerpt of an external website link. The excerpt contains the title, description and image.

V1.5.2 Update: Added option to place the button in the "Media Button" row above the editor and changed the default for new install's to use PHP's HTML Dom instead of regex's.

v1.5.0 Update: Rewrote the source parser to use PHP's HTML Dom instead of regex's. The default mode is the original regex's, so you need to change the setting on the options page to enable this. The Dom mode always tries OpenGraph tags first, then fails back to regular meta tags, then to body content, i.e. img if no og:image, h1 if no og:title or title, 1st p if no og:description or meta description

The options page allows the following to be set:

  • CSS to change the look and feel of the generated links.

  • The article source label. (Default "Source:")

  • Control of new window opening. Options are 'target="_blank"', 'target="newwindow"', 'rel="external"' and opening in the same window. (Default 'target="_blank"')

  • Which TinyMCE button row the icon is added to (1,2 or 3) or the "Media Button" row above the editor.

  • Select regex parse mode (the original and default) or PHP's HTML Dom mode

Added in 1.4.5: When adding a post, if the post title field is blank, the title of the retrieved page is inserted into the title field.

The defaults are designed to suit most people.

Added the cacert.pem which CURL uses for https sites from http://curl.haxx.se/ca/cacert.pem (the home of CURL).

ToDo: Longer term, configurable options for sites without an image and selecting from multiple OG images.

Thank you to Abhishek Saha for publishing the original URL Preview at https://wordpress.org/plugins/link-preview/ which this is based on and for the WP review team for their help in conforming to coding rules.

Note: Tested with "TinyMCE Advanced" and "Black Studio TinyMCE Widget" modules.

Author Stuart Millington
Profile
Contributors
Tags excerpt, Facebook type preview, link preview, linkedin type preview, Post
  1. z-url-preview screenshot 1

    Select the "add preview link" button (Tiny MCE Advanced).

  2. z-url-preview screenshot 2

    Enter the URL in the pop-up.

  3. z-url-preview screenshot 3

    Preview and edit, where needed, the contents.

  4. z-url-preview screenshot 4

    Default presentation client-side.

  5. z-url-preview screenshot 5

    Settings screen.

  6. z-url-preview screenshot 6

    Button on Black Studio TinyMCE Widget 2.2.8.

  7. z-url-preview screenshot 7

    Button with "Media Button" setting.

1.5.7

  • Added option to suppress header tag

1.5.6

  • Tested with WordPress 4.6 and TinyMCE Advanced Version 4.4.1

1.5.5

  • Clean up spacing before insert

1.5.4

  • Minor code clean up and tested with WordPress 4.5 and TinyMCE Advanced 4.3.8

1.5.3

  • Added page/post type filter for the "Media Button" option.

1.5.2

  • Added option to place the button in the "Media Button" row above the editor.
  • Default to use PHP's HTML Dom instead of regex's for new install's.

1.5.1

  • Updated processing for "//" and "://" links without http(s) references.
  • Added CURL debugging.

1.5.0

  • Rewrote the source parser to use PHP's HTML Dom instead of regex's. The default mode is the original, so you need to change the setting on the options page to enable this.

1.4.7

  • Added option to select which TinyMCE button row the icon is added to (1,2 or 3).

1.4.6

  • Adjust image path when site uses a relative link (without a leading slash) and the FQDN is entered without a trailing slash.

1.4.5

  • When adding a post, if the post title field is blank, the title of the retrieved page is inserted into the title field.

1.4.4

  • Adjusted title detection (due to issue with BBC News site)

1.4.3

  • Added option to control how/if the link opens a new window

1.4.2

  • Added source / link label option into settings

1.4.1

  • Corrected css path

1.4

  • First published version

1.3

  • Fixes / Corrections to WP guidelines

1.2

  • Fixes / Corrections

1.1

  • Fixes / Corrections

1.0

  • First version / Fork
Share  
Download
Version 1.5.7

Requires WordPress version: 4.2 or higher

Compatible up to: 4.7.2

Last Updated 02 Jan 2017

Date Added: 11 Aug 2015

Plugin Homepage

Evaluation
star1
star2
star3
star4
star5

5 stars
3 ratings
4,845 downloads

Compatibility

Not Enough Data

Reports:
Works: 0
Broken: 0