WordPress Share Buttons Plugin – AddThis - Version 5.0.7

Version Description

  • Changed the page/post edit screens AddThing sharing buttons checkbox to on/off radiobuttons
  • Added a checkbox to the plugin's settings page's Advanced Options tab to enable/disable the per page/post sharing button configurations mentioned above
Download this release

Release Info

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

Code changes from version 5.0.6 to 5.0.7

AddThisConfigs.php CHANGED
@@ -44,7 +44,9 @@ if (!class_exists('AddThisConfigs')) {
44
  'addthis_below_enabled' => false,
45
  'addthis_bitly' => false,
46
  'addthis_config_json' => '',
 
47
  'addthis_language' => '',
 
48
  'addthis_plugin_controls' => 'AddThis',
49
  'addthis_profile' => '',
50
  'addthis_rate_us' => '',
@@ -53,7 +55,6 @@ if (!class_exists('AddThisConfigs')) {
53
  'addthis_sidebar_enabled' => false,
54
  'addthis_sidebar_position' => 'left',
55
  'addthis_twitter_template' => '',
56
- 'addthis_environment' => '',
57
  'atversion' => 300,
58
  'atversion_update_status' => 0,
59
  'below' => 'large_toolbox',
44
  'addthis_below_enabled' => false,
45
  'addthis_bitly' => false,
46
  'addthis_config_json' => '',
47
+ 'addthis_environment' => '',
48
  'addthis_language' => '',
49
+ 'addthis_per_post_enabled' => true,
50
  'addthis_plugin_controls' => 'AddThis',
51
  'addthis_profile' => '',
52
  'addthis_rate_us' => '',
55
  'addthis_sidebar_enabled' => false,
56
  'addthis_sidebar_position' => 'left',
57
  'addthis_twitter_template' => '',
 
58
  'atversion' => 300,
59
  'atversion_update_status' => 0,
60
  'below' => 'large_toolbox',
AddThisWordPressConnector.php CHANGED
@@ -26,7 +26,7 @@ if (!class_exists('AddThisWordpressConnector')) {
26
  // implements AddThisCmsConnectorInterface {
27
 
28
  static $settingsVariableName = 'addthis_settings';
29
- static $pluginVersion = '5.0.6';
30
  static $settingsPageId = 'addthis_social_widget';
31
  static $anonymousProfileIdPrefix = 'wp';
32
  static $pluginName = "AddThis Sharing Buttons";
@@ -581,6 +581,7 @@ if (!class_exists('AddThisWordpressConnector')) {
581
  'addthis_append_data',
582
  'addthis_asynchronous_loading',
583
  'addthis_bitly',
 
584
  );
585
 
586
  foreach ($checkboxFields as $field) {
26
  // implements AddThisCmsConnectorInterface {
27
 
28
  static $settingsVariableName = 'addthis_settings';
29
+ static $pluginVersion = '5.0.7';
30
  static $settingsPageId = 'addthis_social_widget';
31
  static $anonymousProfileIdPrefix = 'wp';
32
  static $pluginName = "AddThis Sharing Buttons";
581
  'addthis_append_data',
582
  'addthis_asynchronous_loading',
583
  'addthis_bitly',
584
+ 'addthis_per_post_enabled',
585
  );
586
 
587
  foreach ($checkboxFields as $field) {
addthis-toolbox.php CHANGED
@@ -86,10 +86,16 @@ class Addthis_ToolBox
86
  */
87
  public function addWidget($content)
88
  {
 
 
89
  if ($this->addThisConfigs->getProfileId() && !is_404() && !is_feed()) {
90
  global $post;
91
  $postid = $post->ID;
92
  $at_flag = get_post_meta( $postid, '_at_widget', TRUE );
 
 
 
 
93
  if (is_home() || is_front_page()) {
94
  if($at_flag == '' || $at_flag == '1'){
95
  $content = self::_buildDiv(self::AT_ABOVE_POST_HOME) .
86
  */
87
  public function addWidget($content)
88
  {
89
+ $configs = $this->addThisConfigs->getConfigs();
90
+
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) .
addthis_addjs_new.php CHANGED
@@ -252,20 +252,53 @@ Class AddThis_addjs_sharing_button_plugin{
252
  * Function to add checkbox to show/hide Addthis sharing buttons in admin post add/edit page.
253
  */
254
  public function register_post_at_flag() {
255
- add_meta_box('at_widget', __('AddThis For Wordpress'), array($this, 'add_at_flag_meta_box'), 'post', 'advanced', 'high');
256
- add_meta_box('at_widget', __('AddThis For Wordpress'), array($this, 'add_at_flag_meta_box'), 'page', 'advanced', 'high');
 
 
 
 
 
257
  }
258
  /*
259
  * Function to add checkbox to show/hide Addthis sharing buttons in admin post add/edit page.
260
  */
261
  public function add_at_flag_meta_box($post){
262
  $at_flag = get_post_meta($post->ID, '_at_widget', true);
263
- echo "<label for='_at_widget'>".__('Show AddThis sharing buttons: ', 'foobar')."</label>";
264
- if($at_flag == '' || $at_flag == '1'){
265
- echo "<input type='checkbox' name='_at_widget' id='at_widget' value='1' checked='checked'/>";
266
- } else if($at_flag == '0'){
267
- echo "<input type='checkbox' name='_at_widget' id='at_widget' value='1'/>";
 
 
268
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
269
  }
270
  /*
271
  * Function to save the value of checkbox to show/hide Addthis sharing buttons in admin post add/edit page.
@@ -274,13 +307,14 @@ Class AddThis_addjs_sharing_button_plugin{
274
  global $post;
275
 
276
  //Ignore if trigger is by theme specific actions without post object
277
- if (!isset($post)) {
278
  return;
279
  }
280
 
281
- if(isset($_POST['_at_widget']))
282
- update_post_meta($post->ID, '_at_widget', $_POST['_at_widget']);
283
- else
284
  update_post_meta($post->ID, '_at_widget', '0');
 
285
  }
286
  }
252
  * Function to add checkbox to show/hide Addthis sharing buttons in admin post add/edit page.
253
  */
254
  public function register_post_at_flag() {
255
+ $configs = $this->addThisConfigs->getConfigs();
256
+ if (!$configs['addthis_per_post_enabled']) {
257
+ return;
258
+ }
259
+
260
+ add_meta_box('at_widget', __('AddThis Sharing Buttons'), array($this, 'add_at_flag_meta_box'), 'post', 'advanced', 'high');
261
+ add_meta_box('at_widget', __('AddThis Sharing Buttons'), array($this, 'add_at_flag_meta_box'), 'page', 'advanced', 'high');
262
  }
263
  /*
264
  * Function to add checkbox to show/hide Addthis sharing buttons in admin post add/edit page.
265
  */
266
  public function add_at_flag_meta_box($post){
267
  $at_flag = get_post_meta($post->ID, '_at_widget', true);
268
+
269
+ $off_checked = '';
270
+ $on_checked = '';
271
+ if ($at_flag == '0') {
272
+ $off_checked = 'checked="checked"';
273
+ } else {
274
+ $on_checked = 'checked="checked"';
275
  }
276
+
277
+ $html = '
278
+ <label for="_at_widget_on">
279
+ <input
280
+ type="radio"
281
+ id="_at_widget_on"
282
+ name="_at_widget"
283
+ value="1"
284
+ ' . $on_checked . '
285
+ />
286
+ <span class="addthis-checkbox-label">On</span>
287
+ </label>
288
+ <label for="_at_widget_off">
289
+ <input
290
+ type="radio"
291
+ id="_at_widget_off"
292
+ name="_at_widget"
293
+ value="0"
294
+ ' . $off_checked . '
295
+ />
296
+ <span class="addthis-checkbox-label">Off</span>
297
+ </label>
298
+ ';
299
+
300
+ echo $html;
301
+
302
  }
303
  /*
304
  * Function to save the value of checkbox to show/hide Addthis sharing buttons in admin post add/edit page.
307
  global $post;
308
 
309
  //Ignore if trigger is by theme specific actions without post object
310
+ if (!isset($post, $_POST['_at_widget'])) {
311
  return;
312
  }
313
 
314
+ if ($_POST['_at_widget'] == 1) {
315
+ update_post_meta($post->ID, '_at_widget', '1');
316
+ } else {
317
  update_post_meta($post->ID, '_at_widget', '0');
318
+ }
319
  }
320
  }
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.0.6
7
  * Author: The AddThis Team
8
  * Author URI: http://www.addthis.com/
9
  * License: GPL2
@@ -323,6 +323,9 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
323
  if ($asynchronous_loading = get_option('addthis_asynchronous_loading'))
324
  $addthis_new_options['addthis_asynchronous_loading'] = $asynchronous_loading;
325
 
 
 
 
326
  if ($append_data = get_option('addthis_append_data'))
327
  $addthis_new_options['addthis_append_data'] = $append_data;
328
 
@@ -794,6 +797,7 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
794
  'addthis_below_enabled',
795
  'addthis_bitly',
796
  'addthis_sidebar_enabled',
 
797
  );
798
 
799
  // add all share button location template settings to list of checkbox fields
@@ -1283,6 +1287,10 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1283
  }
1284
 
1285
  $at_flag = get_post_meta( $post->ID, '_at_widget', TRUE );
 
 
 
 
1286
  if ($at_flag !== '0') {
1287
  if ($displayAbove && isset($above)) {
1288
  $content = sprintf($above, $url_above) . $content;
@@ -2343,10 +2351,14 @@ function _addthis_display_options_card() {
2343
 
2344
  $checkedString = 'checked="checked"';
2345
  $asyncChecked = "";
 
2346
  $a508Checked = "";
2347
  if (!empty($options['addthis_asynchronous_loading'])) {
2348
  $asyncChecked = $checkedString;
2349
  }
 
 
 
2350
  if (!empty($options['addthis_508'])) {
2351
  $a508Checked = $checkedString;
2352
  }
@@ -2374,6 +2386,20 @@ function _addthis_display_options_card() {
2374
  </label>
2375
  <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>
2376
  </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2377
  <li>
2378
  <input
2379
  id="addthis_508"
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.0.7
7
  * Author: The AddThis Team
8
  * Author URI: http://www.addthis.com/
9
  * License: GPL2
323
  if ($asynchronous_loading = get_option('addthis_asynchronous_loading'))
324
  $addthis_new_options['addthis_asynchronous_loading'] = $asynchronous_loading;
325
 
326
+ if ($addthis_per_post_enabled = get_option('addthis_per_post_enabled'))
327
+ $addthis_new_options['addthis_per_post_enabled'] = $addthis_per_post_enabled;
328
+
329
  if ($append_data = get_option('addthis_append_data'))
330
  $addthis_new_options['addthis_append_data'] = $append_data;
331
 
797
  'addthis_below_enabled',
798
  'addthis_bitly',
799
  'addthis_sidebar_enabled',
800
+ 'addthis_per_post_enabled',
801
  );
802
 
803
  // add all share button location template settings to list of checkbox fields
1287
  }
1288
 
1289
  $at_flag = get_post_meta( $post->ID, '_at_widget', TRUE );
1290
+ if (!$options['addthis_per_post_enabled']) {
1291
+ $at_flag = '1';
1292
+ }
1293
+
1294
  if ($at_flag !== '0') {
1295
  if ($displayAbove && isset($above)) {
1296
  $content = sprintf($above, $url_above) . $content;
2351
 
2352
  $checkedString = 'checked="checked"';
2353
  $asyncChecked = "";
2354
+ $perPostEnableChecked = "";
2355
  $a508Checked = "";
2356
  if (!empty($options['addthis_asynchronous_loading'])) {
2357
  $asyncChecked = $checkedString;
2358
  }
2359
+ if (!empty($options['addthis_per_post_enabled'])) {
2360
+ $perPostEnableChecked = $checkedString;
2361
+ }
2362
  if (!empty($options['addthis_508'])) {
2363
  $a508Checked = $checkedString;
2364
  }
2386
  </label>
2387
  <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>
2388
  </li>
2389
+ <li>
2390
+ <input
2391
+ id="addthis_per_post_enabled"
2392
+ type="checkbox"
2393
+ name="addthis_settings[addthis_per_post_enabled]"
2394
+ value="true" ' . $perPostEnableChecked . ' />
2395
+ <label for="addthis_per_post_enabled">
2396
+ <span class="addthis-checkbox-label">
2397
+ <strong>' . translate("Include an option to turn off sharing tools by post", 'addthis_trans_domain') . '</strong>
2398
+ (Recommended)
2399
+ </span>
2400
+ </label>
2401
+ <span class="at-wp-tooltip" tooltip="When checked, on the edit page of posts you will be able to turn off sharing buttons for that specific post.">?</span>
2402
+ </li>
2403
  <li>
2404
  <input
2405
  id="addthis_508"
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.2.2
6
- Stable tag: 5.0.6
7
 
8
  AddThis provides the best sharing tools to help you make your website smarter.
9
 
@@ -32,7 +32,7 @@ To upload the plugin through WordPress, instead of FTP:
32
 
33
  = Is AddThis free? =
34
 
35
- Many of our tools are free, but Pro users get the benefit of exclusive widgets, including mobile­friendly tools
36
  and retina icons, priority support and deeper analytics.
37
 
38
  = Do I need to create an account? =
@@ -64,6 +64,7 @@ In the screen options you can enable the AddThis meta box. Check the box and sav
64
  1. Sharing Tools tab on the plugin settings page (WordPress mode)
65
  2. Sharing Tools tab on the plugin settings page (WordPress mode)
66
  3. Advanced Options tab on the plugin settings page
 
67
  4. Sharing Tools tab on the plugin settings page (AddThis mode)
68
  5. Analytics on the AddThis Dashboard
69
  6. Tool Gallery on the AddThis Dashboard
@@ -75,6 +76,10 @@ PHP 5+ is preferred; PHP 4 is supported.
75
 
76
  == Changelog ==
77
 
 
 
 
 
78
  = 5.0.6 =
79
  * Limiting when we filter content from get_the_excerpt because of issues with the manshet and backstreet themes
80
  * Reducing PHP warnings and error messages
@@ -338,6 +343,10 @@ Fixed nondeterministic bug with the_title(), causing the title to occasionally a
338
 
339
  == Upgrade Notice ==
340
 
 
 
 
 
341
  = 5.0.6 =
342
  * Limiting when we filter content from get_the_excerpt because of issues with the manshet and backstreet themes
343
  * Reducing PHP warnings and error messages
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.2.2
6
+ Stable tag: 5.0.7
7
 
8
  AddThis provides the best sharing tools to help you make your website smarter.
9
 
32
 
33
  = Is AddThis free? =
34
 
35
+ Many of our tools are free, but Pro users get the benefit of exclusive widgets, including mobile­ friendly tools
36
  and retina icons, priority support and deeper analytics.
37
 
38
  = Do I need to create an account? =
64
  1. Sharing Tools tab on the plugin settings page (WordPress mode)
65
  2. Sharing Tools tab on the plugin settings page (WordPress mode)
66
  3. Advanced Options tab on the plugin settings page
67
+ 4. Drag and dropable sharing buttons widget (WordPress mode)
68
  4. Sharing Tools tab on the plugin settings page (AddThis mode)
69
  5. Analytics on the AddThis Dashboard
70
  6. Tool Gallery on the AddThis Dashboard
76
 
77
  == Changelog ==
78
 
79
+ = 5.0.7 =
80
+ * Changed the page/post edit screens AddThing sharing buttons checkbox to on/off radiobuttons
81
+ * Added a checkbox to the plugin's settings page's Advanced Options tab to enable/disable the per page/post sharing button configurations mentioned above
82
+
83
  = 5.0.6 =
84
  * Limiting when we filter content from get_the_excerpt because of issues with the manshet and backstreet themes
85
  * Reducing PHP warnings and error messages
343
 
344
  == Upgrade Notice ==
345
 
346
+ = 5.0.7 =
347
+ * Changed the page/post edit screens AddThing sharing buttons checkbox to on/off radiobuttons
348
+ * Added a checkbox to the plugin's settings page's Advanced Options tab to enable/disable the per page/post sharing button configurations mentioned above
349
+
350
  = 5.0.6 =
351
  * Limiting when we filter content from get_the_excerpt because of issues with the manshet and backstreet themes
352
  * Reducing PHP warnings and error messages