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

Version Description

  • Bugfix when the og:image is not hosted on the same domain as the website/blog.
Download this release

Release Info

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

Code changes from version 0.2 to 0.2.1

Files changed (2) hide show
  1. readme.txt +5 -1
  2. wonderm00n-open-graph.php +9 -3
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, seo, share, social, meta
5
  Requires at least: 3
6
  Tested up to: 3.2.1
7
- Stable tag: 0.2
8
 
9
  This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective Facebook sharing results.
10
 
@@ -35,6 +35,10 @@ The tags that this plugin inserts are:
35
 
36
  == Changelog ==
37
 
 
 
 
 
38
  = 0.2 =
39
 
40
  * If the option is set to true, the same image obtained to the og:image will be added to the RSS feed on the "enclosure" and "media:content" tags so that apps like RSS Graffiti and twitterfeed post them correctly.
4
  Tags: facebook, open graph, seo, share, social, meta
5
  Requires at least: 3
6
  Tested up to: 3.2.1
7
+ Stable tag: 0.2.1
8
 
9
  This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective Facebook sharing results.
10
 
35
 
36
  == Changelog ==
37
 
38
+ = 0.2.1 =
39
+
40
+ * Bugfix when the og:image is not hosted on the same domain as the website/blog.
41
+
42
  = 0.2 =
43
 
44
  * If the option is set to true, the same image obtained to the og:image will be added to the RSS feed on the "enclosure" and "media:content" tags so that apps like RSS Graffiti and twitterfeed post them correctly.
wonderm00n-open-graph.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
  /**
3
  * @package Wonderm00n's Simple Facebook Open Graph Meta Tags
4
- * @version 0.2
5
  */
6
  /*
7
  Plugin Name: Wonderm00n's Simple Facebook Open Graph Meta Tags
8
  Plugin URI: http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-facebook-open-graph-tags/
9
  Description: This plugin inserts Facebook Open Graph Tags into your Wordpress Blog/Website for better Facebook sharing
10
  Author: Marco Almeida (Wonderm00n)
11
- Version: 0.2
12
  Author URI: http://wonderm00n.com
13
  */
14
 
@@ -239,8 +239,14 @@ function wonderm00n_open_graph_post_image($fb_image_use_featured=1, $fb_image_us
239
  //There's an image on the content
240
  $pos = strpos($image, site_url());
241
  if ($pos === false) {
242
- $fb_image=$_SERVER['HTTP_HOST'].$image;
 
 
 
 
 
243
  } else {
 
244
  $fb_image=$image;
245
  }
246
  $thumbdone=true;
1
  <?php
2
  /**
3
  * @package Wonderm00n's Simple Facebook Open Graph Meta Tags
4
+ * @version 0.2.1
5
  */
6
  /*
7
  Plugin Name: Wonderm00n's Simple Facebook Open Graph Meta Tags
8
  Plugin URI: http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-facebook-open-graph-tags/
9
  Description: This plugin inserts Facebook Open Graph Tags into your Wordpress Blog/Website for better Facebook sharing
10
  Author: Marco Almeida (Wonderm00n)
11
+ Version: 0.2.1
12
  Author URI: http://wonderm00n.com
13
  */
14
 
239
  //There's an image on the content
240
  $pos = strpos($image, site_url());
241
  if ($pos === false) {
242
+ if (stristr($image, 'http://') || stristr($image, 'https://')) {
243
+ //URL Completo fora do site
244
+ $fb_image=$image;
245
+ } else {
246
+ $fb_image=site_url().$image;
247
+ }
248
  } else {
249
+ //URL Completo no site
250
  $fb_image=$image;
251
  }
252
  $thumbdone=true;