WordPress Share Buttons Plugin – AddThis - Version 5.1.1

Version Description

  • PHP notice at addthis_social_widget.php:1337
  • PHP error for older versions of PHP (< 5.3.0) at addthis_settings_functions.php:476
  • Adding select configs and page info into addthis_plugin_info to aide the AddThis Support Team with troubleshooting
Download this release

Release Info

Developer jgrodel
Plugin Icon 128x128 WordPress Share Buttons Plugin – AddThis
Version 5.1.1
Comparing to
See all releases

Code changes from version 5.1.0 to 5.1.1

AddThisConfigs.php CHANGED
@@ -477,9 +477,60 @@ if (!class_exists('AddThisConfigs')) {
477
  $pluginInfo['cms_version'] = $this->cmsInterface->getCmsVersion();
478
  $pluginInfo['plugin_name'] = $this->cmsInterface->plugin->getName();
479
  $pluginInfo['plugin_version'] = $this->cmsInterface->getPluginVersion();
480
- $pluginInfo['plugin_mode'] = $this->configs['addthis_plugin_controls'];
481
  $pluginInfo['anonymous_profile_id'] = $this->getAnonymousProfileId();
482
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
483
  $json = json_encode($pluginInfo);
484
  return $json;
485
  }
477
  $pluginInfo['cms_version'] = $this->cmsInterface->getCmsVersion();
478
  $pluginInfo['plugin_name'] = $this->cmsInterface->plugin->getName();
479
  $pluginInfo['plugin_version'] = $this->cmsInterface->getPluginVersion();
 
480
  $pluginInfo['anonymous_profile_id'] = $this->getAnonymousProfileId();
481
 
482
+ if (current_user_can('install_plugins')) {
483
+ $pluginInfo['php_version'] = phpversion();
484
+ }
485
+
486
+ // including select configs
487
+ if (isset($this->configs['plugin_mode'])) {
488
+ $pluginInfo['plugin_mode'] = $this->configs['addthis_plugin_controls'];
489
+ }
490
+
491
+ if (isset($this->configs['addthis_per_post_enabled'])) {
492
+ $pluginInfo['select_prefs']['addthis_per_post_enabled'] = $this->configs['addthis_per_post_enabled'];
493
+ }
494
+
495
+ if (isset($this->configs['addthis_above_enabled'])) {
496
+ $pluginInfo['select_prefs']['addthis_above_enabled'] = $this->configs['addthis_above_enabled'];
497
+ }
498
+
499
+ if (isset($this->configs['addthis_below_enabled'])) {
500
+ $pluginInfo['select_prefs']['addthis_below_enabled'] = $this->configs['addthis_below_enabled'];
501
+ }
502
+
503
+ if (isset($this->configs['addthis_sidebar_enabled'])) {
504
+ $pluginInfo['select_prefs']['addthis_sidebar_enabled'] = $this->configs['addthis_sidebar_enabled'];
505
+ }
506
+
507
+ foreach ($this->configs as $field => $value) {
508
+ if (strpos($field, '_showon_') !== false) {
509
+ $pluginInfo['select_prefs'][$field] = $value;
510
+ }
511
+ }
512
+
513
+ // post specific stuff that requreis wp_query
514
+ global $wp_query;
515
+ if (isset($wp_query)) {
516
+ $pluginInfo['page_info']['template'] = _addthis_determine_template_type();
517
+ if(isset($wp_query->query_vars['post_type'])) {
518
+ $pluginInfo['page_info']['post_type'] = $wp_query->query_vars['post_type'];
519
+ }
520
+ }
521
+
522
+ // post specific meta box selection
523
+ global $post;
524
+ if (isset($post)) {
525
+ $at_flag = get_post_meta($post->ID, '_at_widget', TRUE);
526
+ if ($at_flag === '0') {
527
+ $pluginInfo['select_prefs']['sharing_enabled_on_post_via_metabox'] = false;
528
+ } else {
529
+ $pluginInfo['select_prefs']['sharing_enabled_on_post_via_metabox'] = true;
530
+ }
531
+
532
+ }
533
+
534
  $json = json_encode($pluginInfo);
535
  return $json;
536
  }
AddThisWordPressSharingButtonsPlugin.php CHANGED
@@ -25,7 +25,7 @@ if (!class_exists('AddThisWordPressSharingButtonsPlugin')) {
25
  Class AddThisWordPressSharingButtonsPlugin {
26
  // implements AddThisWordPressPluginInterface {
27
 
28
- static $version = '5.1.0';
29
  static $settingsPageId = 'addthis_social_widget';
30
  static $name = "AddThis Sharing Buttons";
31
  static $productPrefix = 'wpp';
25
  Class AddThisWordPressSharingButtonsPlugin {
26
  // implements AddThisWordPressPluginInterface {
27
 
28
+ static $version = '5.1.1';
29
  static $settingsPageId = 'addthis_social_widget';
30
  static $name = "AddThis Sharing Buttons";
31
  static $productPrefix = 'wpp';
addthis_settings_functions.php CHANGED
@@ -473,17 +473,19 @@ function _addthis_excerpt_buttons_enabled() {
473
 
474
  if (!function_exists('array_replace_recursive')) {
475
  function array_replace_recursive($array, $array1) {
476
- function recurse($array, $array1) {
477
- foreach ($array1 as $key => $value) {
478
- if (!isset($array[$key]) || (isset($array[$key]) && !is_array($array[$key]))) {
479
- $array[$key] = array();
 
 
 
 
 
 
 
 
480
  }
481
-
482
- if (is_array($value)) {
483
- $value = recurse($array[$key], $value);
484
- }
485
-
486
- $array[$key] = $value;
487
  }
488
 
489
  return $array;
@@ -497,7 +499,7 @@ if (!function_exists('array_replace_recursive')) {
497
  }
498
  for ($i = 1; $i < count($args); $i++) {
499
  if (is_array($args[$i])) {
500
- $array = recurse($array, $args[$i]);
501
  }
502
  }
503
 
473
 
474
  if (!function_exists('array_replace_recursive')) {
475
  function array_replace_recursive($array, $array1) {
476
+ if (!function_exists('addthis_recurse')) {
477
+ function addthis_recurse($array, $array1) {
478
+ foreach ($array1 as $key => $value) {
479
+ if (!isset($array[$key]) || (isset($array[$key]) && !is_array($array[$key]))) {
480
+ $array[$key] = array();
481
+ }
482
+
483
+ if (is_array($value)) {
484
+ $value = addthis_recurse($array[$key], $value);
485
+ }
486
+
487
+ $array[$key] = $value;
488
  }
 
 
 
 
 
 
489
  }
490
 
491
  return $array;
499
  }
500
  for ($i = 1; $i < count($args); $i++) {
501
  if (is_array($args[$i])) {
502
+ $array = addthis_recurse($array, $args[$i]);
503
  }
504
  }
505
 
addthis_social_widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: AddThis Sharing Buttons
4
  * Plugin URI: http://www.addthis.com
5
  * Description: Use the AddThis suite of website tools which includes sharing, following, recommended content, and conversion tools to help you make your website smarter. With AddThis, you can see how your users are engaging with your content, provide a personalized experience for each user and encourage them to share, subscribe or follow.
6
- * Version: 5.1.0
7
  * Author: The AddThis Team
8
  * Author URI: http://www.addthis.com/
9
  * License: GPL2
@@ -1334,7 +1334,6 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1334
  global $AddThis_addjs_sharing_button_plugin;
1335
  $script = addthis_output_script(true, true);
1336
  $AddThis_addjs_sharing_button_plugin->addToScript($script);
1337
- $AddThis_addjs_sharing_button_plugin->addAfterScript($addthis_sidebar);
1338
  }
1339
 
1340
  /**
3
  * Plugin Name: AddThis Sharing Buttons
4
  * Plugin URI: http://www.addthis.com
5
  * Description: Use the AddThis suite of website tools which includes sharing, following, recommended content, and conversion tools to help you make your website smarter. With AddThis, you can see how your users are engaging with your content, provide a personalized experience for each user and encourage them to share, subscribe or follow.
6
+ * Version: 5.1.1
7
  * Author: The AddThis Team
8
  * Author URI: http://www.addthis.com/
9
  * License: GPL2
1334
  global $AddThis_addjs_sharing_button_plugin;
1335
  $script = addthis_output_script(true, true);
1336
  $AddThis_addjs_sharing_button_plugin->addToScript($script);
 
1337
  }
1338
 
1339
  /**
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: abramsm, srijith.v, vipinss, dnrahamim, jgrodel, bradaddthiscom, m
3
  Tags: AddThis, addtoany, bookmark, bookmarking, email, e-mail, sharing buttons, share, share this, facebook, google+, pinterest, instagram, linkedin, whatsapp, social tools, website tools, twitter, content marketing, recommended content, conversion tool, subscription button, conversion tools, email tools, ecommerce tools, social marketing, personalization tools
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
- Stable tag: 5.1.0
7
 
8
  AddThis provides the best sharing tools to help you make your website smarter.
9
 
@@ -77,7 +77,9 @@ In the screen options you can enable the AddThis meta box. Check the box and sav
77
  == Changelog ==
78
 
79
  = 5.1.1 =
80
- * Fixing XSS bug in the administrative panel
 
 
81
 
82
  = 5.1.0 =
83
  * New feature: set your own addthis.layers() paramaters to customize further using our API (in WordPress mode only)
@@ -379,6 +381,11 @@ Fixed nondeterministic bug with the_title(), causing the title to occasionally a
379
 
380
  == Upgrade Notice ==
381
 
 
 
 
 
 
382
  = 5.1.0 =
383
  * New feature: set your own addthis.layers() paramaters to customize further using our API (in WordPress mode only)
384
  * Fixing a bug with the AddThis Sharing Buttons meta box not showing up for users in AddThis mode when editing posts
3
  Tags: AddThis, addtoany, bookmark, bookmarking, email, e-mail, sharing buttons, share, share this, facebook, google+, pinterest, instagram, linkedin, whatsapp, social tools, website tools, twitter, content marketing, recommended content, conversion tool, subscription button, conversion tools, email tools, ecommerce tools, social marketing, personalization tools
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
+ Stable tag: 5.1.1
7
 
8
  AddThis provides the best sharing tools to help you make your website smarter.
9
 
77
  == Changelog ==
78
 
79
  = 5.1.1 =
80
+ * PHP notice at addthis_social_widget.php:1337
81
+ * PHP error for older versions of PHP (< 5.3.0) at addthis_settings_functions.php:476
82
+ * Adding select configs and page info into addthis_plugin_info to aide <a href="http://support.addthis.com/">the AddThis Support Team</a> with troubleshooting
83
 
84
  = 5.1.0 =
85
  * New feature: set your own addthis.layers() paramaters to customize further using our API (in WordPress mode only)
381
 
382
  == Upgrade Notice ==
383
 
384
+ = 5.1.1 =
385
+ * PHP notice at addthis_social_widget.php:1337
386
+ * PHP error for older versions of PHP (< 5.3.0) at addthis_settings_functions.php:476
387
+ * Adding select configs and page info into addthis_plugin_info to aide <a href="http://support.addthis.com/">the AddThis Support Team</a> with troubleshooting
388
+
389
  = 5.1.0 =
390
  * New feature: set your own addthis.layers() paramaters to customize further using our API (in WordPress mode only)
391
  * Fixing a bug with the AddThis Sharing Buttons meta box not showing up for users in AddThis mode when editing posts