WordPress Share Buttons Plugin – AddThis - Version 5.2.1

Version Description

  • Fix for duplicate sharing tools showing up due to weird caching plugin behavior
  • Renaming the plugin from AddThis Sharing Buttons to Share Buttons by AddThis
  • Adding AddThis EULA
Download this release

Release Info

Developer bradaddthis.com
Plugin Icon 128x128 WordPress Share Buttons Plugin – AddThis
Version 5.2.1
Comparing to
See all releases

Code changes from version 5.2.0 to 5.2.1

AddThisConfigs.php CHANGED
@@ -486,7 +486,7 @@ if (!class_exists('AddThisConfigs')) {
486
  }
487
 
488
  // including select configs
489
- if (isset($this->configs['plugin_mode'])) {
490
  $pluginInfo['plugin_mode'] = $this->configs['addthis_plugin_controls'];
491
  }
492
 
486
  }
487
 
488
  // including select configs
489
+ if (isset($this->configs['addthis_plugin_controls'])) {
490
  $pluginInfo['plugin_mode'] = $this->configs['addthis_plugin_controls'];
491
  }
492
 
AddThisWordPressConnector.php CHANGED
@@ -59,6 +59,7 @@ if (!class_exists('AddThisWordPressConnector')) {
59
  'debug_profile_type',
60
  'script_location',
61
  'wpfooter',
 
62
  'follow_buttons_feature_enabled',
63
  'recommended_content_feature_enabled',
64
  'sharing_buttons_feature_enabled',
59
  'debug_profile_type',
60
  'script_location',
61
  'wpfooter',
62
+ 'xmlns_attrs',
63
  'follow_buttons_feature_enabled',
64
  'recommended_content_feature_enabled',
65
  'sharing_buttons_feature_enabled',
AddThisWordPressSharingButtonsPlugin.php CHANGED
@@ -25,9 +25,9 @@ if (!class_exists('AddThisWordPressSharingButtonsPlugin')) {
25
  Class AddThisWordPressSharingButtonsPlugin {
26
  // implements AddThisWordPressPluginInterface {
27
 
28
- static $version = '5.2.0';
29
  static $settingsPageId = 'addthis_social_widget';
30
- static $name = "AddThis Sharing Buttons";
31
  static $productPrefix = 'wpp';
32
  static $oldConfigVariableName = 'addthis_settings';
33
  static $configVariableName = 'addthis_sharing_buttons_settings';
25
  Class AddThisWordPressSharingButtonsPlugin {
26
  // implements AddThisWordPressPluginInterface {
27
 
28
+ static $version = '5.2.1';
29
  static $settingsPageId = 'addthis_social_widget';
30
+ static $name = "Share Buttons by AddThis";
31
  static $productPrefix = 'wpp';
32
  static $oldConfigVariableName = 'addthis_settings';
33
  static $configVariableName = 'addthis_sharing_buttons_settings';
addthis-for-wordpress.php CHANGED
@@ -258,10 +258,6 @@ class Addthis_Wordpress
258
  >
259
  <div class="Header">
260
  <h1><em>AddThis</em> Sharing Buttons</h1>';
261
- if (!_addthis_is_csr_form()) {
262
- $html .= '<span class="preview-save-btns">' . _addthis_settings_buttons(false) . '</span>';
263
- }
264
-
265
  $html .= '</div>';
266
 
267
  if ($this->_upgrade && !$this->addThisConfigs->getProfileId()) {
@@ -291,6 +287,11 @@ class Addthis_Wordpress
291
  <div class="Btn-container-end">
292
  ' . _addthis_settings_buttons(false) . '
293
  </div>
 
 
 
 
 
294
  </form>';
295
  }
296
 
258
  >
259
  <div class="Header">
260
  <h1><em>AddThis</em> Sharing Buttons</h1>';
 
 
 
 
261
  $html .= '</div>';
262
 
263
  if ($this->_upgrade && !$this->addThisConfigs->getProfileId()) {
287
  <div class="Btn-container-end">
288
  ' . _addthis_settings_buttons(false) . '
289
  </div>
290
+ <p>
291
+ <small>
292
+ '._addthis_eula_text().'
293
+ </small>
294
+ </p>
295
  </form>';
296
  }
297
 
addthis-toolbox.php CHANGED
@@ -37,16 +37,7 @@ class Addthis_ToolBox
37
  const AT_BELOW_POST_CAT_PAGE = "at-below-post-cat-page";
38
  const AT_ABOVE_POST_ARCH_PAGE = "at-above-post-arch-page";
39
  const AT_BELOW_POST_ARCH_PAGE = "at-below-post-arch-page";
40
- const AT_CONTENT_BELOW_POST_HOME = "at-below-post-homepage-recommended";
41
- const AT_CONTENT_BELOW_POST_PAGE = "at-below-post-page-recommended";
42
  const AT_CONTENT_BELOW_POST = "at-below-post-recommended";
43
- const AT_CONTENT_BELOW_CAT_PAGE = "at-below-post-cat-page-recommended";
44
- const AT_CONTENT_BELOW_ARCH_PAGE = "at-below-post-arch-page-recommended";
45
- const AT_CONTENT_ABOVE_POST_HOME = "at-above-post-homepage-recommended";
46
- const AT_CONTENT_ABOVE_POST_PAGE = "at-above-post-page-recommended";
47
- const AT_CONTENT_ABOVE_POST = "at-above-post-recommended";
48
- const AT_CONTENT_ABOVE_CAT_PAGE = "at-above-post-cat-page-recommended";
49
- const AT_CONTENT_ABOVE_ARCH_PAGE = "at-above-post-arch-page-recommended";
50
  protected $addThisConfigs;
51
  protected $cmsConnector;
52
 
@@ -91,50 +82,67 @@ class Addthis_ToolBox
91
  if ($this->addThisConfigs->getProfileId() && !is_404() && !is_feed()) {
92
  global $post;
93
  $postid = $post->ID;
94
- $at_flag = get_post_meta( $postid, '_at_widget', TRUE );
95
- if (!$configs['addthis_per_post_enabled']) {
96
- $at_flag = '1';
 
 
 
 
 
97
  }
98
 
99
- if (is_home() || is_front_page()) {
100
- if($at_flag == '' || $at_flag == '1'){
101
- $content = self::_buildDiv(self::AT_ABOVE_POST_HOME) .
102
- self::_buildDiv(self::AT_CONTENT_ABOVE_POST_HOME) .
103
- $content;
104
- $content .= self::_buildDiv(self::AT_BELOW_POST_HOME);
105
- $content .= self::_buildDiv(self::AT_CONTENT_BELOW_POST_HOME);
 
 
 
 
 
 
106
  }
107
- } else if (is_page()) {
108
- if($at_flag == '' || $at_flag == '1'){
109
- $content = self::_buildDiv(self::AT_ABOVE_POST_PAGE) .
110
- self::_buildDiv(self::AT_CONTENT_ABOVE_POST_PAGE) .
111
- $content;
112
- $content .= self::_buildDiv(self::AT_BELOW_POST_PAGE);
113
- $content .= self::_buildDiv(self::AT_CONTENT_BELOW_POST_PAGE);
 
 
 
 
 
 
 
 
 
 
114
  }
115
- } else if (is_single()) {
116
- if($at_flag == '' || $at_flag == '1'){
117
- $content = self::_buildDiv(self::AT_ABOVE_POST) .
118
- self::_buildDiv(self::AT_CONTENT_ABOVE_POST, false) .
119
- $content;
120
- $content .= self::_buildDiv(self::AT_BELOW_POST);
121
- $content .= self::_buildDiv(self::AT_CONTENT_BELOW_POST, false);
122
  }
123
- } else if (is_category()) {
124
- if($at_flag == '' || $at_flag == '1'){
125
- $content = self::_buildDiv(self::AT_ABOVE_POST_CAT_PAGE) .
126
- self::_buildDiv(self::AT_CONTENT_ABOVE_CAT_PAGE) .
127
- $content;
128
- $content .= self::_buildDiv(self::AT_BELOW_POST_CAT_PAGE);
129
- $content .= self::_buildDiv(self::AT_CONTENT_BELOW_CAT_PAGE);
130
  }
131
- } else if (is_archive()) {
132
- if($at_flag == '' || $at_flag == '1'){
133
- $content = self::_buildDiv(self::AT_ABOVE_POST_ARCH_PAGE) .
134
- self::_buildDiv(self::AT_CONTENT_ABOVE_ARCH_PAGE) .
135
- $content;
136
- $content .= self::_buildDiv(self::AT_BELOW_POST_ARCH_PAGE);
137
- $content .= self::_buildDiv(self::AT_CONTENT_BELOW_ARCH_PAGE);
138
  }
139
  }
140
  }
37
  const AT_BELOW_POST_CAT_PAGE = "at-below-post-cat-page";
38
  const AT_ABOVE_POST_ARCH_PAGE = "at-above-post-arch-page";
39
  const AT_BELOW_POST_ARCH_PAGE = "at-below-post-arch-page";
 
 
40
  const AT_CONTENT_BELOW_POST = "at-below-post-recommended";
 
 
 
 
 
 
 
41
  protected $addThisConfigs;
42
  protected $cmsConnector;
43
 
82
  if ($this->addThisConfigs->getProfileId() && !is_404() && !is_feed()) {
83
  global $post;
84
  $postid = $post->ID;
85
+ $metaBoxFlag = get_post_meta($postid, '_at_widget', TRUE);
86
+ if (!$configs['addthis_per_post_enabled']
87
+ || $metaBoxFlag == ''
88
+ || $metaBoxFlag == '1'
89
+ ) {
90
+ $metaBoxFlag = true;
91
+ } else {
92
+ $metaBoxFlag = false;
93
  }
94
 
95
+ if ($metaBoxFlag) {
96
+ $recommendedContent = false;
97
+
98
+ $htmlComments = array();
99
+ $htmlCommentLocations = array('above', 'below');
100
+
101
+ foreach ($htmlCommentLocations as $location) {
102
+ $htmlComments[$location] = array();
103
+ $search = 'AddThis Sharing Buttons '.$location;
104
+ $comment = '<!-- '.$search.' -->';
105
+
106
+ $htmlComments[$location]['search'] = $search;
107
+ $htmlComments[$location]['comment'] = $comment;
108
  }
109
+
110
+ if (is_home() || is_front_page()) {
111
+ $aboveDivClass = self::AT_ABOVE_POST_HOME;
112
+ $belowDivClass = self::AT_BELOW_POST_HOME;
113
+ } else if (is_page()) {
114
+ $aboveDivClass = self::AT_ABOVE_POST_PAGE;
115
+ $belowDivClass = self::AT_BELOW_POST_PAGE;
116
+ } else if (is_single()) {
117
+ $aboveDivClass = self::AT_ABOVE_POST;
118
+ $belowDivClass = self::AT_BELOW_POST;
119
+ $recommendedContent = true;
120
+ } else if (is_category()) {
121
+ $aboveDivClass = self::AT_ABOVE_POST_CAT_PAGE;
122
+ $belowDivClass = self::AT_BELOW_POST_CAT_PAGE;
123
+ } else if (is_archive()) {
124
+ $aboveDivClass = self::AT_ABOVE_POST_ARCH_PAGE;
125
+ $belowDivClass = self::AT_BELOW_POST_ARCH_PAGE;
126
  }
127
+
128
+ if (isset($aboveDivClass)
129
+ && strpos($inputHtml, $htmlComments['above']['search']) === false
130
+ ) {
131
+ $content = $htmlComments['above']['comment'] . self::_buildDiv($aboveDivClass) . $content;
 
 
132
  }
133
+
134
+ if (isset($belowDivClass)
135
+ && strpos($inputHtml, $htmlComments['below']['search']) === false
136
+ ) {
137
+ $content .= $htmlComments['below']['comment'];
138
+ $content .= self::_buildDiv($belowDivClass);
 
139
  }
140
+
141
+ if ($recommendedContent
142
+ && strpos($inputHtml, 'AddThis Recommended Content below') === false
143
+ ) {
144
+ $content .= '<!-- AddThis Recommended Content below --> ' ;
145
+ $content .= self::_buildDiv(self::AT_CONTENT_BELOW_POST, false);
 
146
  }
147
  }
148
  }
addthis-widget.php CHANGED
@@ -88,7 +88,13 @@ class Addthis_Horizontal_Recommended_Content_Widget extends WP_Widget
88
  '<input id="'.$this->get_field_id('title').'" '.
89
  'name="'.$this->get_field_name('title').'" '.
90
  'type="text" value="'.esc_attr($title).'">'.
91
- "</p>";
 
 
 
 
 
 
92
  }
93
 
94
  /**
@@ -188,7 +194,13 @@ class Addthis_Vertical_Recommended_Content_Widget extends WP_Widget
188
  '<input id="'.$this->get_field_id('title').'" '.
189
  'name="'.$this->get_field_name('title').'" '.
190
  'type="text" value="'.esc_attr($title).'">'.
191
- "</p>";
 
 
 
 
 
 
192
  }
193
 
194
  /**
88
  '<input id="'.$this->get_field_id('title').'" '.
89
  'name="'.$this->get_field_name('title').'" '.
90
  'type="text" value="'.esc_attr($title).'">'.
91
+ "</p>
92
+ <p>
93
+ <small>
94
+ "._addthis_eula_text(esc_html__('Save'))."
95
+ </small>
96
+ </p>
97
+ ";
98
  }
99
 
100
  /**
194
  '<input id="'.$this->get_field_id('title').'" '.
195
  'name="'.$this->get_field_name('title').'" '.
196
  'type="text" value="'.esc_attr($title).'">'.
197
+ "</p>
198
+ <p>
199
+ <small>
200
+ "._addthis_eula_text(esc_html__('Save'))."
201
+ </small>
202
+ </p>
203
+ ";
204
  }
205
 
206
  /**
addthis_addjs_new.php CHANGED
@@ -278,7 +278,7 @@ Class AddThis_addjs_sharing_button_plugin{
278
  foreach ($postTypes as $postType) {
279
  add_meta_box(
280
  'at_widget',
281
- __('AddThis Sharing Buttons'),
282
  array($this, 'add_at_flag_meta_box'),
283
  $postType,
284
  'advanced',
278
  foreach ($postTypes as $postType) {
279
  add_meta_box(
280
  'at_widget',
281
+ __('Share Buttons by AddThis'),
282
  array($this, 'add_at_flag_meta_box'),
283
  $postType,
284
  'advanced',
addthis_settings_functions.php CHANGED
@@ -471,6 +471,11 @@ function _addthis_excerpt_buttons_enabled() {
471
  return $enabled;
472
  }
473
 
 
 
 
 
 
474
  if (!function_exists('array_replace_recursive')) {
475
  function array_replace_recursive($array, $array1) {
476
  if (!function_exists('addthis_recurse')) {
471
  return $enabled;
472
  }
473
 
474
+ function _addthis_eula_text($buttonName = 'Save Changes') {
475
+ $eula = 'By clicking "'.$buttonName.'", you certify that you are at least 13 years old, and agree to the AddThis <a href="http://www.addthis.com/privacy/privacy-policy">Privacy Policy</a> and <a href="http://www.addthis.com/tos">Terms of Service</a>.';
476
+ return $eula;
477
+ }
478
+
479
  if (!function_exists('array_replace_recursive')) {
480
  function array_replace_recursive($array, $array1) {
481
  if (!function_exists('addthis_recurse')) {
addthis_sidebar_widget.php CHANGED
@@ -33,7 +33,7 @@ class AddThisSidebarWidget extends WP_Widget {
33
 
34
  $widget_ops = array(
35
  'classname' => 'atwidget',
36
- 'description' => 'Make it wasy for your users to share content to over 300 destinations'
37
  );
38
 
39
  /* Widget control settings. */
@@ -42,7 +42,7 @@ class AddThisSidebarWidget extends WP_Widget {
42
  /* Create the widget. */
43
  parent::__construct(
44
  'addthis-widget',
45
- 'AddThis Sharing Buttons',
46
  $widget_ops,
47
  $control_ops
48
  );
@@ -148,6 +148,11 @@ class AddThisSidebarWidget extends WP_Widget {
148
  </div>';
149
  }
150
  ?>
 
 
 
 
 
151
  <?php
152
  }
153
 
33
 
34
  $widget_ops = array(
35
  'classname' => 'atwidget',
36
+ 'description' => 'Make it easy for your users to share content to over 300 destinations'
37
  );
38
 
39
  /* Widget control settings. */
42
  /* Create the widget. */
43
  parent::__construct(
44
  'addthis-widget',
45
+ 'Share Buttons by AddThis',
46
  $widget_ops,
47
  $control_ops
48
  );
148
  </div>';
149
  }
150
  ?>
151
+ <p>
152
+ <small>
153
+ <?php echo _addthis_eula_text(esc_html__('Save')); ?>
154
+ </small>
155
+ </p>
156
  <?php
157
  }
158
 
addthis_social_widget.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /**
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.2.0
7
  * Author: The AddThis Team
8
  * Author URI: http://www.addthis.com/
9
  * License: GPL2
@@ -96,7 +96,7 @@ function pluginActivationNotice()
96
  );
97
  $html = '<div class="addthis_updated wrap">';
98
  $html .= '<span>'.
99
- 'Congrats! You\'ve Installed AddThis Sharing Buttons'.
100
  '</span>';
101
  $html .= '<span><a class="addthis_configure" href="'
102
  . $cmsConnector->getSettingsPageUrl() .
@@ -265,7 +265,6 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
265
  );
266
 
267
 
268
- //add_filter('the_title', 'at_title_check');
269
  /**
270
  * @deprecated
271
  * @todo Add _deprecated_function notice.
@@ -587,7 +586,7 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
587
  $setupMessage = '
588
  <div class="updated addthis_setup_nag">
589
  <p>
590
- Configure the AddThis Sharing Buttons plugin to enable users to share your content around the web.
591
  <br />
592
  <a href="' . $cmsConnector->getSettingsPageUrl() . '">Configuration options</a>
593
  |
@@ -599,7 +598,7 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
599
  $updatedMessage = '
600
  <div class="updated addthis_setup_nag">
601
  <p>
602
- We have updated the options for the AddThis Sharing Buttons plugin. Check out the
603
  <a href="' . $cmsConnector->getSettingsPageUrl() . '">AddThis settings page</a> to see the new styles and options.
604
  <br />
605
  <a href="' . $cmsConnector->getSettingsPageUrl() . '">See New Options</a>
@@ -953,10 +952,6 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
953
  add_filter('get_the_excerpt', 'addthis_display_social_widget_excerpt', 11);
954
  }
955
 
956
- if (!empty($options['addthis_aftertitle'])) {
957
- add_filter('the_title', 'addthis_display_after_title', 11);
958
- }
959
-
960
  add_filter('the_content', 'addthis_display_social_widget', 15);
961
 
962
  }
@@ -1091,9 +1086,13 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1091
  global $addThisConfigs;
1092
  global $addthis_styles;
1093
  global $addthis_new_styles;
 
 
1094
 
1095
  remove_filter('get_the_excerpt', 'addthis_late_widget');
1096
- if (!_addthis_excerpt_buttons_enabled()) {
 
 
1097
  return $link_text;
1098
  }
1099
 
@@ -1128,7 +1127,7 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1128
 
1129
  $buttons = sprintf($template, addthis_get_identifier());
1130
 
1131
- return $link_text . $buttons;
1132
  }
1133
 
1134
 
@@ -1265,6 +1264,18 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1265
  $displayAbove = apply_filters('addthis_post_exclude', $displayAbove);
1266
  $displayBelow = apply_filters('addthis_post_exclude', $displayBelow);
1267
 
 
 
 
 
 
 
 
 
 
 
 
 
1268
  remove_filter('wp_trim_excerpt', 'addthis_remove_tag', 9, 1);
1269
  remove_filter('get_the_excerpt', 'addthis_late_widget');
1270
  $identifier = addthis_get_identifier();
@@ -1275,8 +1286,10 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1275
  && $options['above'] != 'disable'
1276
  && $displayAbove
1277
  && (!$excerpt || _addthis_excerpt_buttons_enabled_above())
 
1278
  ) {
1279
- $above = addthis_display_widget_above($styles, $options);
 
1280
  } elseif ($displayAbove) {
1281
  $above = '';
1282
  } else {
@@ -1288,8 +1301,10 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1288
  && $options['below'] != 'disable'
1289
  && $displayBelow
1290
  && (!$excerpt || _addthis_excerpt_buttons_enabled_below())
 
1291
  ) {
1292
- $below = addthis_display_widget_below($styles, $options);
 
1293
  } elseif ( $excerpt
1294
  && $displayBelow
1295
  && $options['below'] != 'none'
@@ -1303,12 +1318,17 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1303
  $below = '';
1304
  }
1305
 
1306
- $at_flag = get_post_meta( $post->ID, '_at_widget', TRUE );
1307
- if (!$options['addthis_per_post_enabled']) {
1308
- $at_flag = '1';
 
 
 
 
 
1309
  }
1310
 
1311
- if ($at_flag !== '0') {
1312
  if ($displayAbove && isset($above)) {
1313
  $content = sprintf($above, $identifier) . $content;
1314
  }
@@ -1590,10 +1610,6 @@ EOF;
1590
 
1591
  <div class="Header">
1592
  <h1><em>AddThis</em> Sharing Buttons</h1>
1593
-
1594
- <span class="preview-save-btns">
1595
- <?php echo _addthis_settings_buttons(); ?>
1596
- </span>
1597
  </div>
1598
 
1599
  <?php
@@ -1607,6 +1623,11 @@ EOF;
1607
 
1608
  <div class="Btn-container-end">
1609
  <?php echo _addthis_settings_buttons(); ?>
 
 
 
 
 
1610
  </div>
1611
 
1612
  </form>
@@ -2378,7 +2399,7 @@ function _addthis_display_options_card() {
2378
  (Recommended)
2379
  </span>
2380
  </label>
2381
- <span class="at-wp-tooltip" tooltip="When checked, your site will load before AddThis sharing buttons are added. If unchecked, your site will not load until AddThis buttons (and AddThis JavaScript) have been loaded by your vistors.">?</span>
2382
  </li>
2383
  <li>
2384
  <input
@@ -2405,7 +2426,7 @@ function _addthis_display_options_card() {
2405
  <strong>' . translate("Enhanced accessibility", 'addthis_trans_domain') . '</strong>
2406
  </span>
2407
  </label>
2408
- <span class="at-wp-tooltip" tooltip="Also known as 508 compliance. If checked, clicking an AddThis sharing button will open a new window to a page that is keyboard navigable for people with disabilities.">?</span>
2409
  </li>
2410
  </ul>
2411
  </li>
@@ -2652,7 +2673,8 @@ function _addthis_settings_buttons($includePreview = true) {
2652
  name="submit"
2653
  value="Save Changes"
2654
  class="Btn Btn-blue addthis-submit-button"
2655
- />';
 
2656
 
2657
  $html .= $saveHtml;
2658
 
1
  <?php
2
  /**
3
+ * Plugin Name: Share Buttons by AddThis
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.2.1
7
  * Author: The AddThis Team
8
  * Author URI: http://www.addthis.com/
9
  * License: GPL2
96
  );
97
  $html = '<div class="addthis_updated wrap">';
98
  $html .= '<span>'.
99
+ 'Congrats! You\'ve Installed Share Buttons by AddThis'.
100
  '</span>';
101
  $html .= '<span><a class="addthis_configure" href="'
102
  . $cmsConnector->getSettingsPageUrl() .
265
  );
266
 
267
 
 
268
  /**
269
  * @deprecated
270
  * @todo Add _deprecated_function notice.
586
  $setupMessage = '
587
  <div class="updated addthis_setup_nag">
588
  <p>
589
+ Configure the Share Buttons by AddThis plugin to enable users to share your content around the web.
590
  <br />
591
  <a href="' . $cmsConnector->getSettingsPageUrl() . '">Configuration options</a>
592
  |
598
  $updatedMessage = '
599
  <div class="updated addthis_setup_nag">
600
  <p>
601
+ We have updated the options for the Share Buttons by AddThis plugin. Check out the
602
  <a href="' . $cmsConnector->getSettingsPageUrl() . '">AddThis settings page</a> to see the new styles and options.
603
  <br />
604
  <a href="' . $cmsConnector->getSettingsPageUrl() . '">See New Options</a>
952
  add_filter('get_the_excerpt', 'addthis_display_social_widget_excerpt', 11);
953
  }
954
 
 
 
 
 
955
  add_filter('the_content', 'addthis_display_social_widget', 15);
956
 
957
  }
1086
  global $addThisConfigs;
1087
  global $addthis_styles;
1088
  global $addthis_new_styles;
1089
+ $search = 'AddThis Sharing Buttons below';
1090
+ $comment = '<!-- '.$search.' -->';
1091
 
1092
  remove_filter('get_the_excerpt', 'addthis_late_widget');
1093
+ if (!_addthis_excerpt_buttons_enabled()
1094
+ && strpos($link_text, $search) !== false
1095
+ ) {
1096
  return $link_text;
1097
  }
1098
 
1127
 
1128
  $buttons = sprintf($template, addthis_get_identifier());
1129
 
1130
+ return $link_text . $comment . $buttons;
1131
  }
1132
 
1133
 
1264
  $displayAbove = apply_filters('addthis_post_exclude', $displayAbove);
1265
  $displayBelow = apply_filters('addthis_post_exclude', $displayBelow);
1266
 
1267
+ $htmlComments = array();
1268
+ $htmlCommentLocations = array('above', 'below');
1269
+
1270
+ foreach ($htmlCommentLocations as $location) {
1271
+ $htmlComments[$location] = array();
1272
+ $search = 'AddThis Sharing Buttons '.$location;
1273
+ $comment = '<!-- '.$search.' -->';
1274
+
1275
+ $htmlComments[$location]['search'] = $search;
1276
+ $htmlComments[$location]['comment'] = $comment;
1277
+ }
1278
+
1279
  remove_filter('wp_trim_excerpt', 'addthis_remove_tag', 9, 1);
1280
  remove_filter('get_the_excerpt', 'addthis_late_widget');
1281
  $identifier = addthis_get_identifier();
1286
  && $options['above'] != 'disable'
1287
  && $displayAbove
1288
  && (!$excerpt || _addthis_excerpt_buttons_enabled_above())
1289
+ && strpos($content, $htmlComments['above']['search']) === false
1290
  ) {
1291
+ $above .= $htmlComments['above']['comment'];
1292
+ $above .= addthis_display_widget_above($styles, $options);
1293
  } elseif ($displayAbove) {
1294
  $above = '';
1295
  } else {
1301
  && $options['below'] != 'disable'
1302
  && $displayBelow
1303
  && (!$excerpt || _addthis_excerpt_buttons_enabled_below())
1304
+ && strpos($content, $htmlComments['below']['search']) === false
1305
  ) {
1306
+ $below .= $htmlComments['below']['comment'];
1307
+ $below .= addthis_display_widget_below($styles, $options);
1308
  } elseif ( $excerpt
1309
  && $displayBelow
1310
  && $options['below'] != 'none'
1318
  $below = '';
1319
  }
1320
 
1321
+ $metaBoxFlag = get_post_meta($post->ID, '_at_widget', TRUE);
1322
+ if (!$options['addthis_per_post_enabled']
1323
+ || $metaBoxFlag == ''
1324
+ || $metaBoxFlag == '1'
1325
+ ) {
1326
+ $metaBoxFlag = true;
1327
+ } else {
1328
+ $metaBoxFlag = false;
1329
  }
1330
 
1331
+ if ($metaBoxFlag) {
1332
  if ($displayAbove && isset($above)) {
1333
  $content = sprintf($above, $identifier) . $content;
1334
  }
1610
 
1611
  <div class="Header">
1612
  <h1><em>AddThis</em> Sharing Buttons</h1>
 
 
 
 
1613
  </div>
1614
 
1615
  <?php
1623
 
1624
  <div class="Btn-container-end">
1625
  <?php echo _addthis_settings_buttons(); ?>
1626
+ <p>
1627
+ <small>
1628
+ <?php echo _addthis_eula_text(); ?>
1629
+ </small>
1630
+ </p>
1631
  </div>
1632
 
1633
  </form>
2399
  (Recommended)
2400
  </span>
2401
  </label>
2402
+ <span class="at-wp-tooltip" tooltip="When checked, your site will load before share buttons by AddThis are added. If unchecked, your site will not load until AddThis buttons (and AddThis JavaScript) have been loaded by your vistors.">?</span>
2403
  </li>
2404
  <li>
2405
  <input
2426
  <strong>' . translate("Enhanced accessibility", 'addthis_trans_domain') . '</strong>
2427
  </span>
2428
  </label>
2429
+ <span class="at-wp-tooltip" tooltip="Also known as 508 compliance. If checked, clicking a share button by AddThis will open a new window to a page that is keyboard navigable for people with disabilities.">?</span>
2430
  </li>
2431
  </ul>
2432
  </li>
2673
  name="submit"
2674
  value="Save Changes"
2675
  class="Btn Btn-blue addthis-submit-button"
2676
+ />
2677
+ ';
2678
 
2679
  $html .= $saveHtml;
2680
 
readme.txt CHANGED
@@ -1,15 +1,15 @@
1
- === AddThis Sharing Buttons ===
2
  Contributors: abramsm, srijith.v, vipinss, dnrahamim, jgrodel, bradaddthiscom, mkitzman, addthis_paul, addthis_matt, addthis_elsa, ribin_addthis, AddThis_Mike
3
  Tags: bookmarking, email sharing, facebook, linkedin, pinterest, share, sharing buttons, social marketing, social tools, twitter, whatsapp
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
- Stable tag: 5.2.0
7
 
8
- AddThis provides the best sharing tools to help you make your website smarter.
9
 
10
  == Description ==
11
 
12
- The best sharing and following tools on the web are now available for your WordPress site. Promote your content easily by sharing to over 200 of the most popular social networking and bookmarking sites (like Facebook, Twitter, Pinterest, Google+, WhatsApp, LinkedIn and more). Clean, customizable and simple social buttons are unobtrusive, quick to load and recognized all over the web.
13
 
14
  == Installation ==
15
 
@@ -76,6 +76,11 @@ In the screen options you can enable the AddThis meta box. Check the box and sav
76
 
77
  == Changelog ==
78
 
 
 
 
 
 
79
  = 5.2.0 =
80
  * New feature: AddThis Sharing Buttons metabox supported on custom post types. This meta box is used to disable sharing buttons on posts when editing them.
81
  * Removing duplicate metabox title 'AddThis'
@@ -394,6 +399,9 @@ Fixed nondeterministic bug with the_title(), causing the title to occasionally a
394
 
395
  == Upgrade Notice ==
396
 
 
 
 
397
  = 5.2.0 =
398
  * New feature: AddThis Sharing Buttons metabox supported on custom post types. This meta box is used to disable sharing buttons on posts when editing them.
399
  * Removing duplicate metabox title 'AddThis'
1
+ === Share Buttons by AddThis ===
2
  Contributors: abramsm, srijith.v, vipinss, dnrahamim, jgrodel, bradaddthiscom, mkitzman, addthis_paul, addthis_matt, addthis_elsa, ribin_addthis, AddThis_Mike
3
  Tags: bookmarking, email sharing, facebook, linkedin, pinterest, share, sharing buttons, social marketing, social tools, twitter, whatsapp
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
+ Stable tag: 5.2.1
7
 
8
+ Share buttons from AddThis help you get more traffic from sharing through social networks.
9
 
10
  == Description ==
11
 
12
+ The best share buttons on the web are now available for your WordPress site. Promote your content easily by sharing to over 200 of the most popular social networking and bookmarking sites (like Facebook Share, Facebook Like, Twitter, Pinterest, Google+, WhatsApp, LinkedIn and more). Clean, customizable and simple share buttons are unobtrusive, quick to load and recognized all over the web.
13
 
14
  == Installation ==
15
 
76
 
77
  == Changelog ==
78
 
79
+ = 5.2.1 =
80
+ * Fix for duplicate sharing tools showing up due to weird caching plugin behavior
81
+ * Renaming the plugin from AddThis Sharing Buttons to Share Buttons by AddThis
82
+ * Adding AddThis EULA
83
+
84
  = 5.2.0 =
85
  * New feature: AddThis Sharing Buttons metabox supported on custom post types. This meta box is used to disable sharing buttons on posts when editing them.
86
  * Removing duplicate metabox title 'AddThis'
399
 
400
  == Upgrade Notice ==
401
 
402
+ = 5.2.1 =
403
+ Dupliate button issues? This may help. Also, we renamed the plugin from AddThis Sharing Buttons to Share Buttons by AddThis.
404
+
405
  = 5.2.0 =
406
  * New feature: AddThis Sharing Buttons metabox supported on custom post types. This meta box is used to disable sharing buttons on posts when editing them.
407
  * Removing duplicate metabox title 'AddThis'