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

Version Description

  • Better error handling when the overlay PNG image is not found or a valid image file;
Download this release

Release Info

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

Code changes from version 2.0.6.3 to 2.0.7

Files changed (3) hide show
  1. fbimg.php +28 -21
  2. readme.txt +5 -2
  3. wonderm00n-open-graph.php +3 -3
fbimg.php CHANGED
@@ -60,6 +60,8 @@
60
  imagedestroy($image);
61
  imagedestroy($thumb);
62
  imagedestroy($barra);
 
 
63
  }
64
 
65
  }
@@ -70,25 +72,30 @@
70
 
71
 
72
  function imagecreatefromfile( $filename ) {
73
- if (!file_exists($filename)) {
74
- throw new InvalidArgumentException('File "'.$filename.'" not found.');
75
- }
76
- switch ( strtolower( pathinfo( $filename, PATHINFO_EXTENSION ))) {
77
- case 'jpeg':
78
- case 'jpg':
79
- return imagecreatefromjpeg($filename);
80
- break;
81
-
82
- case 'png':
83
- return imagecreatefrompng($filename);
84
- break;
85
-
86
- case 'gif':
87
- return imagecreatefromgif($filename);
88
- break;
89
-
90
- default:
91
- throw new InvalidArgumentException('File "'.$filename.'" is not valid jpg, png or gif image.');
92
- break;
93
- }
 
 
 
 
 
94
  }
60
  imagedestroy($image);
61
  imagedestroy($thumb);
62
  imagedestroy($barra);
63
+ } else {
64
+
65
  }
66
 
67
  }
72
 
73
 
74
  function imagecreatefromfile( $filename ) {
75
+ try {
76
+ if (!file_exists($filename)) {
77
+ throw new InvalidArgumentException('File "'.$filename.'" not found.');
78
+ }
79
+ switch ( strtolower( pathinfo( $filename, PATHINFO_EXTENSION ))) {
80
+ case 'jpeg':
81
+ case 'jpg':
82
+ return imagecreatefromjpeg($filename);
83
+ break;
84
+
85
+ case 'png':
86
+ return imagecreatefrompng($filename);
87
+ break;
88
+
89
+ case 'gif':
90
+ return imagecreatefromgif($filename);
91
+ break;
92
+
93
+ default:
94
+ throw new InvalidArgumentException('File "'.$filename.'" is not valid jpg, png or gif image.');
95
+ break;
96
+ }
97
+ } catch (Exception $e) {
98
+ die( 'Caught exception: '. $e->getMessage() );
99
+ return false;
100
+ }
101
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: webdados, wonderm00n
3
  Donate link: http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-facebook-open-graph-tags/
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, wordpress seo, woocommerce, subheading, php7
5
  Requires at least: 4.0
6
- Tested up to: 4.7
7
- Stable tag: 2.0.6.3
8
  Inserts Facebook Open Graph, Google+/Schema.org, Twitter and SEO Meta Tags into your WordPress Website for more efficient sharing results.
9
 
10
  == Description ==
@@ -121,6 +121,9 @@ We DO NOT provide email support for this plugin. If you send us an email asking
121
 
122
  == Changelog ==
123
 
 
 
 
124
  = 2.0.6.3 =
125
  * When using the overlay PNG option, the image is filled with previously filled with white in case the original OG image is a transparent PNG
126
  * The `fb_og_thumb_fill_color` can be used to use another color other than white, by returning an array with the rgb value
3
  Donate link: http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-facebook-open-graph-tags/
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, wordpress seo, woocommerce, subheading, php7
5
  Requires at least: 4.0
6
+ Tested up to: 4.7.2
7
+ Stable tag: 2.0.7
8
  Inserts Facebook Open Graph, Google+/Schema.org, Twitter and SEO Meta Tags into your WordPress Website for more efficient sharing results.
9
 
10
  == Description ==
121
 
122
  == Changelog ==
123
 
124
+ = 2.0.7 =
125
+ * Better error handling when the overlay PNG image is not found or a valid image file;
126
+
127
  = 2.0.6.3 =
128
  * When using the overlay PNG option, the image is filled with previously filled with white in case the original OG image is a transparent PNG
129
  * The `fb_og_thumb_fill_color` can be used to use another color other than white, by returning an array with the rgb value
wonderm00n-open-graph.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
  /**
3
  * @package Facebook Open Graph, Google+ and Twitter Card Tags
4
- * @version 2.0.6.3
5
  */
6
  /*
7
  Plugin Name: Facebook Open Graph, Google+ and Twitter Card Tags
8
  Plugin URI: http://www.webdados.pt/produtos-e-servicos/internet/desenvolvimento-wordpress/facebook-open-graph-meta-tags-wordpress/
9
  Description: Inserts Facebook Open Graph, Google+/Schema.org, Twitter Card and SEO Meta Tags into your WordPress Blog/Website for more effective and efficient Facebook, Google+ and Twitter sharing results. You can also choose to insert the "enclosure" and "media:content" tags to the RSS feeds, so that apps like RSS Graffiti and Twitterfeed post the image to Facebook correctly.
10
 
11
- Version: 2.0.6.3
12
  Author: Webdados
13
  Author URI: http://www.webdados.pt
14
  Text Domain: wd-fb-og
@@ -17,7 +17,7 @@ Domain Path: /lang
17
 
18
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
19
 
20
- define( 'WEBDADOS_FB_VERSION', '2.0.6.3' );
21
  define( 'WEBDADOS_FB_PLUGIN_NAME', 'Facebook Open Graph, Google+ and Twitter Card Tags' );
22
  define( 'WEBDADOS_FB_W', 1200 );
23
  define( 'WEBDADOS_FB_H', 630 );
1
  <?php
2
  /**
3
  * @package Facebook Open Graph, Google+ and Twitter Card Tags
4
+ * @version 2.0.7
5
  */
6
  /*
7
  Plugin Name: Facebook Open Graph, Google+ and Twitter Card Tags
8
  Plugin URI: http://www.webdados.pt/produtos-e-servicos/internet/desenvolvimento-wordpress/facebook-open-graph-meta-tags-wordpress/
9
  Description: Inserts Facebook Open Graph, Google+/Schema.org, Twitter Card and SEO Meta Tags into your WordPress Blog/Website for more effective and efficient Facebook, Google+ and Twitter sharing results. You can also choose to insert the "enclosure" and "media:content" tags to the RSS feeds, so that apps like RSS Graffiti and Twitterfeed post the image to Facebook correctly.
10
 
11
+ Version: 2.0.7
12
  Author: Webdados
13
  Author URI: http://www.webdados.pt
14
  Text Domain: wd-fb-og
17
 
18
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
19
 
20
+ define( 'WEBDADOS_FB_VERSION', '2.0.7' );
21
  define( 'WEBDADOS_FB_PLUGIN_NAME', 'Facebook Open Graph, Google+ and Twitter Card Tags' );
22
  define( 'WEBDADOS_FB_W', 1200 );
23
  define( 'WEBDADOS_FB_H', 630 );