Version Description
- Cache server side share counts for longer duration (5 minutes)
- Bugfix: Fixed miscellaneous v6->v7 conversion bugs
Download this release
Release Info
Developer | shareaholic |
Plugin | WordPress Social Tools, Related Posts, Monetization – Shareaholic |
Version | 7.5.0.4 |
Comparing to | |
See all releases |
Code changes from version 7.5.0.3 to 7.5.0.4
- admin.php +16 -9
- assets/css/main.css +9 -8
- public.php +5 -1
- readme.txt +31 -6
- shareaholic.php +192 -171
- six_to_seven.php +120 -19
- templates/advanced_settings.php +6 -0
- templates/terms_of_service_modal.php +3 -2
- utilities.php +6 -6
admin.php
CHANGED
@@ -192,23 +192,26 @@ class ShareaholicAdmin {
|
|
192 |
* Puts a new menu item under Settings.
|
193 |
*/
|
194 |
public static function admin_menu() {
|
195 |
-
add_menu_page(
|
196 |
-
'Shareaholic',
|
|
|
197 |
'manage_options',
|
198 |
'shareaholic-settings',
|
199 |
array('ShareaholicAdmin', 'admin'),
|
200 |
SHAREAHOLIC_ASSET_DIR . 'img/shareaholic_16x16_2.png'
|
201 |
);
|
202 |
-
add_submenu_page(
|
203 |
-
'
|
204 |
-
'App Manager',
|
|
|
205 |
'manage_options',
|
206 |
'shareaholic-settings',
|
207 |
array('ShareaholicAdmin', 'admin')
|
208 |
);
|
209 |
-
add_submenu_page(
|
210 |
-
'
|
211 |
-
'Advanced Settings',
|
|
|
212 |
'manage_options',
|
213 |
'shareaholic-advanced',
|
214 |
array('ShareaholicAdmin', 'advanced_admin')
|
@@ -293,7 +296,7 @@ class ShareaholicAdmin {
|
|
293 |
if(isset($_POST['already_submitted']) && $_POST['already_submitted'] == 'Y' &&
|
294 |
check_admin_referer($action, 'nonce_field')) {
|
295 |
echo "<div class='updated settings_updated'><p><strong>". sprintf(__('Settings successfully saved', 'shareaholic')) . "</strong></p></div>";
|
296 |
-
foreach (array('disable_tracking', 'disable_og_tags', 'disable_admin_bar_menu', 'disable_internal_share_counts_api') as $setting) {
|
297 |
if (isset($settings[$setting]) &&
|
298 |
!isset($_POST['shareaholic'][$setting]) &&
|
299 |
$settings[$setting] == 'on') {
|
@@ -323,6 +326,10 @@ class ShareaholicAdmin {
|
|
323 |
ShareaholicUtilities::update_options(array('disable_admin_bar_menu' => $_POST['shareaholic']['disable_admin_bar_menu']));
|
324 |
}
|
325 |
|
|
|
|
|
|
|
|
|
326 |
if (isset($_POST['shareaholic']['disable_internal_share_counts_api'])) {
|
327 |
ShareaholicUtilities::update_options(array('disable_internal_share_counts_api' => $_POST['shareaholic']['disable_internal_share_counts_api']));
|
328 |
}
|
192 |
* Puts a new menu item under Settings.
|
193 |
*/
|
194 |
public static function admin_menu() {
|
195 |
+
add_menu_page(
|
196 |
+
__('Shareaholic Settings', 'shareaholic'),
|
197 |
+
__('Shareaholic', 'shareaholic'),
|
198 |
'manage_options',
|
199 |
'shareaholic-settings',
|
200 |
array('ShareaholicAdmin', 'admin'),
|
201 |
SHAREAHOLIC_ASSET_DIR . 'img/shareaholic_16x16_2.png'
|
202 |
);
|
203 |
+
add_submenu_page(
|
204 |
+
'shareaholic-settings',
|
205 |
+
__('App Manager', 'shareaholic'),
|
206 |
+
__('App Manager', 'shareaholic'),
|
207 |
'manage_options',
|
208 |
'shareaholic-settings',
|
209 |
array('ShareaholicAdmin', 'admin')
|
210 |
);
|
211 |
+
add_submenu_page(
|
212 |
+
'shareaholic-settings',
|
213 |
+
__('Advanced Settings', 'shareaholic'),
|
214 |
+
__('Advanced Settings', 'shareaholic'),
|
215 |
'manage_options',
|
216 |
'shareaholic-advanced',
|
217 |
array('ShareaholicAdmin', 'advanced_admin')
|
296 |
if(isset($_POST['already_submitted']) && $_POST['already_submitted'] == 'Y' &&
|
297 |
check_admin_referer($action, 'nonce_field')) {
|
298 |
echo "<div class='updated settings_updated'><p><strong>". sprintf(__('Settings successfully saved', 'shareaholic')) . "</strong></p></div>";
|
299 |
+
foreach (array('disable_tracking', 'disable_og_tags', 'disable_admin_bar_menu', 'disable_debug_info', 'disable_internal_share_counts_api') as $setting) {
|
300 |
if (isset($settings[$setting]) &&
|
301 |
!isset($_POST['shareaholic'][$setting]) &&
|
302 |
$settings[$setting] == 'on') {
|
326 |
ShareaholicUtilities::update_options(array('disable_admin_bar_menu' => $_POST['shareaholic']['disable_admin_bar_menu']));
|
327 |
}
|
328 |
|
329 |
+
if (isset($_POST['shareaholic']['disable_debug_info'])) {
|
330 |
+
ShareaholicUtilities::update_options(array('disable_debug_info' => $_POST['shareaholic']['disable_debug_info']));
|
331 |
+
}
|
332 |
+
|
333 |
if (isset($_POST['shareaholic']['disable_internal_share_counts_api'])) {
|
334 |
ShareaholicUtilities::update_options(array('disable_internal_share_counts_api' => $_POST['shareaholic']['disable_internal_share_counts_api']));
|
335 |
}
|
assets/css/main.css
CHANGED
@@ -137,8 +137,8 @@ h3 {
|
|
137 |
padding: 0;
|
138 |
}
|
139 |
|
140 |
-
|
141 |
-
margin:
|
142 |
}
|
143 |
|
144 |
/* OOCSS Styles */
|
@@ -165,7 +165,7 @@ h3 {
|
|
165 |
* <type><location><size>
|
166 |
*/
|
167 |
/* ====== Default spacing ====== */
|
168 |
-
h1, h2, h3, h4, h5, h6,
|
169 |
h1, h2, h3, h4, h5, h6,img{padding-bottom:0px;}
|
170 |
pre{margin: 10px;}
|
171 |
table h1,table h2,table h3, table h4, table h5, table h6, table p, table ul, table ol, table dl{padding:0;}
|
@@ -232,7 +232,7 @@ s,m,l,n = small(5px),medium(10px),large(20px),none(0px)
|
|
232 |
line-height: 16pt;
|
233 |
box-shadow: 0px 0px 52px rgba(0,0,0,0.32);
|
234 |
padding: 0;
|
235 |
-
height:
|
236 |
}
|
237 |
|
238 |
.api-key-modal{
|
@@ -282,6 +282,7 @@ h4 {
|
|
282 |
}
|
283 |
|
284 |
.blocking-modal .btn_main {
|
|
|
285 |
position: relative;
|
286 |
cursor: pointer;
|
287 |
display: inline-block;
|
@@ -289,8 +290,8 @@ h4 {
|
|
289 |
color: white;
|
290 |
text-transform: uppercase;
|
291 |
text-decoration: none;
|
292 |
-
padding:
|
293 |
-
font-size:
|
294 |
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
|
295 |
border-radius: 5px;
|
296 |
-webkit-box-shadow: inset 0 -3px #14947b;
|
@@ -336,7 +337,7 @@ input[type='text'] {
|
|
336 |
font-size: 14px;
|
337 |
float: right;
|
338 |
margin: 25px 0 0 20px;
|
339 |
-
|
340 |
}
|
341 |
|
342 |
.signuppromo_note{
|
@@ -413,7 +414,7 @@ input[type='text'] {
|
|
413 |
font-size: 14px;
|
414 |
float: right;
|
415 |
margin: 25px 0 0 20px;
|
416 |
-
|
417 |
}
|
418 |
|
419 |
.help_links ul{
|
137 |
padding: 0;
|
138 |
}
|
139 |
|
140 |
+
ul {
|
141 |
+
margin: 0px;
|
142 |
}
|
143 |
|
144 |
/* OOCSS Styles */
|
165 |
* <type><location><size>
|
166 |
*/
|
167 |
/* ====== Default spacing ====== */
|
168 |
+
h1, h2, h3, h4, h5, h6, ol,dl, p,blockquote, .media {margin:10px;}
|
169 |
h1, h2, h3, h4, h5, h6,img{padding-bottom:0px;}
|
170 |
pre{margin: 10px;}
|
171 |
table h1,table h2,table h3, table h4, table h5, table h6, table p, table ul, table ol, table dl{padding:0;}
|
232 |
line-height: 16pt;
|
233 |
box-shadow: 0px 0px 52px rgba(0,0,0,0.32);
|
234 |
padding: 0;
|
235 |
+
height: 470px;
|
236 |
}
|
237 |
|
238 |
.api-key-modal{
|
282 |
}
|
283 |
|
284 |
.blocking-modal .btn_main {
|
285 |
+
margin-top: -20px;
|
286 |
position: relative;
|
287 |
cursor: pointer;
|
288 |
display: inline-block;
|
290 |
color: white;
|
291 |
text-transform: uppercase;
|
292 |
text-decoration: none;
|
293 |
+
padding: 25px 80px;
|
294 |
+
font-size: 20px;
|
295 |
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
|
296 |
border-radius: 5px;
|
297 |
-webkit-box-shadow: inset 0 -3px #14947b;
|
337 |
font-size: 14px;
|
338 |
float: right;
|
339 |
margin: 25px 0 0 20px;
|
340 |
+
width: 250px;
|
341 |
}
|
342 |
|
343 |
.signuppromo_note{
|
414 |
font-size: 14px;
|
415 |
float: right;
|
416 |
margin: 25px 0 0 20px;
|
417 |
+
width: 250px;
|
418 |
}
|
419 |
|
420 |
.help_links ul{
|
public.php
CHANGED
@@ -418,7 +418,11 @@ class ShareaholicPublic {
|
|
418 |
*/
|
419 |
public static function debug_info() {
|
420 |
global $wpdb;
|
421 |
-
|
|
|
|
|
|
|
|
|
422 |
if (ShareaholicUtilities::get_option('disable_tracking') == NULL || ShareaholicUtilities::get_option('disable_tracking') == "off"){
|
423 |
$analytics_status = "on";
|
424 |
} else {
|
418 |
*/
|
419 |
public static function debug_info() {
|
420 |
global $wpdb;
|
421 |
+
|
422 |
+
if (ShareaholicUtilities::get_option('disable_debug_info') == "on"){
|
423 |
+
exit;
|
424 |
+
}
|
425 |
+
|
426 |
if (ShareaholicUtilities::get_option('disable_tracking') == NULL || ShareaholicUtilities::get_option('disable_tracking') == "off"){
|
427 |
$analytics_status = "on";
|
428 |
} else {
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: shareaholic
|
|
3 |
Tags: sexybookmarks, shareaholic, shareholic, facebook, twitter, linkedin, URL Shortener, bitly, tinyurl, Goo.gl, Google+1, Google Analytics, Google Plus, Google, Instapaper, Wish List, Digg, Gmail, Google Bookmarks, Translate, Tumblr, AIM, Yahoo Messenger, Delicious, StumbleUpon, mister wong, evernote, add this, addtoany, share this, sharethis, share and follow, share and enjoy, sharing is sexy, sharing is caring, yahoo, reddit, hackernews, tweet button, twitter button, fark, buffer, myspace, orkut, netlog, hubspot, weheartit, printfriendly, yammer, wanelo, pinterest, google translate, bookmarks, social, email button, social share, socialize, sociable, sharebar, bookmark button, share button, social bookmarking, bookmarks menu, bookmarking, share, seo, analytics, stats, sharing, facebook like, facebook recommend, WPMU, mutisite, sumome, shortcode, yaarp, yarpp, nrelate, outbrain, linkwithin, related content, related posts, related, popular posts, popular, thumbnails, recommendations
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.9.1
|
6 |
-
Stable tag: 7.5.0.
|
7 |
|
8 |
Adds an attractive social bookmarking menu and related content widget to your posts, pages, index, or any combination of the three.
|
9 |
|
@@ -43,7 +43,7 @@ We use industry best practices to make our code as fast and unobtrusive as possi
|
|
43 |
|
44 |
Shareaholic is used and trusted by hundreds of thousands of websites like yours and touches almost 300 million people each month. Designed and built with all the love in the world in Boston, Massachusetts.
|
45 |
|
46 |
-
Note: The analytics portion of Shareaholic may use trusted 3rd party services like Google Analytics and AppNexus to enhance its data.
|
47 |
|
48 |
|
49 |
[Support](http://support.shareaholic.com/) | [Privacy](https://shareaholic.com/privacy/) | [Terms](https://shareaholic.com/terms/) | [API](https://shareaholic.com/api/) | [Social Analytics](https://shareaholic.com/publishers/analytics/)
|
@@ -159,13 +159,19 @@ Please see here: [Usage & Installation Instructions](http://support.shareaholic.
|
|
159 |
|
160 |
== Changelog ==
|
161 |
|
|
|
|
|
|
|
|
|
162 |
= 7.5.0.3 =
|
163 |
* Related Content
|
164 |
-
|
165 |
-
* Post-Share Follow Buttons
|
166 |
-
|
167 |
* Share Buttons
|
168 |
-
|
|
|
|
|
169 |
|
170 |
= 7.5.0.2 =
|
171 |
* Miscellaneous performance and on-boarding enhancements for the Related Content app
|
@@ -382,6 +388,21 @@ Please see here: [Usage & Installation Instructions](http://support.shareaholic.
|
|
382 |
* More robust curl function, more robust plugin
|
383 |
* Show Related Posts data status
|
384 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
385 |
= 6.1.3.8 =
|
386 |
* Bugfix: fixed "Cannot use object of type WP_Error"
|
387 |
|
@@ -1101,6 +1122,10 @@ Please see here: [Usage & Installation Instructions](http://support.shareaholic.
|
|
1101 |
|
1102 |
== Upgrade Notice ==
|
1103 |
|
|
|
|
|
|
|
|
|
1104 |
= 7.5.0.3 =
|
1105 |
|
1106 |
New post-share follow button services (including Instagram, YouTube and RSS) and additional improvements to the Related Content app.
|
3 |
Tags: sexybookmarks, shareaholic, shareholic, facebook, twitter, linkedin, URL Shortener, bitly, tinyurl, Goo.gl, Google+1, Google Analytics, Google Plus, Google, Instapaper, Wish List, Digg, Gmail, Google Bookmarks, Translate, Tumblr, AIM, Yahoo Messenger, Delicious, StumbleUpon, mister wong, evernote, add this, addtoany, share this, sharethis, share and follow, share and enjoy, sharing is sexy, sharing is caring, yahoo, reddit, hackernews, tweet button, twitter button, fark, buffer, myspace, orkut, netlog, hubspot, weheartit, printfriendly, yammer, wanelo, pinterest, google translate, bookmarks, social, email button, social share, socialize, sociable, sharebar, bookmark button, share button, social bookmarking, bookmarks menu, bookmarking, share, seo, analytics, stats, sharing, facebook like, facebook recommend, WPMU, mutisite, sumome, shortcode, yaarp, yarpp, nrelate, outbrain, linkwithin, related content, related posts, related, popular posts, popular, thumbnails, recommendations
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.9.1
|
6 |
+
Stable tag: 7.5.0.4
|
7 |
|
8 |
Adds an attractive social bookmarking menu and related content widget to your posts, pages, index, or any combination of the three.
|
9 |
|
43 |
|
44 |
Shareaholic is used and trusted by hundreds of thousands of websites like yours and touches almost 300 million people each month. Designed and built with all the love in the world in Boston, Massachusetts.
|
45 |
|
46 |
+
Note: The analytics portion of Shareaholic may use trusted 3rd party services like Google Analytics and AppNexus to enhance its data.
|
47 |
|
48 |
|
49 |
[Support](http://support.shareaholic.com/) | [Privacy](https://shareaholic.com/privacy/) | [Terms](https://shareaholic.com/terms/) | [API](https://shareaholic.com/api/) | [Social Analytics](https://shareaholic.com/publishers/analytics/)
|
159 |
|
160 |
== Changelog ==
|
161 |
|
162 |
+
= 7.5.0.4 =
|
163 |
+
* Cache server side share counts for longer duration (5 minutes)
|
164 |
+
* Bugfix: Fixed miscellaneous v6->v7 conversion bugs
|
165 |
+
|
166 |
= 7.5.0.3 =
|
167 |
* Related Content
|
168 |
+
* Faster on-boarding! (in seconds vs hours)
|
169 |
+
* Post-Share Follow Buttons [learn more](https://blog.shareaholic.com/new-services-added-to-post-share-follow-buttons-including-youtube-and-instagram/)
|
170 |
+
* Added support for Instagram, YouTube, Bloglovin, Vimeo, Flickr, Dribbble, FourSquare, Yelp, RSS
|
171 |
* Share Buttons
|
172 |
+
* Added support for Meneame, Wykop
|
173 |
+
* Floated Share Buttons
|
174 |
+
* You can now "offset" its position from the top of the page [learn more](https://blog.shareaholic.com/offset-floated-share-buttons/)
|
175 |
|
176 |
= 7.5.0.2 =
|
177 |
* Miscellaneous performance and on-boarding enhancements for the Related Content app
|
388 |
* More robust curl function, more robust plugin
|
389 |
* Show Related Posts data status
|
390 |
|
391 |
+
= 6.1.5.1 =
|
392 |
+
* Recommendations / Related Content are now 100% responsive (aka "mobile-ready")! This means they will now adapt to the screen size or device (iPhone, iPad, Android, tablet, laptop, etc) of your visitors automagically for the best, most seamless discovery experience.
|
393 |
+
|
394 |
+
= 6.1.5.0 =
|
395 |
+
* Fix for Cross-Site Request Forgery vulnerability. Upgrade immediately. Credits for finding and reporting the vulnerability go to Charlie Eriksen via Secunia SVCRP.
|
396 |
+
|
397 |
+
= 6.1.4.1 =
|
398 |
+
* Shareaholic is 100% compatible with WordPress 3.6! Yay!
|
399 |
+
|
400 |
+
= 6.1.4.0 =
|
401 |
+
* Bugfix: Related Content settings page now loads for multisite install. Updated how Shareaholic reads user permissions. Now using in-built WordPress functions.
|
402 |
+
* Bugfix: Facebook Debugger will no longer show "Parser Mismatched Metadata" warnings
|
403 |
+
* Updated primary plugin file to "shareaholic.php"
|
404 |
+
* Cleaned up assets directory, as a result the plugin install file is now a lot smaller
|
405 |
+
|
406 |
= 6.1.3.8 =
|
407 |
* Bugfix: fixed "Cannot use object of type WP_Error"
|
408 |
|
1122 |
|
1123 |
== Upgrade Notice ==
|
1124 |
|
1125 |
+
= 7.5.0.4 =
|
1126 |
+
|
1127 |
+
Improvements to share count caching.
|
1128 |
+
|
1129 |
= 7.5.0.3 =
|
1130 |
|
1131 |
New post-share follow button services (including Instagram, YouTube and RSS) and additional improvements to the Related Content app.
|
shareaholic.php
CHANGED
@@ -3,14 +3,14 @@
|
|
3 |
* The main file!
|
4 |
*
|
5 |
* @package shareaholic
|
6 |
-
* @version 7.5.0.
|
7 |
*/
|
8 |
|
9 |
/*
|
10 |
Plugin Name: Shareaholic | share buttons, analytics, related content
|
11 |
Plugin URI: https://shareaholic.com/publishers/
|
12 |
Description: Whether you want to get people sharing, grow your fans, make money, or know who's reading your content, Shareaholic will help you get it done. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for more settings.
|
13 |
-
Version: 7.5.0.
|
14 |
Author: Shareaholic
|
15 |
Author URI: https://shareaholic.com
|
16 |
Text Domain: shareaholic
|
@@ -33,15 +33,16 @@ Credits & Thanks: https://shareaholic.com/tools/wordpress/credits
|
|
33 |
* error_reporting(E_ALL ^ E_NOTICE);
|
34 |
*/
|
35 |
|
36 |
-
define('SHAREAHOLIC_DIR', dirname(__FILE__));
|
37 |
-
define('SHAREAHOLIC_ASSET_DIR', plugins_url( '/assets/' , __FILE__ ));
|
38 |
|
39 |
// Caching
|
40 |
-
if(
|
41 |
-
if(
|
42 |
|
43 |
// because define can use function returns and const can't
|
44 |
-
define('SHAREAHOLIC_DEBUG', getenv('SHAREAHOLIC_DEBUG'));
|
|
|
45 |
|
46 |
require_once(SHAREAHOLIC_DIR . '/utilities.php');
|
47 |
require_once(SHAREAHOLIC_DIR . '/global_functions.php');
|
@@ -50,195 +51,215 @@ require_once(SHAREAHOLIC_DIR . '/public.php');
|
|
50 |
require_once(SHAREAHOLIC_DIR . '/notifier.php');
|
51 |
require_once(SHAREAHOLIC_DIR . '/deprecation.php');
|
52 |
|
53 |
-
|
54 |
-
* The main / base class.
|
55 |
-
*
|
56 |
-
* @package shareaholic
|
57 |
-
*/
|
58 |
-
class Shareaholic {
|
59 |
-
const URL = 'https://shareaholic.com';
|
60 |
-
const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
|
61 |
-
const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
|
62 |
-
const REC_API_URL = 'http://recommendations.shareaholic.com';
|
63 |
-
|
64 |
-
const VERSION = '7.5.0.3';
|
65 |
-
|
66 |
/**
|
67 |
-
*
|
68 |
-
*
|
|
|
69 |
*/
|
70 |
-
|
|
|
|
|
|
|
|
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
add_action('
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
-
|
118 |
-
// add_action('publish_post', array('ShareaholicNotifier', 'post_notify'));
|
119 |
-
// add_action('publish_page', array('ShareaholicNotifier', 'post_notify'));
|
120 |
-
|
121 |
-
add_action('transition_post_status', array('ShareaholicUtilities', 'post_transitioned'), 10, 3);
|
122 |
-
|
123 |
-
register_activation_hook(__FILE__, array($this, 'after_activation'));
|
124 |
-
register_deactivation_hook( __FILE__, array($this, 'deactivate'));
|
125 |
-
register_uninstall_hook(__FILE__, array('Shareaholic', 'uninstall'));
|
126 |
-
|
127 |
-
add_action('wp_before_admin_bar_render', array('ShareaholicUtilities', 'admin_bar_extended'));
|
128 |
-
add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'ShareaholicUtilities::admin_plugin_action_links', -10);
|
129 |
-
}
|
130 |
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
|
|
|
|
|
|
140 |
}
|
141 |
-
self::init();
|
142 |
-
return self::$instance;
|
143 |
-
}
|
144 |
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
|
|
154 |
}
|
155 |
-
}
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
|
|
166 |
}
|
167 |
-
}
|
168 |
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
if (!ShareaholicUtilities::has_accepted_terms_of_service()) {
|
177 |
add_action('admin_notices', array('ShareaholicAdmin', 'show_terms_of_service'));
|
178 |
} else {
|
179 |
-
|
180 |
-
ShareaholicUtilities::log_event("Upgrade", array ('previous_plugin_version' => ShareaholicUtilities::get_version()));
|
181 |
-
ShareaholicUtilities::perform_update();
|
182 |
-
ShareaholicUtilities::set_version(self::VERSION);
|
183 |
-
ShareaholicUtilities::notify_content_manager_sitemap();
|
184 |
-
ShareaholicUtilities::notify_content_manager_singledomain();
|
185 |
-
|
186 |
-
// Call the share counts api to check for connectivity on update
|
187 |
-
if (has_action('wp_ajax_nopriv_shareaholic_share_counts_api') && has_action('wp_ajax_shareaholic_share_counts_api')) {
|
188 |
-
ShareaholicUtilities::share_counts_api_connectivity_check();
|
189 |
-
}
|
190 |
-
}
|
191 |
}
|
192 |
}
|
193 |
-
}
|
194 |
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
}
|
204 |
-
}
|
205 |
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
// workaround: http://codex.wordpress.org/Function_Reference/register_activation_hook
|
214 |
-
add_option( 'Activated_Plugin_Shareaholic', 'shareaholic' );
|
215 |
-
|
216 |
-
if (ShareaholicUtilities::has_accepted_terms_of_service() && ShareaholicUtilities::get_option('api_key') != NULL){
|
217 |
-
ShareaholicUtilities::notify_content_manager_sitemap();
|
218 |
-
ShareaholicUtilities::notify_content_manager_singledomain();
|
219 |
}
|
220 |
|
221 |
-
|
222 |
-
|
|
|
|
|
|
|
|
|
223 |
}
|
224 |
}
|
225 |
|
226 |
-
|
227 |
-
|
228 |
-
*/
|
229 |
-
public function deactivate() {
|
230 |
-
ShareaholicUtilities::log_event("Deactivate");
|
231 |
-
ShareaholicUtilities::clear_cache();
|
232 |
-
}
|
233 |
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
|
|
|
|
240 |
}
|
241 |
}
|
242 |
|
243 |
-
|
244 |
-
|
|
|
|
|
|
|
|
|
|
3 |
* The main file!
|
4 |
*
|
5 |
* @package shareaholic
|
6 |
+
* @version 7.5.0.4
|
7 |
*/
|
8 |
|
9 |
/*
|
10 |
Plugin Name: Shareaholic | share buttons, analytics, related content
|
11 |
Plugin URI: https://shareaholic.com/publishers/
|
12 |
Description: Whether you want to get people sharing, grow your fans, make money, or know who's reading your content, Shareaholic will help you get it done. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for more settings.
|
13 |
+
Version: 7.5.0.4
|
14 |
Author: Shareaholic
|
15 |
Author URI: https://shareaholic.com
|
16 |
Text Domain: shareaholic
|
33 |
* error_reporting(E_ALL ^ E_NOTICE);
|
34 |
*/
|
35 |
|
36 |
+
if(!defined('SHAREAHOLIC_DIR')) define('SHAREAHOLIC_DIR', dirname(__FILE__));
|
37 |
+
if(!defined('SHAREAHOLIC_ASSET_DIR')) define('SHAREAHOLIC_ASSET_DIR', plugins_url( '/assets/' , __FILE__ ));
|
38 |
|
39 |
// Caching
|
40 |
+
if(!defined('SHARE_COUNTS_CHECK_CACHE_LENGTH')) define( 'SHARE_COUNTS_CHECK_CACHE_LENGTH', 300 ); // 300 seconds
|
41 |
+
if(!defined('RECOMMENDATIONS_STATUS_CHECK_CACHE_LENGTH')) define( 'RECOMMENDATIONS_STATUS_CHECK_CACHE_LENGTH', 60 ); // 60 seconds
|
42 |
|
43 |
// because define can use function returns and const can't
|
44 |
+
if(!defined('SHAREAHOLIC_DEBUG')) define('SHAREAHOLIC_DEBUG', getenv('SHAREAHOLIC_DEBUG'));
|
45 |
+
|
46 |
|
47 |
require_once(SHAREAHOLIC_DIR . '/utilities.php');
|
48 |
require_once(SHAREAHOLIC_DIR . '/global_functions.php');
|
51 |
require_once(SHAREAHOLIC_DIR . '/notifier.php');
|
52 |
require_once(SHAREAHOLIC_DIR . '/deprecation.php');
|
53 |
|
54 |
+
if (!class_exists('Shareaholic')) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
/**
|
56 |
+
* The main / base class.
|
57 |
+
*
|
58 |
+
* @package shareaholic
|
59 |
*/
|
60 |
+
class Shareaholic {
|
61 |
+
const URL = 'https://shareaholic.com';
|
62 |
+
const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
|
63 |
+
const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
|
64 |
+
const REC_API_URL = 'http://recommendations.shareaholic.com';
|
65 |
|
66 |
+
const VERSION = '7.5.0.4';
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Starts off as false so that ::get_instance() returns
|
70 |
+
* a new instance.
|
71 |
+
*/
|
72 |
+
private static $instance = false;
|
73 |
+
|
74 |
+
/**
|
75 |
+
* The constructor registers all the wordpress actions.
|
76 |
+
*/
|
77 |
+
private function __construct() {
|
78 |
+
add_action('wp_ajax_shareaholic_accept_terms_of_service', array('ShareaholicUtilities', 'accept_terms_of_service'));
|
79 |
+
|
80 |
+
// Share Counts API
|
81 |
+
add_action('wp_ajax_nopriv_shareaholic_share_counts_api', array('ShareaholicPublic', 'share_counts_api'));
|
82 |
+
add_action('wp_ajax_shareaholic_share_counts_api', array('ShareaholicPublic', 'share_counts_api'));
|
83 |
+
|
84 |
+
// Debug info
|
85 |
+
add_action('wp_ajax_nopriv_shareaholic_debug_info', array('ShareaholicPublic', 'debug_info'));
|
86 |
+
add_action('wp_ajax_shareaholic_debug_info', array('ShareaholicPublic', 'debug_info'));
|
87 |
+
|
88 |
+
// Permalink list for Related Content index
|
89 |
+
add_action('wp_ajax_nopriv_shareaholic_permalink_list', array('ShareaholicPublic', 'permalink_list'));
|
90 |
+
add_action('wp_ajax_shareaholic_permalink_list', array('ShareaholicPublic', 'permalink_list'));
|
91 |
+
|
92 |
+
// Permalink info for Related Content index
|
93 |
+
add_action('wp_ajax_nopriv_shareaholic_permalink_info', array('ShareaholicPublic', 'permalink_info'));
|
94 |
+
add_action('wp_ajax_shareaholic_permalink_info', array('ShareaholicPublic', 'permalink_info'));
|
95 |
+
|
96 |
+
// Related Permalinks for Related Content app bootup
|
97 |
+
add_action('wp_ajax_nopriv_shareaholic_permalink_related', array('ShareaholicPublic', 'permalink_related'));
|
98 |
+
add_action('wp_ajax_shareaholic_permalink_related', array('ShareaholicPublic', 'permalink_related'));
|
99 |
+
|
100 |
+
add_action('init', array('ShareaholicPublic', 'init'));
|
101 |
+
add_action('after_setup_theme', array('ShareaholicPublic', 'after_setup_theme'));
|
102 |
+
add_action('the_content', array('ShareaholicPublic', 'draw_canvases'));
|
103 |
+
add_action('wp_head', array('ShareaholicPublic', 'wp_head'), 6);
|
104 |
+
add_shortcode('shareaholic', array('ShareaholicPublic', 'shortcode'));
|
105 |
+
|
106 |
+
add_action('plugins_loaded', array($this, 'shareaholic_init'));
|
107 |
+
|
108 |
+
add_action('admin_init', array('ShareaholicAdmin', 'admin_init'));
|
109 |
+
add_action('admin_enqueue_scripts', array('ShareaholicAdmin', 'admin_header'));
|
110 |
+
add_action('wp_ajax_shareaholic_add_location', array('ShareaholicAdmin', 'add_location'));
|
111 |
+
add_action('add_meta_boxes', array('ShareaholicAdmin', 'add_meta_boxes'));
|
112 |
+
add_action('save_post', array('ShareaholicAdmin', 'save_post'));
|
113 |
+
add_action('admin_enqueue_scripts', array('ShareaholicAdmin', 'enqueue_scripts'));
|
114 |
+
add_action('admin_menu', array('ShareaholicAdmin', 'admin_menu'));
|
115 |
+
|
116 |
+
if (!ShareaholicUtilities::has_accepted_terms_of_service()) {
|
117 |
+
add_action('admin_notices', array('ShareaholicAdmin', 'show_terms_of_service'));
|
118 |
+
}
|
119 |
+
|
120 |
+
// add_action('publish_post', array('ShareaholicNotifier', 'post_notify'));
|
121 |
+
// add_action('publish_page', array('ShareaholicNotifier', 'post_notify'));
|
122 |
+
|
123 |
+
add_action('transition_post_status', array('ShareaholicUtilities', 'post_transitioned'), 10, 3);
|
124 |
+
|
125 |
+
register_activation_hook(__FILE__, array($this, 'after_activation'));
|
126 |
+
register_deactivation_hook( __FILE__, array($this, 'deactivate'));
|
127 |
+
register_uninstall_hook(__FILE__, array('Shareaholic', 'uninstall'));
|
128 |
+
|
129 |
+
add_action('wp_before_admin_bar_render', array('ShareaholicUtilities', 'admin_bar_extended'));
|
130 |
+
add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'ShareaholicUtilities::admin_plugin_action_links', -10);
|
131 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
|
133 |
+
/**
|
134 |
+
* We want this to be a singleton, so return the one instance
|
135 |
+
* if already instantiated.
|
136 |
+
*
|
137 |
+
* @return Shareaholic
|
138 |
+
*/
|
139 |
+
public static function get_instance() {
|
140 |
+
if ( ! self::$instance ) {
|
141 |
+
self::$instance = new self();
|
142 |
+
}
|
143 |
+
self::init();
|
144 |
+
return self::$instance;
|
145 |
}
|
|
|
|
|
|
|
146 |
|
147 |
+
/**
|
148 |
+
* This function initializes the plugin so that everything is scoped
|
149 |
+
* under the class and no variables leak outside.
|
150 |
+
*/
|
151 |
+
public static function init() {
|
152 |
+
self::update();
|
153 |
+
if (ShareaholicUtilities::has_accepted_terms_of_service() &&
|
154 |
+
isset($_GET['page']) && preg_match('/shareaholic/', $_GET['page'])) {
|
155 |
+
ShareaholicUtilities::get_or_create_api_key();
|
156 |
+
}
|
157 |
}
|
|
|
158 |
|
159 |
+
/**
|
160 |
+
* This function fires once any activated plugins have been loaded. Is generally used for immediate filter setup, or plugin overrides.
|
161 |
+
*/
|
162 |
+
public function shareaholic_init() {
|
163 |
+
ShareaholicUtilities::localize();
|
164 |
+
|
165 |
+
// Send Welcome email if we haven't sent it already (check whenever a new site ID is set)
|
166 |
+
if (ShareaholicUtilities::get_option('api_key') != NULL) {
|
167 |
+
ShareaholicAdmin::welcome_email();
|
168 |
+
}
|
169 |
}
|
|
|
170 |
|
171 |
+
/**
|
172 |
+
* Runs any update code if the version is different from what's
|
173 |
+
* stored in the settings. This will only run if we are on the
|
174 |
+
* shareaholic admin page to minimize any concurrency issues.
|
175 |
+
*/
|
176 |
+
public static function update() {
|
177 |
+
if (isset($_GET['page']) && preg_match('/shareaholic/', $_GET['page'])) {
|
178 |
+
if (!ShareaholicUtilities::has_accepted_terms_of_service()) {
|
179 |
+
add_action('admin_notices', array('ShareaholicAdmin', 'show_terms_of_service'));
|
180 |
+
} else {
|
181 |
+
if (ShareaholicUtilities::get_version() != self::VERSION) {
|
182 |
+
ShareaholicUtilities::log_event("Upgrade", array ('previous_plugin_version' => ShareaholicUtilities::get_version()));
|
183 |
+
ShareaholicUtilities::perform_update();
|
184 |
+
ShareaholicUtilities::set_version(self::VERSION);
|
185 |
+
ShareaholicUtilities::notify_content_manager_sitemap();
|
186 |
+
ShareaholicUtilities::notify_content_manager_singledomain();
|
187 |
+
|
188 |
+
// Call the share counts api to check for connectivity on update
|
189 |
+
if (has_action('wp_ajax_nopriv_shareaholic_share_counts_api') && has_action('wp_ajax_shareaholic_share_counts_api')) {
|
190 |
+
ShareaholicUtilities::share_counts_api_connectivity_check();
|
191 |
+
}
|
192 |
+
}
|
193 |
+
}
|
194 |
+
}
|
195 |
+
}
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Checks whether to ask the user to accept the terms of service or not.
|
199 |
+
*/
|
200 |
+
public function terms_of_service() {
|
201 |
if (!ShareaholicUtilities::has_accepted_terms_of_service()) {
|
202 |
add_action('admin_notices', array('ShareaholicAdmin', 'show_terms_of_service'));
|
203 |
} else {
|
204 |
+
ShareaholicUtilities::get_or_create_api_key();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
}
|
206 |
}
|
|
|
207 |
|
208 |
+
/**
|
209 |
+
* This function fires after the plugin has been activated.
|
210 |
+
*/
|
211 |
+
public function after_activation() {
|
212 |
+
$this->terms_of_service();
|
213 |
+
ShareaholicUtilities::log_event("Activate");
|
214 |
+
|
215 |
+
// workaround: http://codex.wordpress.org/Function_Reference/register_activation_hook
|
216 |
+
add_option( 'Activated_Plugin_Shareaholic', 'shareaholic' );
|
217 |
+
|
218 |
+
if (ShareaholicUtilities::has_accepted_terms_of_service() && ShareaholicUtilities::get_option('api_key') != NULL){
|
219 |
+
ShareaholicUtilities::notify_content_manager_sitemap();
|
220 |
+
ShareaholicUtilities::notify_content_manager_singledomain();
|
221 |
+
}
|
222 |
+
|
223 |
+
if (!ShareaholicUtilities::get_version()) {
|
224 |
+
ShareaholicUtilities::log_event("Install_Fresh");
|
225 |
+
}
|
226 |
}
|
|
|
227 |
|
228 |
+
/**
|
229 |
+
* This function fires when the plugin is deactivated.
|
230 |
+
*/
|
231 |
+
public function deactivate() {
|
232 |
+
ShareaholicUtilities::log_event("Deactivate");
|
233 |
+
ShareaholicUtilities::clear_cache();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
}
|
235 |
|
236 |
+
/**
|
237 |
+
* This function fires when the plugin is uninstalled.
|
238 |
+
*/
|
239 |
+
public function uninstall() {
|
240 |
+
ShareaholicUtilities::log_event("Uninstall");
|
241 |
+
delete_option('shareaholic_settings');
|
242 |
}
|
243 |
}
|
244 |
|
245 |
+
// the magic
|
246 |
+
$shareaholic = Shareaholic::get_instance();
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
+
} else {
|
249 |
+
/* PLUGIN SPECIFIC CODE STARTS HERE */
|
250 |
+
register_activation_hook(__FILE__, 'shareaholic_update_primary_plugin');
|
251 |
+
}
|
252 |
+
|
253 |
+
function shareaholic_update_primary_plugin() {
|
254 |
+
if (is_plugin_active('sexybookmarks/shareaholic.php')) {
|
255 |
+
add_action('update_option_active_plugins', 'shareaholic_activate_primary_plugin');
|
256 |
}
|
257 |
}
|
258 |
|
259 |
+
function shareaholic_activate_primary_plugin() {
|
260 |
+
deactivate_plugins('sexybookmarks/shareaholic.php');
|
261 |
+
activate_plugins('shareaholic/shareaholic.php');
|
262 |
+
add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'ShareaholicUtilities::admin_plugin_action_links', -10);
|
263 |
+
}
|
264 |
+
/* PLUGIN SPECIFIC CODE ENDS HERE */
|
265 |
+
|
six_to_seven.php
CHANGED
@@ -46,18 +46,9 @@ class ShareaholicSixToSeven {
|
|
46 |
);
|
47 |
}
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
);
|
53 |
-
} elseif (ShareaholicUtilities::version_less_than_or_equal_to($version, '6.1.3.6')) {
|
54 |
-
$new_recommendations_configuration = array(
|
55 |
-
'locations_attributes' => array(
|
56 |
-
array('name' => 'post_below_content'),
|
57 |
-
array('name' => 'page_below_content'),
|
58 |
-
)
|
59 |
-
);
|
60 |
-
}
|
61 |
|
62 |
$new_recommendations_configuration = isset($new_recommendations_configuration) ?
|
63 |
$new_recommendations_configuration :
|
@@ -82,7 +73,7 @@ class ShareaholicSixToSeven {
|
|
82 |
|
83 |
$shortener_configuration = (isset($sexybookmarks_configuration['shorty']) ?
|
84 |
self::transform_shortener_configuration($sexybookmarks_configuration) : array());
|
85 |
-
$new_configuration = array_merge($new_configuration, $shortener_configuration);
|
86 |
|
87 |
$response = ShareaholicCurl::post(Shareaholic::API_URL . '/publisher_tools/anonymous', $new_configuration, 'json');
|
88 |
|
@@ -157,18 +148,42 @@ class ShareaholicSixToSeven {
|
|
157 |
*/
|
158 |
private static function transform_sexybookmarks_configuration($share_buttons_configuration) {
|
159 |
$result = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
|
161 |
-
$result[$share_buttons_configuration['position']] = array(
|
162 |
-
'services' => self::services($share_buttons_configuration['bookmark']),
|
163 |
-
'theme' => 'diglett',
|
164 |
-
'counter' => 'badge-counter'
|
165 |
-
);
|
166 |
|
167 |
if (!isset($result['above']) && $share_buttons_configuration['likeButtonSetTop']) {
|
168 |
$result['above'] = array(
|
169 |
'services' => self::like_button_set_services($share_buttons_configuration),
|
170 |
'size' => 'rectangle',
|
171 |
'counter' => 'top-counter',
|
|
|
172 |
);
|
173 |
}
|
174 |
|
@@ -178,6 +193,7 @@ class ShareaholicSixToSeven {
|
|
178 |
// theme candybar
|
179 |
'size' => 'rectangle',
|
180 |
'counter' => 'top-counter',
|
|
|
181 |
);
|
182 |
}
|
183 |
|
@@ -374,7 +390,13 @@ class ShareaholicSixToSeven {
|
|
374 |
)
|
375 |
);
|
376 |
|
377 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
}
|
379 |
|
380 |
/**
|
@@ -406,6 +428,45 @@ class ShareaholicSixToSeven {
|
|
406 |
// now we use google_bookmarks
|
407 |
return 'google_bookmarks';
|
408 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
if (preg_match('/mail/', $value)) {
|
410 |
// it's stored as mail in wordpress, but
|
411 |
// now we use email_this
|
@@ -452,8 +513,10 @@ class ShareaholicSixToSeven {
|
|
452 |
private static function transform_wordpress_specific_settings() {
|
453 |
$new_shareaholic_settings = array();
|
454 |
$analytics_settings = get_option('ShareaholicAnalytics');
|
|
|
455 |
|
456 |
$new_shareaholic_settings['disable_tracking'] = (bool)$analytics_settings['pubGaSocial'];
|
|
|
457 |
|
458 |
ShareaholicUtilities::update_options($new_shareaholic_settings);
|
459 |
}
|
@@ -476,6 +539,44 @@ class ShareaholicSixToSeven {
|
|
476 |
delete_option('SHRSB_CustomSprite');
|
477 |
delete_option('SexyCustomSprite');
|
478 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
479 |
}
|
480 |
|
481 |
?>
|
46 |
);
|
47 |
}
|
48 |
|
49 |
+
$new_recommendations_configuration = array(
|
50 |
+
'locations_attributes' => self::transform_recommendations_configuration($recommendations_configuration)
|
51 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
$new_recommendations_configuration = isset($new_recommendations_configuration) ?
|
54 |
$new_recommendations_configuration :
|
73 |
|
74 |
$shortener_configuration = (isset($sexybookmarks_configuration['shorty']) ?
|
75 |
self::transform_shortener_configuration($sexybookmarks_configuration) : array());
|
76 |
+
$new_configuration['configuration_publisher'] = array_merge($new_configuration['configuration_publisher'], $shortener_configuration);
|
77 |
|
78 |
$response = ShareaholicCurl::post(Shareaholic::API_URL . '/publisher_tools/anonymous', $new_configuration, 'json');
|
79 |
|
148 |
*/
|
149 |
private static function transform_sexybookmarks_configuration($share_buttons_configuration) {
|
150 |
$result = array();
|
151 |
+
$headline_text = self::transform_headline_text_settings($share_buttons_configuration);
|
152 |
+
$counter = $share_buttons_configuration['showShareCount'] == '1' ? 'badge-counter' : '';
|
153 |
+
$alignment = $share_buttons_configuration['autocenter'] != '0' ? 'center-align' : '';
|
154 |
+
|
155 |
+
if ($share_buttons_configuration['position'] != 'both') {
|
156 |
+
$result[$share_buttons_configuration['position']] = array(
|
157 |
+
'services' => self::services($share_buttons_configuration['bookmark']),
|
158 |
+
'theme' => 'diglett',
|
159 |
+
'counter' => $counter,
|
160 |
+
'headline_text' => $headline_text,
|
161 |
+
'alignment' => $alignment
|
162 |
+
);
|
163 |
+
} else {
|
164 |
+
$result['above'] = array(
|
165 |
+
'services' => self::services($share_buttons_configuration['bookmark']),
|
166 |
+
'theme' => 'diglett',
|
167 |
+
'counter' => $counter,
|
168 |
+
'headline_text' => $headline_text,
|
169 |
+
'alignment' => $alignment
|
170 |
+
);
|
171 |
+
$result['below'] = array(
|
172 |
+
'services' => self::services($share_buttons_configuration['bookmark']),
|
173 |
+
'theme' => 'diglett',
|
174 |
+
'counter' => $counter,
|
175 |
+
'headline_text' => $headline_text,
|
176 |
+
'alignment' => $alignment
|
177 |
+
);
|
178 |
+
}
|
179 |
|
|
|
|
|
|
|
|
|
|
|
180 |
|
181 |
if (!isset($result['above']) && $share_buttons_configuration['likeButtonSetTop']) {
|
182 |
$result['above'] = array(
|
183 |
'services' => self::like_button_set_services($share_buttons_configuration),
|
184 |
'size' => 'rectangle',
|
185 |
'counter' => 'top-counter',
|
186 |
+
'headline_text' => ''
|
187 |
);
|
188 |
}
|
189 |
|
193 |
// theme candybar
|
194 |
'size' => 'rectangle',
|
195 |
'counter' => 'top-counter',
|
196 |
+
'headline_text' => ''
|
197 |
);
|
198 |
}
|
199 |
|
390 |
)
|
391 |
);
|
392 |
|
393 |
+
$page_types = 'postpagecategory';
|
394 |
+
|
395 |
+
if ($recommendations_configuration['recommendations'] == '1') {
|
396 |
+
$page_types = $recommendations_configuration['pageorpost'] . 'postpagecategory';
|
397 |
+
}
|
398 |
+
|
399 |
+
return self::set_page_types($settings, $page_types);
|
400 |
}
|
401 |
|
402 |
/**
|
428 |
// now we use google_bookmarks
|
429 |
return 'google_bookmarks';
|
430 |
}
|
431 |
+
if (preg_match('/scriptstyle/', $value)) {
|
432 |
+
return 'script_and_style';
|
433 |
+
}
|
434 |
+
if (preg_match('/designfloat/', $value)) {
|
435 |
+
return 'design_float';
|
436 |
+
}
|
437 |
+
if (preg_match('/misterwong/', $value)) {
|
438 |
+
return 'mister_wong';
|
439 |
+
}
|
440 |
+
if (preg_match('/hackernews/', $value)) {
|
441 |
+
return 'yc_hacker_news';
|
442 |
+
}
|
443 |
+
if (preg_match('/designbump/', $value)) {
|
444 |
+
return 'design_bump';
|
445 |
+
}
|
446 |
+
if (preg_match('/globalgrind/', $value)) {
|
447 |
+
return 'global_grind';
|
448 |
+
}
|
449 |
+
if (preg_match('/pingfm/', $value)) {
|
450 |
+
return 'ping_fm';
|
451 |
+
}
|
452 |
+
if (preg_match('/webblend/', $value)) {
|
453 |
+
return 'web_blend';
|
454 |
+
}
|
455 |
+
if (preg_match('/shr-box/', $value)) {
|
456 |
+
return 'box_net';
|
457 |
+
}
|
458 |
+
if (preg_match('/plaxo/', $value)) {
|
459 |
+
return 'plaxo_pulse';
|
460 |
+
}
|
461 |
+
if (preg_match('/gmail/', $value)) {
|
462 |
+
return 'google_mail';
|
463 |
+
}
|
464 |
+
if (preg_match('/yahoomail/', $value)) {
|
465 |
+
return 'yahoo_mail';
|
466 |
+
}
|
467 |
+
if (preg_match('/fastmail/', $value)) {
|
468 |
+
return 'mail';
|
469 |
+
}
|
470 |
if (preg_match('/mail/', $value)) {
|
471 |
// it's stored as mail in wordpress, but
|
472 |
// now we use email_this
|
513 |
private static function transform_wordpress_specific_settings() {
|
514 |
$new_shareaholic_settings = array();
|
515 |
$analytics_settings = get_option('ShareaholicAnalytics');
|
516 |
+
$sexybookmarks_settings = get_option('SexyBookmarks');
|
517 |
|
518 |
$new_shareaholic_settings['disable_tracking'] = (bool)$analytics_settings['pubGaSocial'];
|
519 |
+
$new_shareaholic_settings['disable_og_tags'] = $sexybookmarks_settings['ogtags'] == '0' ? 'on' : 'off';
|
520 |
|
521 |
ShareaholicUtilities::update_options($new_shareaholic_settings);
|
522 |
}
|
539 |
delete_option('SHRSB_CustomSprite');
|
540 |
delete_option('SexyCustomSprite');
|
541 |
}
|
542 |
+
|
543 |
+
/**
|
544 |
+
* Transform headline text based on background image
|
545 |
+
*
|
546 |
+
*/
|
547 |
+
private static function transform_headline_text_settings($sexybookmarks_configuration) {
|
548 |
+
$headline_text = '';
|
549 |
+
|
550 |
+
if ($sexybookmarks_configuration['bgimg-yes'] != 'yes') {
|
551 |
+
return $headline_text;
|
552 |
+
}
|
553 |
+
|
554 |
+
switch ($sexybookmarks_configuration['bgimg']) {
|
555 |
+
case 'shr':
|
556 |
+
$headline_text = 'Sharing is sexy!';
|
557 |
+
break;
|
558 |
+
case 'caring':
|
559 |
+
$headline_text = 'Sharing is caring.';
|
560 |
+
break;
|
561 |
+
case 'love':
|
562 |
+
$headline_text = 'Share the love!';
|
563 |
+
break;
|
564 |
+
case 'wealth':
|
565 |
+
$headline_text = 'Share the wealth!';
|
566 |
+
break;
|
567 |
+
case 'enjoy':
|
568 |
+
$headline_text = 'Share and enjoy!';
|
569 |
+
break;
|
570 |
+
case 'knowledge':
|
571 |
+
$headline_text = 'Share the knowledge!';
|
572 |
+
break;
|
573 |
+
case 'german':
|
574 |
+
case 'care-old':
|
575 |
+
default:
|
576 |
+
$headline_text = 'Sharing is caring!';
|
577 |
+
}
|
578 |
+
return $headline_text;
|
579 |
+
}
|
580 |
}
|
581 |
|
582 |
?>
|
templates/advanced_settings.php
CHANGED
@@ -30,6 +30,12 @@
|
|
30 |
<?php } ?>>
|
31 |
<label style="display: inline-block; font-size:12px;" for="admin_bar"><?php echo sprintf(__('Disable Admin Bar Menu (requires page refresh)', 'shareaholic')); ?></label>
|
32 |
<br/>
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
<input type='checkbox' id='share_counts' name='shareaholic[disable_internal_share_counts_api]' class='check'
|
34 |
<?php if (isset($settings['disable_internal_share_counts_api'])) { ?>
|
35 |
<?php echo ($settings['disable_internal_share_counts_api'] == 'on' ? 'checked' : '') ?>
|
30 |
<?php } ?>>
|
31 |
<label style="display: inline-block; font-size:12px;" for="admin_bar"><?php echo sprintf(__('Disable Admin Bar Menu (requires page refresh)', 'shareaholic')); ?></label>
|
32 |
<br/>
|
33 |
+
<input type='checkbox' id='debugger' name='shareaholic[disable_debug_info]' class='check'
|
34 |
+
<?php if (isset($settings['disable_debug_info'])) { ?>
|
35 |
+
<?php echo ($settings['disable_debug_info'] == 'on' ? 'checked' : '') ?>
|
36 |
+
<?php } ?>>
|
37 |
+
<label style="display: inline-block; font-size:12px;" for="debugger"><?php echo sprintf(__('Disable Debugger (it is recommended NOT to disable the debugger)', 'shareaholic')); ?></label>
|
38 |
+
<br/>
|
39 |
<input type='checkbox' id='share_counts' name='shareaholic[disable_internal_share_counts_api]' class='check'
|
40 |
<?php if (isset($settings['disable_internal_share_counts_api'])) { ?>
|
41 |
<?php echo ($settings['disable_internal_share_counts_api'] == 'on' ? 'checked' : '') ?>
|
templates/terms_of_service_modal.php
CHANGED
@@ -18,7 +18,8 @@
|
|
18 |
</div>
|
19 |
<div class="pvl">
|
20 |
<a id='get_started' class="btn_main"><?php echo sprintf(__('Get Started »', 'shareaholic')); ?></a>
|
21 |
-
<p><small><?php echo sprintf(__('By clicking "Get Started" you agree to Shareholic\'s %sTerms of Service%s and %sPrivacy Policy%s.', 'shareaholic'), '<a href="https://shareaholic.com/terms/?src=wp_admin" target="_new">', '</a>', '<a href="https://shareaholic.com/privacy/?src=wp_admin" target="_new">', '</a>'); ?></
|
|
|
22 |
</div>
|
23 |
</div>
|
24 |
-
</div>
|
18 |
</div>
|
19 |
<div class="pvl">
|
20 |
<a id='get_started' class="btn_main"><?php echo sprintf(__('Get Started »', 'shareaholic')); ?></a>
|
21 |
+
<p><small><?php echo sprintf(__('By clicking "Get Started" you agree to Shareholic\'s %sTerms of Service%s and %sPrivacy Policy%s.', 'shareaholic'), '<a href="https://shareaholic.com/terms/?src=wp_admin" target="_new">', '</a>', '<a href="https://shareaholic.com/privacy/?src=wp_admin" target="_new">', '</a>'); ?></small>
|
22 |
+
</p>
|
23 |
</div>
|
24 |
</div>
|
25 |
+
</div>
|
utilities.php
CHANGED
@@ -79,6 +79,7 @@ class ShareaholicUtilities {
|
|
79 |
return array(
|
80 |
'disable_tracking' => 'off',
|
81 |
'disable_admin_bar_menu' => 'off',
|
|
|
82 |
'disable_internal_share_counts_api' => 'off',
|
83 |
'api_key' => '',
|
84 |
'verification_key' => '',
|
@@ -327,7 +328,6 @@ class ShareaholicUtilities {
|
|
327 |
$results = $wpdb->query( "UPDATE $wpdb->postmeta SET `meta_key` = 'shareaholic_disable_open_graph_tags' WHERE `meta_key` = 'Hide OgTags'" );
|
328 |
$results = $wpdb->query( "UPDATE $wpdb->postmeta SET `meta_key` = 'shareaholic_disable_share_buttons' WHERE `meta_key` = 'Hide SexyBookmarks'" );
|
329 |
self::update_options(array('disable_tracking' => 'off'));
|
330 |
-
self::update_options(array('disable_og_tags' => 'off'));
|
331 |
self::update_options(array('metakey_6to7_upgraded' => 'true'));
|
332 |
}
|
333 |
|
@@ -561,14 +561,14 @@ class ShareaholicUtilities {
|
|
561 |
* @param string $name
|
562 |
*/
|
563 |
public static function check_for_other_plugin() {
|
564 |
-
if (is_plugin_active('
|
565 |
-
deactivate_plugins('sexybookmarks/sexy-bookmarks.php');
|
566 |
-
}
|
567 |
-
if (is_plugin_active('sexybookmarks/shareaholic.php')) {
|
568 |
deactivate_plugins('sexybookmarks/shareaholic.php');
|
569 |
}
|
|
|
|
|
|
|
570 |
}
|
571 |
-
|
572 |
/**
|
573 |
* Returns the api key or creates a new one.
|
574 |
*
|
79 |
return array(
|
80 |
'disable_tracking' => 'off',
|
81 |
'disable_admin_bar_menu' => 'off',
|
82 |
+
'disable_debug_info' => 'off',
|
83 |
'disable_internal_share_counts_api' => 'off',
|
84 |
'api_key' => '',
|
85 |
'verification_key' => '',
|
328 |
$results = $wpdb->query( "UPDATE $wpdb->postmeta SET `meta_key` = 'shareaholic_disable_open_graph_tags' WHERE `meta_key` = 'Hide OgTags'" );
|
329 |
$results = $wpdb->query( "UPDATE $wpdb->postmeta SET `meta_key` = 'shareaholic_disable_share_buttons' WHERE `meta_key` = 'Hide SexyBookmarks'" );
|
330 |
self::update_options(array('disable_tracking' => 'off'));
|
|
|
331 |
self::update_options(array('metakey_6to7_upgraded' => 'true'));
|
332 |
}
|
333 |
|
561 |
* @param string $name
|
562 |
*/
|
563 |
public static function check_for_other_plugin() {
|
564 |
+
if (is_plugin_active('shareaholic/shareaholic.php')) {
|
|
|
|
|
|
|
565 |
deactivate_plugins('sexybookmarks/shareaholic.php');
|
566 |
}
|
567 |
+
if (is_plugin_active('shareaholic/sexy-bookmarks.php')) {
|
568 |
+
deactivate_plugins('sexybookmarks/sexy-bookmarks.php');
|
569 |
+
}
|
570 |
}
|
571 |
+
|
572 |
/**
|
573 |
* Returns the api key or creates a new one.
|
574 |
*
|