Version Description
Download this release
Release Info
Developer | jorbin |
Plugin | WordPress Share Buttons Plugin – AddThis |
Version | 2.4.2 |
Comparing to | |
See all releases |
Code changes from version 2.4.1 to 2.4.2
- addthis_social_widget.php +6 -3
- includes/addthis_addjs.php +80 -3
- readme.txt +5 -1
addthis_social_widget.php
CHANGED
@@ -23,7 +23,7 @@
|
|
23 |
* Plugin Name: AddThis Social Bookmarking Widget
|
24 |
* Plugin URI: http://www.addthis.com
|
25 |
* Description: Help your visitor promote your site! The AddThis Social Bookmarking Widget allows any visitor to bookmark your site easily with many popular services. Sign up for an AddThis.com account to see how your visitors are sharing your content--which services they're using for sharing, which content is shared the most, and more. It's all free--even the pretty charts and graphs.
|
26 |
-
* Version: 2.4.
|
27 |
*
|
28 |
* Author: The AddThis Team
|
29 |
* Author URI: http://www.addthis.com/blog
|
@@ -46,7 +46,7 @@ function addthis_early(){
|
|
46 |
|
47 |
|
48 |
define( 'addthis_style_default' , 'fb_tw_p1_sc');
|
49 |
-
define( 'ADDTHIS_PLUGIN_VERSION', '2.4.
|
50 |
|
51 |
$addthis_settings = array();
|
52 |
$addthis_settings['isdropdown'] = 'true';
|
@@ -1395,7 +1395,7 @@ function addthis_output_script($return = false, $justConfig = false )
|
|
1395 |
|
1396 |
$script = "\n<!-- AddThis Button Begin -->\n"
|
1397 |
.'<script type="text/javascript">'
|
1398 |
-
."var addthis_product = 'wpp-
|
1399 |
|
1400 |
|
1401 |
$pub = (isset($options['profile'])) ? $options['profile'] : false ;
|
@@ -1725,6 +1725,7 @@ function addthis_plugin_options_php4() {
|
|
1725 |
global $addthis_menu_types;
|
1726 |
global $addthis_new_styles;
|
1727 |
global $addthis_default_options;
|
|
|
1728 |
|
1729 |
|
1730 |
|
@@ -1760,7 +1761,9 @@ function addthis_plugin_options_php4() {
|
|
1760 |
extract($options);
|
1761 |
?>
|
1762 |
|
|
|
1763 |
<div class="page-header" id="tabs">
|
|
|
1764 |
<img alt='addthis' src="//cache.addthis.com/icons/v1/thumbs/32x32/more.png" class="header-img"/>
|
1765 |
<ul class="nav-tab-wrapper">
|
1766 |
<li><h2 class="nav-tab-wrapper"><a href="#tabs-1">Basic</a></h2></li>
|
23 |
* Plugin Name: AddThis Social Bookmarking Widget
|
24 |
* Plugin URI: http://www.addthis.com
|
25 |
* Description: Help your visitor promote your site! The AddThis Social Bookmarking Widget allows any visitor to bookmark your site easily with many popular services. Sign up for an AddThis.com account to see how your visitors are sharing your content--which services they're using for sharing, which content is shared the most, and more. It's all free--even the pretty charts and graphs.
|
26 |
+
* Version: 2.4.2
|
27 |
*
|
28 |
* Author: The AddThis Team
|
29 |
* Author URI: http://www.addthis.com/blog
|
46 |
|
47 |
|
48 |
define( 'addthis_style_default' , 'fb_tw_p1_sc');
|
49 |
+
define( 'ADDTHIS_PLUGIN_VERSION', '2.4.2');
|
50 |
|
51 |
$addthis_settings = array();
|
52 |
$addthis_settings['isdropdown'] = 'true';
|
1395 |
|
1396 |
$script = "\n<!-- AddThis Button Begin -->\n"
|
1397 |
.'<script type="text/javascript">'
|
1398 |
+
."var addthis_product = 'wpp-263';\n";
|
1399 |
|
1400 |
|
1401 |
$pub = (isset($options['profile'])) ? $options['profile'] : false ;
|
1725 |
global $addthis_menu_types;
|
1726 |
global $addthis_new_styles;
|
1727 |
global $addthis_default_options;
|
1728 |
+
global $addthis_addjs;
|
1729 |
|
1730 |
|
1731 |
|
1761 |
extract($options);
|
1762 |
?>
|
1763 |
|
1764 |
+
<p><?php echo $addthis_addjs->getAtPluginPromoText(); ?></p>
|
1765 |
<div class="page-header" id="tabs">
|
1766 |
+
|
1767 |
<img alt='addthis' src="//cache.addthis.com/icons/v1/thumbs/32x32/more.png" class="header-img"/>
|
1768 |
<ul class="nav-tab-wrapper">
|
1769 |
<li><h2 class="nav-tab-wrapper"><a href="#tabs-1">Basic</a></h2></li>
|
includes/addthis_addjs.php
CHANGED
@@ -10,10 +10,20 @@ Class AddThis_addjs{
|
|
10 |
|
11 |
private $_cuid;
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
var $pubid;
|
14 |
|
15 |
var $jsToAdd;
|
16 |
|
|
|
|
|
17 |
var $atversion;
|
18 |
|
19 |
var $productCode;
|
@@ -25,10 +35,10 @@ Class AddThis_addjs{
|
|
25 |
*/
|
26 |
public function __construct ($options){
|
27 |
if ( did_action('addthis_addjs_created') !== 0){
|
28 |
-
_doing_it_wrong( 'addthis_addjs', 'Only one instance of this class should be initialized. Look for the $addthis_addjs global first' );
|
29 |
}
|
30 |
|
31 |
-
$this->productCode = '';
|
32 |
|
33 |
// Version of AddThis code to use
|
34 |
$this->atversion = '250';
|
@@ -78,6 +88,7 @@ Class AddThis_addjs{
|
|
78 |
{
|
79 |
$this->wrapJs();
|
80 |
$this->addWidgetToJs();
|
|
|
81 |
echo $this->jsToAdd;
|
82 |
$this->_js_added = true;
|
83 |
}
|
@@ -88,6 +99,7 @@ Class AddThis_addjs{
|
|
88 |
{
|
89 |
$this->wrapJs();
|
90 |
$this->addWidgetToJs();
|
|
|
91 |
$content = $content . $this->jsToAdd;
|
92 |
$this->_js_added = true;
|
93 |
}
|
@@ -95,6 +107,7 @@ Class AddThis_addjs{
|
|
95 |
}
|
96 |
|
97 |
function wrapJs(){
|
|
|
98 |
$this->jsToAdd = '<script type="text/javascript">' . $this->jsToAdd . '</script>';
|
99 |
}
|
100 |
|
@@ -134,11 +147,19 @@ Class AddThis_addjs{
|
|
134 |
$this->jsToAdd .= $newData;
|
135 |
}
|
136 |
|
|
|
|
|
|
|
137 |
|
138 |
function addWidgetToJs(){
|
139 |
$this->jsToAdd .= '<script type="text/javascript" src="//s7.addthis.com/js/'.$this->atversion.'/addthis_widget.js#pubid='. urlencode( $this->pubid ).'"></script>';
|
140 |
}
|
141 |
|
|
|
|
|
|
|
|
|
|
|
142 |
|
143 |
/* User name and other shared resources */
|
144 |
function getUsername(){
|
@@ -156,7 +177,7 @@ Class AddThis_addjs{
|
|
156 |
|
157 |
function setProfileId($profile){
|
158 |
$this->_options['profile'] = sanitize_text_field($profile);
|
159 |
-
update_option( 'addthis_settings', $
|
160 |
}
|
161 |
|
162 |
function getPassword(){
|
@@ -168,6 +189,62 @@ Class AddThis_addjs{
|
|
168 |
update_option( 'addthis_settings', $options);
|
169 |
}
|
170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
}
|
173 |
|
10 |
|
11 |
private $_cuid;
|
12 |
|
13 |
+
private $_atPlugins = array(
|
14 |
+
'AddThis Social Bookmarking Widget' => array('http://wordpress.org/extend/plugins/addthis/', 'Share') ,
|
15 |
+
'AddThis Follow Widget' => array('http://wordpress.org/extend/plugins/addthis-follow/', 'Follow'),
|
16 |
+
// 'AddThis Trending Content Widget' => array('http://wordpress.org/extend/plugins/addthis-trending', 'Trending' ),
|
17 |
+
'AddThis Welcome Bar' => array('http://wordpress.org/extend/plugins/addthis-welcome/', 'Welcome'),
|
18 |
+
);
|
19 |
+
private $_atInstalled = array();
|
20 |
+
|
21 |
var $pubid;
|
22 |
|
23 |
var $jsToAdd;
|
24 |
|
25 |
+
var $jsAfterAdd;
|
26 |
+
|
27 |
var $atversion;
|
28 |
|
29 |
var $productCode;
|
35 |
*/
|
36 |
public function __construct ($options){
|
37 |
if ( did_action('addthis_addjs_created') !== 0){
|
38 |
+
_doing_it_wrong( 'addthis_addjs', 'Only one instance of this class should be initialized. Look for the $addthis_addjs global first',1 );
|
39 |
}
|
40 |
|
41 |
+
$this->productCode = 'wpp-265';
|
42 |
|
43 |
// Version of AddThis code to use
|
44 |
$this->atversion = '250';
|
88 |
{
|
89 |
$this->wrapJs();
|
90 |
$this->addWidgetToJs();
|
91 |
+
$this->addAfterToJs();
|
92 |
echo $this->jsToAdd;
|
93 |
$this->_js_added = true;
|
94 |
}
|
99 |
{
|
100 |
$this->wrapJs();
|
101 |
$this->addWidgetToJs();
|
102 |
+
$this->addAfterToJs();
|
103 |
$content = $content . $this->jsToAdd;
|
104 |
$this->_js_added = true;
|
105 |
}
|
107 |
}
|
108 |
|
109 |
function wrapJs(){
|
110 |
+
$this->jsToAdd .= "var addthis_product = '".$this->productCode."';\n";
|
111 |
$this->jsToAdd = '<script type="text/javascript">' . $this->jsToAdd . '</script>';
|
112 |
}
|
113 |
|
147 |
$this->jsToAdd .= $newData;
|
148 |
}
|
149 |
|
150 |
+
function addAfterScript($newData){
|
151 |
+
$this->jsAfterAdd .= $newData;
|
152 |
+
}
|
153 |
|
154 |
function addWidgetToJs(){
|
155 |
$this->jsToAdd .= '<script type="text/javascript" src="//s7.addthis.com/js/'.$this->atversion.'/addthis_widget.js#pubid='. urlencode( $this->pubid ).'"></script>';
|
156 |
}
|
157 |
|
158 |
+
function addAfterToJs(){
|
159 |
+
if (! empty($this->jsAfterAdd));
|
160 |
+
$this->jsToAdd .= '<script type="text/javascript">' . $this->jsAfterAdd . '</script>';
|
161 |
+
}
|
162 |
+
|
163 |
|
164 |
/* User name and other shared resources */
|
165 |
function getUsername(){
|
177 |
|
178 |
function setProfileId($profile){
|
179 |
$this->_options['profile'] = sanitize_text_field($profile);
|
180 |
+
update_option( 'addthis_settings', $this->_options);
|
181 |
}
|
182 |
|
183 |
function getPassword(){
|
189 |
update_option( 'addthis_settings', $options);
|
190 |
}
|
191 |
|
192 |
+
function getAtPluginPromoText(){
|
193 |
+
if (! did_action('admin_init') && ! current_filter('admin_init'))
|
194 |
+
{
|
195 |
+
_doing_it_wrong('getAtPluginPromoText', 'This function should only be called on an admin page load and no earlier the admin_init', 1);
|
196 |
+
return null;
|
197 |
+
}
|
198 |
+
if (apply_filters('addthis_crosspromote', '__return_true'))
|
199 |
+
{
|
200 |
+
$plugins = get_plugins();
|
201 |
+
if (empty($this->_atInstalled))
|
202 |
+
{
|
203 |
+
foreach($plugins as $plugin)
|
204 |
+
{
|
205 |
+
if (substr($plugin['Name'], 0, 7) === 'AddThis')
|
206 |
+
array_push($this->_atInstalled, $plugin['Name']);
|
207 |
+
}
|
208 |
+
}
|
209 |
+
$keys = array_keys($this->_atPlugins);
|
210 |
+
$uninstalled = array_diff( $keys, $this->_atInstalled);
|
211 |
+
if (empty($uninstalled))
|
212 |
+
return false;
|
213 |
+
|
214 |
+
// Get rid of our keys, we just want the names which are the keys elsewhere
|
215 |
+
$uninstalled = array_values($uninstalled);
|
216 |
+
|
217 |
+
$string = __('Want to increase your site traffic? AddThis also has ');
|
218 |
+
$count = count($uninstalled);
|
219 |
+
if ($count == 1){
|
220 |
+
$string .= __('a plugin for ', 'addthis');
|
221 |
+
$string .= __( sprintf('<a href="%s" target="_blank">' .$this->_atPlugins[$uninstalled[0]][1] .'</a>', $this->_atPlugins[$uninstalled[0]][0]), 'addthis');
|
222 |
+
} else {
|
223 |
+
$string . __('plugins for ');
|
224 |
+
|
225 |
+
for ($i = 0; $i < $count; $i++) {
|
226 |
+
$string .= __( sprintf('<strong><a href="%s" target="_blank" >' .$this->_atPlugins[$uninstalled[$i]][1] .'</a></strong>', $this->_atPlugins[$uninstalled[$i]][0]), 'addthis');
|
227 |
+
if ($i < ($count - 2))
|
228 |
+
$string .= ', ';
|
229 |
+
else if ($i == ($count -2))
|
230 |
+
$string .= ' and ';
|
231 |
+
else if ($i == ($count -1))
|
232 |
+
$string .= ' plugins available.';
|
233 |
+
|
234 |
+
}
|
235 |
+
|
236 |
+
|
237 |
+
}
|
238 |
+
|
239 |
+
return '<p class="addthis_more_promo">' .$string . '</p>';
|
240 |
+
|
241 |
+
|
242 |
+
|
243 |
+
|
244 |
+
|
245 |
+
|
246 |
+
}
|
247 |
+
}
|
248 |
|
249 |
}
|
250 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: _mjk_, jorbin, addthis_paul, joesullivan
|
|
3 |
Tags: share, addthis, social, bookmark, sharing, bookmarking, widget,AddThis, addtoany, aim, bookmark, buzz, del.icio.us, Digg,e-mail, email, Facebook, google bookmarks, google buzz, myspace,network, NewsVine, Reddit, Share, share this, sharethis, social, socialize, stumbleupon, twitter, windows live, yahoo buzz, pintrest, widget
|
4 |
Requires at least: 2.9
|
5 |
Tested up to: 3.3.2
|
6 |
-
Stable tag: 2.4.
|
7 |
|
8 |
The AddThis Social Bookmarking Widget allows any visitor to bookmark and share your site easily with over 330 popular services.
|
9 |
|
@@ -12,6 +12,10 @@ Get more traffic back to your site by installing the AddThis WordPress plugin. W
|
|
12 |
|
13 |
Optionally, sign up for a free AddThis.com account to see how your visitors are sharing your content: which services they're using for sharing, which content is shared the most, and more.
|
14 |
|
|
|
|
|
|
|
|
|
15 |
<a href="http://www.addthis.com/blog">AddThis Blog</a> | <a href="http://www.addthis.com/privacy">Privacy Policy</a>
|
16 |
|
17 |
== Installation ==
|
3 |
Tags: share, addthis, social, bookmark, sharing, bookmarking, widget,AddThis, addtoany, aim, bookmark, buzz, del.icio.us, Digg,e-mail, email, Facebook, google bookmarks, google buzz, myspace,network, NewsVine, Reddit, Share, share this, sharethis, social, socialize, stumbleupon, twitter, windows live, yahoo buzz, pintrest, widget
|
4 |
Requires at least: 2.9
|
5 |
Tested up to: 3.3.2
|
6 |
+
Stable tag: 2.4.2
|
7 |
|
8 |
The AddThis Social Bookmarking Widget allows any visitor to bookmark and share your site easily with over 330 popular services.
|
9 |
|
12 |
|
13 |
Optionally, sign up for a free AddThis.com account to see how your visitors are sharing your content: which services they're using for sharing, which content is shared the most, and more.
|
14 |
|
15 |
+
We also have plugins available for <a href='http://wordpress.org/extend/plugins/addthis-follow/'>Increasing followers on social networks</a> and <a href='http://wordpress.org/extend/plugins/addthis-welcome/'>Welcoming users based on social behavior</a>.
|
16 |
+
|
17 |
+
Tell us what you think <a href='http://www.surveymonkey.com/s/53FDFRF'>Help make AddThis even better by taking this short customer survey.</a>
|
18 |
+
|
19 |
<a href="http://www.addthis.com/blog">AddThis Blog</a> | <a href="http://www.addthis.com/privacy">Privacy Policy</a>
|
20 |
|
21 |
== Installation ==
|