Open Graph for Facebook, Google+ and Twitter Card Tags - Version 1.7.4.2

Version Description

  • Overlay PNG will only be used on locally hosted images
  • New fb_og_image_overlay filter to be able to disable Overlay PNG programatically based on whatever needs of the developer
  • Better texts about the Overlay PNG function on the settings page
  • Minor fixes
Download this release

Release Info

Developer webdados
Plugin Icon Open Graph for Facebook, Google+ and Twitter Card Tags
Version 1.7.4.2
Comparing to
See all releases

Code changes from version 1.7.4.1 to 1.7.4.2

includes/settings-page.php CHANGED
@@ -657,7 +657,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
657
  <div>
658
  <input type="checkbox" name="fb_image_overlay" id="fb_image_overlay" value="1" <?php echo (intval($fb_image_overlay)==1 ? ' checked="checked"' : ''); ?> onclick="showImageOverlayOptions();"/>
659
  <br/>
660
- <small><?php _e('Image will be resized/cropped to 1200x630 and the PNG chosen bellow will be overlaid', 'wd-fb-og');?></small>
661
  </div>
662
  <div class="fb_image_overlay_options">
663
  <input type="text" name="fb_image_overlay_image" id="fb_image_overlay_image" size="50" value="<?php echo trim(esc_attr($fb_image_overlay_image)); ?>"/>
@@ -666,7 +666,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
666
  <small>
667
  <?php _e('Full URL with http://', 'wd-fb-og');?>
668
  <br/>
669
- <?php _e('Recommended size: 1200x630px', 'wd-fb-og'); ?>
670
  </small>
671
  </div>
672
  </td>
@@ -1159,6 +1159,10 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
1159
  background-color: #DFDFDF;
1160
  border: none;
1161
  }
 
 
 
 
1162
  table.form-table .dashicons-before {
1163
  margin-right: 10px;
1164
  font-size: 12px;
657
  <div>
658
  <input type="checkbox" name="fb_image_overlay" id="fb_image_overlay" value="1" <?php echo (intval($fb_image_overlay)==1 ? ' checked="checked"' : ''); ?> onclick="showImageOverlayOptions();"/>
659
  <br/>
660
+ <small><?php _e('Image will be resized/cropped to 1200x630 and the transparent PNG chosen bellow (that should also have this size) will be overlaid on it. It will only work for locally hosted images.', 'wd-fb-og');?></small>
661
  </div>
662
  <div class="fb_image_overlay_options">
663
  <input type="text" name="fb_image_overlay_image" id="fb_image_overlay_image" size="50" value="<?php echo trim(esc_attr($fb_image_overlay_image)); ?>"/>
666
  <small>
667
  <?php _e('Full URL with http://', 'wd-fb-og');?>
668
  <br/>
669
+ <?php _e('Size: 1200x630px', 'wd-fb-og'); ?>
670
  </small>
671
  </div>
672
  </td>
1159
  background-color: #DFDFDF;
1160
  border: none;
1161
  }
1162
+ .og_left_col .inside hr:first-child,
1163
+ .og_right_col .inside hr:first-child {
1164
+ display: block;
1165
+ }
1166
  table.form-table .dashicons-before {
1167
  margin-right: 10px;
1168
  font-size: 12px;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-faceb
4
  Tags: facebook, open graph, open graph protocol, share, social, meta, rss, twitter card, twitter, schema, google+, g+, google, google plus, image, like, seo, search engine optimization, woocommerce, yoast seo, subheading, php7
5
  Requires at least: 4.0
6
  Tested up to: 4.5
7
- Stable tag: 1.7.4.1
8
  Inserts Facebook Open Graph, Google+/Schema.org, Twitter and other Meta Tags into your WordPress Website for more efficient sharing results.
9
 
10
  == Description ==
@@ -29,7 +29,7 @@ BETA: It's also possible to add a overlay logo to the image. The plugin will res
29
  * **og:site_name**: From blog title.
30
  * **og:title**: From post/page/archive/tag/... title.
31
  * **og:url**: From the post/page permalink.
32
- * **og:type**: "website" or "blog" for the homepage and "article" for all the others.
33
  * **article:published_time**: Article published time (for posts only)
34
  * **article:modified_time** and **og:updated_time**: Article modified time (for posts only)
35
  * **article:publisher**: From settings on the options screen.
@@ -38,6 +38,7 @@ BETA: It's also possible to add a overlay logo to the image. The plugin will res
38
  * **og:description**: From post/page excerpt if it exist, or from post/page content. From category/tag description on it's pages, if it exist. From tagline, or custom text, on all the others.
39
  * **og:image**: From a specific custom field of the post/page, or if not set from the post/page featured/thumbnail image, or if it doesn't exist from the first image in the post content, or if it doesn't exist from the first image on the post media gallery, or if it doesn't exist from the default image defined on the options menu. The same image chosen here will be used and enclosure/media:content on the RSS feed.
40
  * **og:image:width** and **og:image:height**: Image dimensions.
 
41
 
42
  = The (Google+) Schema.org Tags that this plugin inserts are: =
43
 
@@ -67,7 +68,7 @@ BETA: It's also possible to add a overlay logo to the image. The plugin will res
67
  = 3rd Party Integration: =
68
 
69
  * **[WordPress SEO by Yoast](http://wordpress.org/plugins/wordpress-seo/)**: Allows you to use title, url (canonical) and description from WPSEO plugin.
70
- * **[WooCommerce](https://wordpress.org/plugins/woocommerce/)**: Allows you to use the Product Category thumbnails as Open Graph Image and have Product Gallery images as additional Open Graph Images
71
  * **[SubHeading](http://wordpress.org/extend/plugins/subheading/)**: Add the SubHeading to the post/page title.
72
  * **[Business Directory Plugin](http://wordpress.org/extend/plugins/business-directory-plugin/)**: Allows you to use BDP listing contents as Open Graph Tags.
73
 
@@ -111,6 +112,12 @@ We DO NOT provide email support for this plugin. If you send us an email asking
111
 
112
  == Changelog ==
113
 
 
 
 
 
 
 
114
  = 1.7.4.1 =
115
  - WooCommerce integration: on product pages sets `og:type` to `product` and adds the price including tax to the `product:price` tags
116
 
4
  Tags: facebook, open graph, open graph protocol, share, social, meta, rss, twitter card, twitter, schema, google+, g+, google, google plus, image, like, seo, search engine optimization, woocommerce, yoast seo, subheading, php7
5
  Requires at least: 4.0
6
  Tested up to: 4.5
7
+ Stable tag: 1.7.4.2
8
  Inserts Facebook Open Graph, Google+/Schema.org, Twitter and other Meta Tags into your WordPress Website for more efficient sharing results.
9
 
10
  == Description ==
29
  * **og:site_name**: From blog title.
30
  * **og:title**: From post/page/archive/tag/... title.
31
  * **og:url**: From the post/page permalink.
32
+ * **og:type**: "website" or "blog" for the homepage, "product" for WooCommerce products and "article" for all the others.
33
  * **article:published_time**: Article published time (for posts only)
34
  * **article:modified_time** and **og:updated_time**: Article modified time (for posts only)
35
  * **article:publisher**: From settings on the options screen.
38
  * **og:description**: From post/page excerpt if it exist, or from post/page content. From category/tag description on it's pages, if it exist. From tagline, or custom text, on all the others.
39
  * **og:image**: From a specific custom field of the post/page, or if not set from the post/page featured/thumbnail image, or if it doesn't exist from the first image in the post content, or if it doesn't exist from the first image on the post media gallery, or if it doesn't exist from the default image defined on the options menu. The same image chosen here will be used and enclosure/media:content on the RSS feed.
40
  * **og:image:width** and **og:image:height**: Image dimensions.
41
+ * **og:price:amount** and **og:price:currency**: Price on WooCommerce products.
42
 
43
  = The (Google+) Schema.org Tags that this plugin inserts are: =
44
 
68
  = 3rd Party Integration: =
69
 
70
  * **[WordPress SEO by Yoast](http://wordpress.org/plugins/wordpress-seo/)**: Allows you to use title, url (canonical) and description from WPSEO plugin.
71
+ * **[WooCommerce](https://wordpress.org/plugins/woocommerce/)**: On product pages sets `og:type` to `product` and adds the price including tax to the `product:price` tags. Also allows you to use the Product Category thumbnails as Open Graph Image and have Product Gallery images as additional Open Graph Images
72
  * **[SubHeading](http://wordpress.org/extend/plugins/subheading/)**: Add the SubHeading to the post/page title.
73
  * **[Business Directory Plugin](http://wordpress.org/extend/plugins/business-directory-plugin/)**: Allows you to use BDP listing contents as Open Graph Tags.
74
 
112
 
113
  == Changelog ==
114
 
115
+ = 1.7.4.2 =
116
+ - Overlay PNG will only be used on locally hosted images
117
+ - New `fb_og_image_overlay` filter to be able to disable Overlay PNG programatically based on whatever needs of the developer
118
+ - Better texts about the Overlay PNG function on the settings page
119
+ - Minor fixes
120
+
121
  = 1.7.4.1 =
122
  - WooCommerce integration: on product pages sets `og:type` to `product` and adds the price including tax to the `product:price` tags
123
 
wonderm00n-open-graph.php CHANGED
@@ -445,8 +445,15 @@ function webdados_fb_open_graph() {
445
  }
446
 
447
  //Image overlay?
448
- if (intval($fb_image_overlay)==1) {
449
- $fb_image = plugins_url('/wonderm00ns-simple-facebook-open-graph-tags/fbimg.php?img='.urlencode($fb_image));
 
 
 
 
 
 
 
450
  }
451
 
452
  //No spaces on URLs
445
  }
446
 
447
  //Image overlay?
448
+ if ( intval($fb_image_overlay)==1 && apply_filters('fb_og_image_overlay', true, $fb_image) ) {
449
+ $fb_image_parsed = parse_url($fb_image);
450
+ //Only if the image is hosted locally
451
+ if ( $fb_image_parsed['host']==$_SERVER['HTTP_HOST'] ) {
452
+ $fb_image = plugins_url('/wonderm00ns-simple-facebook-open-graph-tags/fbimg.php?img='.urlencode($fb_image));
453
+ //We know the exact size now. We better just show it, right?
454
+ $fb_image_size_show = 1;
455
+ $fb_image_size = array(1200, 630);
456
+ }
457
  }
458
 
459
  //No spaces on URLs