Version Description
- Fixed a bug where unset options would become active again. Thanks to @scrumpit.
Download this release
Release Info
Developer | wonderm00n |
Plugin | Open Graph for Facebook, Google+ and Twitter Card Tags |
Version | 0.3.3 |
Comparing to | |
See all releases |
Code changes from version 0.3.2 to 0.3.3
- includes/settings-page.php +6 -1
- readme.txt +5 -1
- wonderm00n-open-graph.php +49 -34
includes/settings-page.php
CHANGED
@@ -18,7 +18,12 @@
|
|
18 |
}
|
19 |
//Merge the settings "all together now" (yes, it's a Beatles reference)
|
20 |
foreach($usersettings as $key => $value) {
|
21 |
-
if ($value==''
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
extract($usersettings);
|
24 |
|
18 |
}
|
19 |
//Merge the settings "all together now" (yes, it's a Beatles reference)
|
20 |
foreach($usersettings as $key => $value) {
|
21 |
+
//if ($value=='') {
|
22 |
+
if (strlen(trim($value))==0) {
|
23 |
+
if ($defaults[$key]!='') {
|
24 |
+
$usersettings[$key]=$defaults[$key];
|
25 |
+
}
|
26 |
+
}
|
27 |
}
|
28 |
extract($usersettings);
|
29 |
|
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.4.2
|
7 |
-
Stable tag: 0.3.
|
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.3.2 =
|
39 |
|
40 |
* Fixed a typo on the settings page
|
4 |
Tags: facebook, open graph, seo, share, social, meta
|
5 |
Requires at least: 3
|
6 |
Tested up to: 3.4.2
|
7 |
+
Stable tag: 0.3.3
|
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.3.3 =
|
39 |
+
|
40 |
+
* Fixed a bug where unset options would become active again. Thanks to @scrumpit.
|
41 |
+
|
42 |
= 0.3.2 =
|
43 |
|
44 |
* Fixed a typo on the settings page
|
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.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 better Facebook sharing
|
10 |
Author: Marco Almeida (Wonderm00n)
|
11 |
-
Version: 0.3.
|
12 |
Author URI: http://wonderm00n.com
|
13 |
*/
|
14 |
|
15 |
-
$wonderm00n_open_graph_plugin_version='0.3.
|
16 |
$wonderm00n_open_graph_plugin_settings=array(
|
17 |
'fb_app_id_show',
|
18 |
'fb_app_id',
|
@@ -76,6 +76,20 @@ function wonderm00n_open_graph() {
|
|
76 |
//It's a Post or a Page or an attachment page
|
77 |
global $post;
|
78 |
$fb_title=esc_attr(strip_tags(stripslashes($post->post_title)));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
//SubHeading
|
80 |
if ($fb_show_subheading==1) {
|
81 |
@include_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
@@ -324,6 +338,38 @@ function wonderm00n_open_graph_post_image($fb_image_use_featured=1, $fb_image_us
|
|
324 |
|
325 |
//Admin
|
326 |
if ( is_admin() ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
327 |
add_action('admin_menu', 'wonderm00n_open_graph_add_options');
|
328 |
|
329 |
register_activation_hook(__FILE__, 'wonderm00n_open_graph_activate');
|
@@ -381,37 +427,6 @@ if ( is_admin() ) {
|
|
381 |
}
|
382 |
add_action('admin_print_scripts', 'wonderm00n_open_graph_scripts');
|
383 |
add_action('admin_print_styles', 'wonderm00n_open_graph_styles');
|
384 |
-
|
385 |
-
if ( isset($_POST['action']) ) {
|
386 |
-
if (trim($_POST['action'])=='save') {
|
387 |
-
//print_r($_POST);
|
388 |
-
//This should also use the $wonderm00n_open_graph_plugin_settings array, but because of intval and trim we still can't
|
389 |
-
update_option('wonderm00n_open_graph_fb_app_id_show', intval($_POST['fb_app_id_show']));
|
390 |
-
update_option('wonderm00n_open_graph_fb_app_id', trim($_POST['fb_app_id']));
|
391 |
-
update_option('wonderm00n_open_graph_fb_admin_id_show', intval($_POST['fb_admin_id_show']));
|
392 |
-
update_option('wonderm00n_open_graph_fb_admin_id', trim($_POST['fb_admin_id']));
|
393 |
-
update_option('wonderm00n_open_graph_fb_locale_show', intval($_POST['fb_locale_show']));
|
394 |
-
update_option('wonderm00n_open_graph_fb_locale', trim($_POST['fb_locale']));
|
395 |
-
update_option('wonderm00n_open_graph_fb_sitename_show', intval($_POST['fb_sitename_show']));
|
396 |
-
update_option('wonderm00n_open_graph_fb_title_show', intval($_POST['fb_title_show']));
|
397 |
-
update_option('wonderm00n_open_graph_fb_url_show', intval($_POST['fb_url_show']));
|
398 |
-
update_option('wonderm00n_open_graph_fb_url_add_trailing', intval($_POST['fb_url_add_trailing']));
|
399 |
-
update_option('wonderm00n_open_graph_fb_type_show', intval($_POST['fb_type_show']));
|
400 |
-
update_option('wonderm00n_open_graph_fb_type_homepage', trim($_POST['fb_type_homepage']));
|
401 |
-
update_option('wonderm00n_open_graph_fb_desc_show', intval($_POST['fb_desc_show']));
|
402 |
-
update_option('wonderm00n_open_graph_fb_desc_chars', intval($_POST['fb_desc_chars']));
|
403 |
-
update_option('wonderm00n_open_graph_fb_desc_homepage', trim($_POST['fb_desc_homepage']));
|
404 |
-
update_option('wonderm00n_open_graph_fb_desc_homepage_customtext', trim($_POST['fb_desc_homepage_customtext']));
|
405 |
-
update_option('wonderm00n_open_graph_fb_image_show', intval($_POST['fb_image_show']));
|
406 |
-
update_option('wonderm00n_open_graph_fb_image', trim($_POST['fb_image']));
|
407 |
-
update_option('wonderm00n_open_graph_fb_image_rss', intval($_POST['fb_image_rss']));
|
408 |
-
update_option('wonderm00n_open_graph_fb_image_use_featured', intval($_POST['fb_image_use_featured']));
|
409 |
-
update_option('wonderm00n_open_graph_fb_image_use_content', intval($_POST['fb_image_use_content']));
|
410 |
-
update_option('wonderm00n_open_graph_fb_image_use_media', intval($_POST['fb_image_use_media']));
|
411 |
-
update_option('wonderm00n_open_graph_fb_image_use_default', intval($_POST['fb_image_use_default']));
|
412 |
-
update_option('wonderm00n_open_graph_fb_show_subheading', intval($_POST['fb_show_subheading']));
|
413 |
-
}
|
414 |
-
}
|
415 |
}
|
416 |
|
417 |
|
1 |
<?php
|
2 |
/**
|
3 |
* @package Wonderm00n's Simple Facebook Open Graph Meta Tags
|
4 |
+
* @version 0.3.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 better Facebook sharing
|
10 |
Author: Marco Almeida (Wonderm00n)
|
11 |
+
Version: 0.3.3
|
12 |
Author URI: http://wonderm00n.com
|
13 |
*/
|
14 |
|
15 |
+
$wonderm00n_open_graph_plugin_version='0.3.3';
|
16 |
$wonderm00n_open_graph_plugin_settings=array(
|
17 |
'fb_app_id_show',
|
18 |
'fb_app_id',
|
76 |
//It's a Post or a Page or an attachment page
|
77 |
global $post;
|
78 |
$fb_title=esc_attr(strip_tags(stripslashes($post->post_title)));
|
79 |
+
//All In One SEO - To Do
|
80 |
+
if ($fb_show_allinoneseo==1) {
|
81 |
+
@include_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
82 |
+
if (is_plugin_active('all-in-one-seo-pack/all_in_one_seo_pack.php')) {
|
83 |
+
//Code still missing here
|
84 |
+
}
|
85 |
+
}
|
86 |
+
//Platinum SEO - To Do
|
87 |
+
if ($fb_show_platinumseo==1) {
|
88 |
+
@include_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
89 |
+
if (is_plugin_active('platinum-seo-pack/platinum_seo_pack.php')) {
|
90 |
+
//Code still missing here
|
91 |
+
}
|
92 |
+
}
|
93 |
//SubHeading
|
94 |
if ($fb_show_subheading==1) {
|
95 |
@include_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
338 |
|
339 |
//Admin
|
340 |
if ( is_admin() ) {
|
341 |
+
|
342 |
+
//First we save!
|
343 |
+
if ( isset($_POST['action']) ) {
|
344 |
+
if (trim($_POST['action'])=='save') {
|
345 |
+
//This should also use the $wonderm00n_open_graph_plugin_settings array, but because of intval and trim we still can't
|
346 |
+
update_option('wonderm00n_open_graph_fb_app_id_show', intval($_POST['fb_app_id_show']));
|
347 |
+
update_option('wonderm00n_open_graph_fb_app_id', trim($_POST['fb_app_id']));
|
348 |
+
update_option('wonderm00n_open_graph_fb_admin_id_show', intval($_POST['fb_admin_id_show']));
|
349 |
+
update_option('wonderm00n_open_graph_fb_admin_id', trim($_POST['fb_admin_id']));
|
350 |
+
update_option('wonderm00n_open_graph_fb_locale_show', intval($_POST['fb_locale_show']));
|
351 |
+
update_option('wonderm00n_open_graph_fb_locale', trim($_POST['fb_locale']));
|
352 |
+
update_option('wonderm00n_open_graph_fb_sitename_show', intval($_POST['fb_sitename_show']));
|
353 |
+
update_option('wonderm00n_open_graph_fb_title_show', intval($_POST['fb_title_show']));
|
354 |
+
update_option('wonderm00n_open_graph_fb_url_show', intval($_POST['fb_url_show']));
|
355 |
+
update_option('wonderm00n_open_graph_fb_url_add_trailing', intval($_POST['fb_url_add_trailing']));
|
356 |
+
update_option('wonderm00n_open_graph_fb_type_show', intval($_POST['fb_type_show']));
|
357 |
+
update_option('wonderm00n_open_graph_fb_type_homepage', trim($_POST['fb_type_homepage']));
|
358 |
+
update_option('wonderm00n_open_graph_fb_desc_show', intval($_POST['fb_desc_show']));
|
359 |
+
update_option('wonderm00n_open_graph_fb_desc_chars', intval($_POST['fb_desc_chars']));
|
360 |
+
update_option('wonderm00n_open_graph_fb_desc_homepage', trim($_POST['fb_desc_homepage']));
|
361 |
+
update_option('wonderm00n_open_graph_fb_desc_homepage_customtext', trim($_POST['fb_desc_homepage_customtext']));
|
362 |
+
update_option('wonderm00n_open_graph_fb_image_show', intval($_POST['fb_image_show']));
|
363 |
+
update_option('wonderm00n_open_graph_fb_image', trim($_POST['fb_image']));
|
364 |
+
update_option('wonderm00n_open_graph_fb_image_rss', intval($_POST['fb_image_rss']));
|
365 |
+
update_option('wonderm00n_open_graph_fb_image_use_featured', intval($_POST['fb_image_use_featured']));
|
366 |
+
update_option('wonderm00n_open_graph_fb_image_use_content', intval($_POST['fb_image_use_content']));
|
367 |
+
update_option('wonderm00n_open_graph_fb_image_use_media', intval($_POST['fb_image_use_media']));
|
368 |
+
update_option('wonderm00n_open_graph_fb_image_use_default', intval($_POST['fb_image_use_default']));
|
369 |
+
update_option('wonderm00n_open_graph_fb_show_subheading', intval($_POST['fb_show_subheading']));
|
370 |
+
}
|
371 |
+
}
|
372 |
+
|
373 |
add_action('admin_menu', 'wonderm00n_open_graph_add_options');
|
374 |
|
375 |
register_activation_hook(__FILE__, 'wonderm00n_open_graph_activate');
|
427 |
}
|
428 |
add_action('admin_print_scripts', 'wonderm00n_open_graph_scripts');
|
429 |
add_action('admin_print_styles', 'wonderm00n_open_graph_styles');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
430 |
}
|
431 |
|
432 |
|