WordPress Share Buttons Plugin – AddThis - Version 5.0.3

Version Description

  • Reduced the size of the plugin by removing unused images
Download this release

Release Info

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

Code changes from version 5.0.2 to 5.0.3

AddThisCmsConnectorInterface.php CHANGED
@@ -22,9 +22,17 @@
22
  if (!interface_exists('AddThisCmsConnectorInterface')) {
23
  interface AddThisCmsConnectorInterface
24
  {
 
 
 
 
25
  public function getSharingButtonLocations();
26
  public function getConfigs();
27
  public function getContentTypes();
28
  public function saveConfigs($configs);
 
 
 
 
29
  }
30
  }
22
  if (!interface_exists('AddThisCmsConnectorInterface')) {
23
  interface AddThisCmsConnectorInterface
24
  {
25
+ static function getCmsVersion();
26
+ static function getCmsMinorVersion();
27
+ static function getPluginVersion();
28
+ static function getProductVersion();
29
  public function getSharingButtonLocations();
30
  public function getConfigs();
31
  public function getContentTypes();
32
  public function saveConfigs($configs);
33
+ public function getSettingsPageUrl();
34
+ public function getPluginCssFolderUrl();
35
+ public function getPluginImageFolderUrl();
36
+ public function getPluginJsFolderUrl();
37
  }
38
  }
AddThisWordPressConnector.php CHANGED
@@ -25,9 +25,10 @@ if (!class_exists('AddthisWordpressConnector')) {
25
  Class AddthisWordpressConnector implements AddThisCmsConnectorInterface {
26
 
27
  static $settingsVariableName = 'addthis_settings';
28
- static $pluginVersion = '5.0.2';
29
  static $settingsPageId = 'addthis_social_widget';
30
  static $anonymousProfileIdPrefix = 'wp';
 
31
  protected $configs = null;
32
 
33
  protected $defaultConfigs = array(
@@ -87,6 +88,11 @@ if (!class_exists('AddthisWordpressConnector')) {
87
  return self::$anonymousProfileIdPrefix;
88
  }
89
 
 
 
 
 
 
90
  /**
91
  * the folder name for the AddThis plugin - OMG why is this hard coded?!?
92
  * @return string
25
  Class AddthisWordpressConnector implements AddThisCmsConnectorInterface {
26
 
27
  static $settingsVariableName = 'addthis_settings';
28
+ static $pluginVersion = '5.0.3';
29
  static $settingsPageId = 'addthis_social_widget';
30
  static $anonymousProfileIdPrefix = 'wp';
31
+ static $productPrefix = 'wpp';
32
  protected $configs = null;
33
 
34
  protected $defaultConfigs = array(
88
  return self::$anonymousProfileIdPrefix;
89
  }
90
 
91
+ static function getProductVersion() {
92
+ $productVersion = self::$productPrefix . '-' . self::getPluginVersion();
93
+ return $productVersion;
94
+ }
95
+
96
  /**
97
  * the folder name for the AddThis plugin - OMG why is this hard coded?!?
98
  * @return string
addthis-for-wordpress.php CHANGED
@@ -455,7 +455,7 @@ function Addthis_Wordpress_early()
455
  global $cmsConnector;
456
 
457
  if (!isset($addthis_addjs)) {
458
- include 'includes/addthis_addjs_new.php';
459
  $addthis_addjs = new AddThis_addjs($addThisConfigs, $cmsConnector);
460
  }
461
  }
455
  global $cmsConnector;
456
 
457
  if (!isset($addthis_addjs)) {
458
+ include 'addthis_addjs_new.php';
459
  $addthis_addjs = new AddThis_addjs($addThisConfigs, $cmsConnector);
460
  }
461
  }
includes/addthis_addjs_new.php → addthis_addjs_new.php RENAMED
@@ -38,8 +38,6 @@ Class AddThis_addjs{
38
 
39
  var $atversion;
40
 
41
- var $productCode;
42
-
43
  const addjs_version = 1;
44
 
45
  /**
@@ -53,8 +51,6 @@ Class AddThis_addjs{
53
  _doing_it_wrong( 'addthis_addjs', 'Only one instance of this class should be initialized. Look for the $addthis_addjs global first',1 );
54
  }
55
 
56
- $this->productCode = ADDTHIS_PRODUCT_VERSION;
57
-
58
  // We haven't added our JS yet. Or at least better not have.
59
  $this->_js_added = false;
60
 
@@ -127,7 +123,6 @@ Class AddThis_addjs{
127
  }
128
 
129
  function wrapJs(){
130
- $this->jsToAdd .= "var addthis_for_wordpress = '".$this->productCode."';\n";
131
  $this->jsToAdd = '<script type="text/javascript">' . $this->jsToAdd . '</script>';
132
  }
133
 
@@ -202,7 +197,7 @@ Class AddThis_addjs{
202
 
203
  $this->jsToAdd .= '
204
  <script>
205
- var wp_product_version = "' . ADDTHIS_PRODUCT_VERSION . '";
206
  var wp_blog_version = "' . $this->cmsConnector->getCmsVersion() . '";
207
  ' . $addthis_share_js . '
208
  </script>';
38
 
39
  var $atversion;
40
 
 
 
41
  const addjs_version = 1;
42
 
43
  /**
51
  _doing_it_wrong( 'addthis_addjs', 'Only one instance of this class should be initialized. Look for the $addthis_addjs global first',1 );
52
  }
53
 
 
 
54
  // We haven't added our JS yet. Or at least better not have.
55
  $this->_js_added = false;
56
 
123
  }
124
 
125
  function wrapJs(){
 
126
  $this->jsToAdd = '<script type="text/javascript">' . $this->jsToAdd . '</script>';
127
  }
128
 
197
 
198
  $this->jsToAdd .= '
199
  <script>
200
+ var wp_product_version = "' . $this->cmsConnector->getProductVersion() . '";
201
  var wp_blog_version = "' . $this->cmsConnector->getCmsVersion() . '";
202
  ' . $addthis_share_js . '
203
  </script>';
addthis_settings_functions.php CHANGED
@@ -107,47 +107,6 @@ function addthis_kses($string, $customstyles)
107
  return $new_string;
108
  }
109
 
110
- /**
111
- * AddThis version notification message
112
- * @param int $atversion_update_status
113
- * @param int $atversion
114
- */
115
- function _addthis_version_notification($atversion_update_status, $atversion)
116
- {
117
- global $cmsConnector;
118
-
119
- //Fresh install Scenario. ie., atversion = 300 without reverting back.
120
- if($atversion_update_status == ADDTHIS_ATVERSION_AUTO_UPDATE && $atversion >= ADDTHIS_ATVERSION) {
121
- return;
122
- }
123
- ob_start();
124
- // In the automatic update by the system the $atversion_update_status is 0
125
- // On subsequent update using notification link the $atversion_update_status = -1
126
- // In both cases display the revert link
127
- if ($atversion_update_status == ADDTHIS_ATVERSION_AUTO_UPDATE || $atversion_update_status == ADDTHIS_ATVERSION_MANUAL_UPDATE) {
128
- ?>
129
- <div class="addthis-notification addthis-success-message">
130
- <div style="float:left">Your AddThis sharing plugin has been updated.</div>
131
- <div style="float:right">
132
- <a href="#" class="addthis-revert-atversion">Revert back to previous version</a>
133
- </div>
134
- </div>
135
- <?php
136
- } else {
137
- ?>
138
- <div class="addthis-notification addthis-warning-message">
139
- <div style="float:left">Update AddThis to activate new features that will make sharing even easier.</div>
140
- <div style="float:right">
141
- <a href="#" class="addthis-update-atversion"><img alt="update" src="<?php echo $cmsConnector->getPluginImageFolderUrl() . 'update.png';?>" /></a>
142
- </div>
143
- </div>
144
- <?php
145
- }
146
- $notification_content = ob_get_contents();
147
- ob_end_clean();
148
- return $notification_content;
149
- }
150
-
151
  /**
152
  * Swap the order of occurrence of two keys in an associative array
153
  * @param type $array
107
  return $new_string;
108
  }
109
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  /**
111
  * Swap the order of occurrence of two keys in an associative array
112
  * @param type $array
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
7
  * Author: The AddThis Team
8
  * Author URI: http://www.addthis.com/
9
  * License: GPL2
@@ -31,10 +31,7 @@ if (!defined('ADDTHIS_INIT')) define('ADDTHIS_INIT', 1);
31
  else return;
32
 
33
  define( 'addthis_style_default' , 'fb_tw_p1_sc');
34
- define( 'ADDTHIS_PRODUCT_VERSION' , 'wpp-5.0');
35
  define( 'ADDTHIS_ATVERSION', '300');
36
- define( 'ADDTHIS_ATVERSION_MANUAL_UPDATE', -1);
37
- define( 'ADDTHIS_ATVERSION_AUTO_UPDATE', 0);
38
  define( 'ADDTHIS_ATVERSION_REVERTED', 1);
39
  define( 'ENABLE_ADDITIONAL_PLACEMENT_OPTION', 0);
40
 
@@ -133,7 +130,7 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
133
  global $addThisConfigs;
134
  global $cmsConnector;
135
  if (!isset($addthis_addjs)){
136
- require('includes/addthis_addjs_new.php');
137
  $addthis_addjs = new AddThis_addjs($addThisConfigs, $cmsConnector);
138
  }
139
  }
@@ -1315,11 +1312,12 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1315
  function addthis_output_script($return = false, $justConfig = false )
1316
  {
1317
  global $addThisConfigs;
 
1318
  $options = $addThisConfigs->getConfigs();
1319
 
1320
  $script = "\n<!-- AddThis Button Begin -->\n"
1321
  .'<script type="text/javascript">'
1322
- ."var addthis_product = '".ADDTHIS_PRODUCT_VERSION."';\n";
1323
 
1324
  $addthis_config = array();
1325
  $addthis_share = array();
@@ -1506,6 +1504,7 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1506
  addthis_set_addthis_settings();
1507
  global $addthis_settings;
1508
  global $addThisConfigs;
 
1509
 
1510
  // add nothing to RSS feed or search results; control adding to static/archive/category pages
1511
  if (!$onSidebar)
@@ -1530,7 +1529,7 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1530
  $content .= "\n<!-- AddThis Button BEGIN -->\n"
1531
  .'<script type="text/javascript">'
1532
  ."\n//<!--\n"
1533
- ."var addthis_product = '".ADDTHIS_PRODUCT_VERSION."';\n";
1534
 
1535
 
1536
  if (strlen($addthis_settings['customization']))
@@ -1680,11 +1679,6 @@ EOF;
1680
 
1681
  $options = $addThisConfigs->getConfigs();
1682
 
1683
- $version_notification_content = _addthis_version_notification(
1684
- $options['atversion_update_status'],
1685
- $options['atversion']
1686
- );
1687
-
1688
  ?>
1689
  <div class="Main-content" id="tabs">
1690
  <ul class="Tabbed-nav">
@@ -2620,7 +2614,7 @@ function addthis_profile_id_csr_confirmation($fieldName = 'addthis_settings[addt
2620
  <div class="addthis_pub_id">
2621
  <ul class="addthis-csr-confirm-list">
2622
  <li class="addthis-csr-item wp_div">
2623
- <img src="'.plugins_url('images/wordpress.png', __FILE__).'">
2624
  <span>Your WordPress Site:</span>
2625
  <input
2626
  type="text"
@@ -2630,11 +2624,11 @@ function addthis_profile_id_csr_confirmation($fieldName = 'addthis_settings[addt
2630
  onfocus="this.blur()"/>
2631
  </li>
2632
  <li class="addthis-csr-item arrow_div">
2633
- <img src="'.plugins_url('images/arrow_right.png', __FILE__).'">
2634
- <img src="'.plugins_url('images/arrow_left.png', __FILE__).'">
2635
  </li>
2636
  <li class="addthis-csr-item addthis_div">
2637
- <img src="'.plugins_url('images/addthis.png', __FILE__).'">
2638
  <span>AddThis Profile ID:</span>
2639
  <input
2640
  type="text"
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.3
7
  * Author: The AddThis Team
8
  * Author URI: http://www.addthis.com/
9
  * License: GPL2
31
  else return;
32
 
33
  define( 'addthis_style_default' , 'fb_tw_p1_sc');
 
34
  define( 'ADDTHIS_ATVERSION', '300');
 
 
35
  define( 'ADDTHIS_ATVERSION_REVERTED', 1);
36
  define( 'ENABLE_ADDITIONAL_PLACEMENT_OPTION', 0);
37
 
130
  global $addThisConfigs;
131
  global $cmsConnector;
132
  if (!isset($addthis_addjs)){
133
+ require('addthis_addjs_new.php');
134
  $addthis_addjs = new AddThis_addjs($addThisConfigs, $cmsConnector);
135
  }
136
  }
1312
  function addthis_output_script($return = false, $justConfig = false )
1313
  {
1314
  global $addThisConfigs;
1315
+ global $cmsConnector;
1316
  $options = $addThisConfigs->getConfigs();
1317
 
1318
  $script = "\n<!-- AddThis Button Begin -->\n"
1319
  .'<script type="text/javascript">'
1320
+ ."var addthis_product = '". $cmsConnector->getProductVersion() ."';\n";
1321
 
1322
  $addthis_config = array();
1323
  $addthis_share = array();
1504
  addthis_set_addthis_settings();
1505
  global $addthis_settings;
1506
  global $addThisConfigs;
1507
+ global $cmsConnector;
1508
 
1509
  // add nothing to RSS feed or search results; control adding to static/archive/category pages
1510
  if (!$onSidebar)
1529
  $content .= "\n<!-- AddThis Button BEGIN -->\n"
1530
  .'<script type="text/javascript">'
1531
  ."\n//<!--\n"
1532
+ ."var addthis_product = '". $cmsConnector->getProductVersion() ."';\n";
1533
 
1534
 
1535
  if (strlen($addthis_settings['customization']))
1679
 
1680
  $options = $addThisConfigs->getConfigs();
1681
 
 
 
 
 
 
1682
  ?>
1683
  <div class="Main-content" id="tabs">
1684
  <ul class="Tabbed-nav">
2614
  <div class="addthis_pub_id">
2615
  <ul class="addthis-csr-confirm-list">
2616
  <li class="addthis-csr-item wp_div">
2617
+ <img src="'.$cmsConnector->getPluginImageFolderUrl().'wordpress.png">
2618
  <span>Your WordPress Site:</span>
2619
  <input
2620
  type="text"
2624
  onfocus="this.blur()"/>
2625
  </li>
2626
  <li class="addthis-csr-item arrow_div">
2627
+ <img src="'.$cmsConnector->getPluginImageFolderUrl().'arrow_right.png">
2628
+ <img src="'.$cmsConnector->getPluginImageFolderUrl().'arrow_left.png">
2629
  </li>
2630
  <li class="addthis-csr-item addthis_div">
2631
+ <img src="'.$cmsConnector->getPluginImageFolderUrl().'addthis.png">
2632
  <span>AddThis Profile ID:</span>
2633
  <input
2634
  type="text"
images/ajax-loader.gif DELETED
Binary file
{images → img}/addthis.png RENAMED
File without changes
{images → img}/arrow_left.png RENAMED
File without changes
{images → img}/arrow_right.png RENAMED
File without changes
img/button.jpg DELETED
Binary file
img/compact.png DELETED
Binary file
img/facebook_like.png DELETED
Binary file
img/fb-tw-p1-sc.jpg DELETED
Binary file
img/fb-tw-sc.jpg DELETED
Binary file
img/google_plusone.png DELETED
Binary file
img/hyves_respect.png DELETED
Binary file
img/linkedin_counter.png DELETED
Binary file
img/loader.gif DELETED
Binary file
img/pinterest_pinit.png DELETED
Binary file
img/plusone-share.gif DELETED
Binary file
img/share.jpg DELETED
Binary file
img/share_counter.png DELETED
Binary file
img/small-toolbox.jpg DELETED
Binary file
img/toolbox-large.jpg DELETED
Binary file
img/tweet.png DELETED
Binary file
img/update.png DELETED
Binary file
img/widget056.gif DELETED
Binary file
{images → img}/wordpress.png RENAMED
File without changes
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Smart Website Tools by AddThis ===
2
- Contributors: abramsm, srijith.v, vipinss, dnrahamim, jgrodel, bradaddthiscom, mkitzman, kirk-at-addthis, addthis_paul
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
 
8
  AddThis provides the best sharing, social, recommended content, and conversion tools to help you make
9
  your website smarter.
@@ -72,13 +72,14 @@ In the screen options you can enable the AddThis meta box. Check the box and sav
72
 
73
  == Screenshots ==
74
 
75
- 1. Mode tab in WordPress admin area
76
- 2. Profile tab with Analytics link in WordPress admin area
77
- 3. Analytics on the AddThis Dashboard
78
- 4. Tool Gallery on the AddThis Dashboard
79
- 5. Customization options on the AddThis Dashboard
80
- 6. Sharing Tools tab in the WordPress admin area
81
- 7. Sharing Tools tab in the WordPress admin area
 
82
 
83
  == PHP Version ==
84
 
@@ -86,6 +87,9 @@ PHP 5+ is preferred; PHP 4 is supported.
86
 
87
  == Changelog ==
88
 
 
 
 
89
  = 5.0.2 =
90
  * Fixes for WordPress instances running on PHP verions below 5.5
91
 
@@ -330,7 +334,7 @@ Fixed nondeterministic bug with the_title(), causing the title to occasionally a
330
 
331
  == Upgrade Notice ==
332
 
333
- = 5.0.2 =
334
  * Two functional modes allowing users to choose whether to control sharing buttons from within the WordPress admin area (with limited features), or through the AddThis Dashboard at addthis.com.
335
  * Sharing sidebar configuration available within WordPress (in addition to the previously available sharing buttons above and below content).
336
  * Seperate preferences for what sharing buttons appear on what templates.
1
  === Smart Website Tools by AddThis ===
2
+ Contributors: abramsm, srijith.v, vipinss, dnrahamim, jgrodel, bradaddthiscom, mkitzman, kirk-at-addthis, addthis_paul, addthis_matt
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.3
7
 
8
  AddThis provides the best sharing, social, recommended content, and conversion tools to help you make
9
  your website smarter.
72
 
73
  == Screenshots ==
74
 
75
+ 1. Sharing Tools tab on the plugin settings page (WordPress mode)
76
+ 2. Sharing Tools tab on the plugin settings page (WordPress mode)
77
+ 3. Advanced Options tab on the plugin settings page (WordPress mode)
78
+ 4. Sharing Tools tab on the plugin settings page (AddThis mode)
79
+ 5. Advanced Options tab on the plugin settings page (AddThis mode)
80
+ 6. Analytics on the AddThis Dashboard
81
+ 7. Tool Gallery on the AddThis Dashboard
82
+ 8. Customization options on the AddThis Dashboard
83
 
84
  == PHP Version ==
85
 
87
 
88
  == Changelog ==
89
 
90
+ = 5.0.3 =
91
+ * Reduced the size of the plugin by removing unused images
92
+
93
  = 5.0.2 =
94
  * Fixes for WordPress instances running on PHP verions below 5.5
95
 
334
 
335
  == Upgrade Notice ==
336
 
337
+ = 5.0.3 =
338
  * Two functional modes allowing users to choose whether to control sharing buttons from within the WordPress admin area (with limited features), or through the AddThis Dashboard at addthis.com.
339
  * Sharing sidebar configuration available within WordPress (in addition to the previously available sharing buttons above and below content).
340
  * Seperate preferences for what sharing buttons appear on what templates.