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

Version Description

  • Minor fix to avoid php notices filling up error logs. Thanks to @flynsarmy (yet again).
Download this release

Release Info

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

Code changes from version 0.5.2.1 to 0.5.3

includes/settings-page.php CHANGED
@@ -13,36 +13,36 @@
13
  if ( isset($_POST['action']) ) {
14
  if (trim($_POST['action'])=='save') {
15
  //This should also use the $wonderm00n_open_graph_plugin_settings array, but because of intval and trim we still can't
16
- update_option('wonderm00n_open_graph_fb_app_id_show', intval($_POST['fb_app_id_show']));
17
- update_option('wonderm00n_open_graph_fb_app_id', trim($_POST['fb_app_id']));
18
- update_option('wonderm00n_open_graph_fb_admin_id_show', intval($_POST['fb_admin_id_show']));
19
- update_option('wonderm00n_open_graph_fb_admin_id', trim($_POST['fb_admin_id']));
20
- update_option('wonderm00n_open_graph_fb_locale_show', intval($_POST['fb_locale_show']));
21
- update_option('wonderm00n_open_graph_fb_locale', trim($_POST['fb_locale']));
22
- update_option('wonderm00n_open_graph_fb_sitename_show', intval($_POST['fb_sitename_show']));
23
- update_option('wonderm00n_open_graph_fb_title_show', intval($_POST['fb_title_show']));
24
- update_option('wonderm00n_open_graph_fb_title_show_schema', intval($_POST['fb_title_show_schema']));
25
- update_option('wonderm00n_open_graph_fb_url_show', intval($_POST['fb_url_show']));
26
- update_option('wonderm00n_open_graph_fb_url_canonical', intval($_POST['fb_url_canonical']));
27
- update_option('wonderm00n_open_graph_fb_url_add_trailing', intval($_POST['fb_url_add_trailing']));
28
- update_option('wonderm00n_open_graph_fb_type_show', intval($_POST['fb_type_show']));
29
- update_option('wonderm00n_open_graph_fb_type_homepage', trim($_POST['fb_type_homepage']));
30
- update_option('wonderm00n_open_graph_fb_desc_show', intval($_POST['fb_desc_show']));
31
- update_option('wonderm00n_open_graph_fb_desc_show_meta', intval($_POST['fb_desc_show_meta']));
32
- update_option('wonderm00n_open_graph_fb_desc_show_schema', intval($_POST['fb_desc_show_schema']));
33
- update_option('wonderm00n_open_graph_fb_desc_chars', intval($_POST['fb_desc_chars']));
34
- update_option('wonderm00n_open_graph_fb_desc_homepage', trim($_POST['fb_desc_homepage']));
35
- update_option('wonderm00n_open_graph_fb_desc_homepage_customtext', trim($_POST['fb_desc_homepage_customtext']));
36
- update_option('wonderm00n_open_graph_fb_image_show', intval($_POST['fb_image_show']));
37
- update_option('wonderm00n_open_graph_fb_image_show_schema', intval($_POST['fb_image_show_schema']));
38
- update_option('wonderm00n_open_graph_fb_image', trim($_POST['fb_image']));
39
- update_option('wonderm00n_open_graph_fb_image_rss', intval($_POST['fb_image_rss']));
40
- update_option('wonderm00n_open_graph_fb_image_use_featured', intval($_POST['fb_image_use_featured']));
41
- update_option('wonderm00n_open_graph_fb_image_use_content', intval($_POST['fb_image_use_content']));
42
- update_option('wonderm00n_open_graph_fb_image_use_media', intval($_POST['fb_image_use_media']));
43
- update_option('wonderm00n_open_graph_fb_image_use_default', intval($_POST['fb_image_use_default']));
44
- update_option('wonderm00n_open_graph_fb_show_subheading', intval($_POST['fb_show_subheading']));
45
- update_option('wonderm00n_open_graph_fb_show_businessdirectoryplugin', intval($_POST['fb_show_businessdirectoryplugin']));
46
  }
47
  }
48
 
@@ -56,7 +56,7 @@
56
  foreach($usersettings as $key => $value) {
57
  //if ($value=='') {
58
  if (strlen(trim($value))==0) {
59
- if ($defaults[$key]!='') {
60
  $usersettings[$key]=$defaults[$key];
61
  }
62
  }
13
  if ( isset($_POST['action']) ) {
14
  if (trim($_POST['action'])=='save') {
15
  //This should also use the $wonderm00n_open_graph_plugin_settings array, but because of intval and trim we still can't
16
+ update_option('wonderm00n_open_graph_fb_app_id_show', intval(wonderm00n_open_graph_post($_POST['fb_app_id_show'])));
17
+ update_option('wonderm00n_open_graph_fb_app_id', trim(wonderm00n_open_graph_post($_POST['fb_app_id'])));
18
+ update_option('wonderm00n_open_graph_fb_admin_id_show', intval(wonderm00n_open_graph_post($_POST['fb_admin_id_show'])));
19
+ update_option('wonderm00n_open_graph_fb_admin_id', trim(wonderm00n_open_graph_post($_POST['fb_admin_id'])));
20
+ update_option('wonderm00n_open_graph_fb_locale_show', intval(wonderm00n_open_graph_post($_POST['fb_locale_show'])));
21
+ update_option('wonderm00n_open_graph_fb_locale', trim(wonderm00n_open_graph_post($_POST['fb_locale'])));
22
+ update_option('wonderm00n_open_graph_fb_sitename_show', intval(wonderm00n_open_graph_post($_POST['fb_sitename_show'])));
23
+ update_option('wonderm00n_open_graph_fb_title_show', intval(wonderm00n_open_graph_post($_POST['fb_title_show'])));
24
+ update_option('wonderm00n_open_graph_fb_title_show_schema', intval(wonderm00n_open_graph_post($_POST['fb_title_show_schema'])));
25
+ update_option('wonderm00n_open_graph_fb_url_show', intval(wonderm00n_open_graph_post($_POST['fb_url_show'])));
26
+ update_option('wonderm00n_open_graph_fb_url_canonical', intval(wonderm00n_open_graph_post($_POST['fb_url_canonical'])));
27
+ update_option('wonderm00n_open_graph_fb_url_add_trailing', intval(wonderm00n_open_graph_post($_POST['fb_url_add_trailing'])));
28
+ update_option('wonderm00n_open_graph_fb_type_show', intval(wonderm00n_open_graph_post($_POST['fb_type_show'])));
29
+ update_option('wonderm00n_open_graph_fb_type_homepage', trim(wonderm00n_open_graph_post($_POST['fb_type_homepage'])));
30
+ update_option('wonderm00n_open_graph_fb_desc_show', intval(wonderm00n_open_graph_post($_POST['fb_desc_show'])));
31
+ update_option('wonderm00n_open_graph_fb_desc_show_meta', intval(wonderm00n_open_graph_post($_POST['fb_desc_show_meta'])));
32
+ update_option('wonderm00n_open_graph_fb_desc_show_schema', intval(wonderm00n_open_graph_post($_POST['fb_desc_show_schema'])));
33
+ update_option('wonderm00n_open_graph_fb_desc_chars', intval(wonderm00n_open_graph_post($_POST['fb_desc_chars'])));
34
+ update_option('wonderm00n_open_graph_fb_desc_homepage', trim(wonderm00n_open_graph_post($_POST['fb_desc_homepage'])));
35
+ update_option('wonderm00n_open_graph_fb_desc_homepage_customtext', trim(wonderm00n_open_graph_post($_POST['fb_desc_homepage_customtext'])));
36
+ update_option('wonderm00n_open_graph_fb_image_show', intval(wonderm00n_open_graph_post($_POST['fb_image_show'])));
37
+ update_option('wonderm00n_open_graph_fb_image_show_schema', intval(wonderm00n_open_graph_post($_POST['fb_image_show_schema'])));
38
+ update_option('wonderm00n_open_graph_fb_image', trim(wonderm00n_open_graph_post($_POST['fb_image'])));
39
+ update_option('wonderm00n_open_graph_fb_image_rss', intval(wonderm00n_open_graph_post($_POST['fb_image_rss'])));
40
+ update_option('wonderm00n_open_graph_fb_image_use_featured', intval(wonderm00n_open_graph_post($_POST['fb_image_use_featured'])));
41
+ update_option('wonderm00n_open_graph_fb_image_use_content', intval(wonderm00n_open_graph_post($_POST['fb_image_use_content'])));
42
+ update_option('wonderm00n_open_graph_fb_image_use_media', intval(wonderm00n_open_graph_post($_POST['fb_image_use_media'])));
43
+ update_option('wonderm00n_open_graph_fb_image_use_default', intval(wonderm00n_open_graph_post($_POST['fb_image_use_default'])));
44
+ update_option('wonderm00n_open_graph_fb_show_subheading', intval(wonderm00n_open_graph_post($_POST['fb_show_subheading'])));
45
+ update_option('wonderm00n_open_graph_fb_show_businessdirectoryplugin', intval(wonderm00n_open_graph_post($_POST['fb_show_businessdirectoryplugin'])));
46
  }
47
  }
48
 
56
  foreach($usersettings as $key => $value) {
57
  //if ($value=='') {
58
  if (strlen(trim($value))==0) {
59
+ if (!empty($defaults[$key])) {
60
  $usersettings[$key]=$defaults[$key];
61
  }
62
  }
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.5.1
7
- Stable tag: 0.5.2
8
 
9
  This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective Facebook sharing results.
10
  It also allows you to add the Meta Description tag and Schema.org Name, Description and Image tags for more effective Google+ sharing results.
@@ -50,6 +50,10 @@ Other Tags:
50
 
51
  == Changelog ==
52
 
 
 
 
 
53
  = 0.5.2.1 =
54
 
55
  * Fixed version number.
4
  Tags: facebook, open graph, seo, share, social, meta
5
  Requires at least: 3
6
  Tested up to: 3.5.1
7
+ Stable tag: 0.5.3
8
 
9
  This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective Facebook sharing results.
10
  It also allows you to add the Meta Description tag and Schema.org Name, Description and Image tags for more effective Google+ sharing results.
50
 
51
  == Changelog ==
52
 
53
+ = 0.5.3 =
54
+
55
+ * Minor fix to avoid php notices filling up error logs. Thanks to @flynsarmy (yet again).
56
+
57
  = 0.5.2.1 =
58
 
59
  * Fixed version number.
wonderm00n-open-graph.php CHANGED
@@ -1,18 +1,18 @@
1
  <?php
2
  /**
3
  * @package Wonderm00n's Simple Facebook Open Graph Meta Tags
4
- * @version 0.5.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 more effective Facebook sharing results. It also allows you to add the Meta Description tag and Schema.org Name, Description and Image tags for more effective Google+ 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
  Author: Marco Almeida (Wonderm00n)
11
- Version: 0.5.2.1
12
  Author URI: http://wonderm00n.com
13
  */
14
 
15
- $wonderm00n_open_graph_plugin_version='0.5.2.1';
16
  $wonderm00n_open_graph_plugin_settings=array(
17
  'fb_app_id_show',
18
  'fb_app_id',
@@ -469,4 +469,10 @@ function wonderm00n_open_graph_uninstall() {
469
  delete_option('wonderm00n_open_graph_activated');
470
  }
471
 
 
 
 
 
 
 
472
  ?>
1
  <?php
2
  /**
3
  * @package Wonderm00n's Simple Facebook Open Graph Meta Tags
4
+ * @version 0.5.3
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 more effective Facebook sharing results. It also allows you to add the Meta Description tag and Schema.org Name, Description and Image tags for more effective Google+ 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
  Author: Marco Almeida (Wonderm00n)
11
+ Version: 0.5.3
12
  Author URI: http://wonderm00n.com
13
  */
14
 
15
+ $wonderm00n_open_graph_plugin_version='0.5.3';
16
  $wonderm00n_open_graph_plugin_settings=array(
17
  'fb_app_id_show',
18
  'fb_app_id',
469
  delete_option('wonderm00n_open_graph_activated');
470
  }
471
 
472
+ //To avoid notices when updating options on settings-page.php
473
+ //Hey @flynsarmy you are here, see?
474
+ function wonderm00n_open_graph_post($var, $default='') {
475
+ return isset($var) ? $var : $default;
476
+ }
477
+
478
  ?>