Version Description
Various bug fixes and enhancements
Download this release
Release Info
Developer | shareaholic |
Plugin | WordPress Social Tools, Related Posts, Monetization – Shareaholic |
Version | 8.4.0 |
Comparing to | |
See all releases |
Code changes from version 8.3.1 to 8.4.0
- curl.php +2 -1
- public.php +2 -2
- readme.txt +15 -8
- shareaholic.php +9 -6
- utilities.php +59 -26
curl.php
CHANGED
@@ -64,7 +64,7 @@ class ShareaholicCurl {
|
|
64 |
ShareaholicUtilities::log($method);
|
65 |
ShareaholicUtilities::log('-----------------');
|
66 |
$timeout = 15;
|
67 |
-
$useragent = 'WordPress/' . get_bloginfo('version') . '
|
68 |
if ($method == 'GET') {
|
69 |
$response = wp_remote_get($url, array('body' => $data, 'sslverify'=>false, 'user-agent'=>$useragent, 'timeout'=>$timeout));
|
70 |
} elseif ($method == 'POST') {
|
@@ -78,6 +78,7 @@ class ShareaholicCurl {
|
|
78 |
$request['body'] = $data;
|
79 |
}
|
80 |
$request['headers']['Accept'] = 'application/json';
|
|
|
81 |
$request['sslverify'] = false;
|
82 |
$request['timeout'] = $timeout;
|
83 |
$response = wp_remote_post($url, $request);
|
64 |
ShareaholicUtilities::log($method);
|
65 |
ShareaholicUtilities::log('-----------------');
|
66 |
$timeout = 15;
|
67 |
+
$useragent = 'WordPress/' . get_bloginfo('version') . ' ('. 'PHP/' . phpversion() . '; ' . 'SHR_WP/' . Shareaholic::VERSION . '; +' . get_bloginfo( 'url' ) . ')';
|
68 |
if ($method == 'GET') {
|
69 |
$response = wp_remote_get($url, array('body' => $data, 'sslverify'=>false, 'user-agent'=>$useragent, 'timeout'=>$timeout));
|
70 |
} elseif ($method == 'POST') {
|
78 |
$request['body'] = $data;
|
79 |
}
|
80 |
$request['headers']['Accept'] = 'application/json';
|
81 |
+
$request['headers']['user-agent'] = $useragent;
|
82 |
$request['sslverify'] = false;
|
83 |
$request['timeout'] = $timeout;
|
84 |
$response = wp_remote_post($url, $request);
|
public.php
CHANGED
@@ -169,7 +169,7 @@ class ShareaholicPublic {
|
|
169 |
*/
|
170 |
private static function draw_article_meta_tag() {
|
171 |
|
172 |
-
if (in_array(ShareaholicUtilities::page_type(), array('index', 'category'))) {
|
173 |
echo "<meta name='shareaholic:article_visibility' content='private' />\n";
|
174 |
return;
|
175 |
}
|
@@ -254,7 +254,7 @@ class ShareaholicPublic {
|
|
254 |
*/
|
255 |
private static function draw_plugin_version_meta_tag() {
|
256 |
echo "<meta name='shareaholic:wp_version' content='" . ShareaholicUtilities::get_version() . "' />\n";
|
257 |
-
}
|
258 |
|
259 |
/**
|
260 |
* Draws Shareaholic site name meta tag.
|
169 |
*/
|
170 |
private static function draw_article_meta_tag() {
|
171 |
|
172 |
+
if (in_array(ShareaholicUtilities::page_type(), array('index', 'category')) || is_404()) {
|
173 |
echo "<meta name='shareaholic:article_visibility' content='private' />\n";
|
174 |
return;
|
175 |
}
|
254 |
*/
|
255 |
private static function draw_plugin_version_meta_tag() {
|
256 |
echo "<meta name='shareaholic:wp_version' content='" . ShareaholicUtilities::get_version() . "' />\n";
|
257 |
+
}
|
258 |
|
259 |
/**
|
260 |
* Draws Shareaholic site name meta tag.
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: shareaholic
|
|
3 |
Tags: share buttons, related content, cookie compliance, eu cookie law, shareaholic, shareholic, sexybookmarks, recommendations, cookie consent, email button, social sharing, social bookmarking, share image, image sharing, follow buttons, floated share buttons, floating share buttons, analytics, social media, social plugin, facebook, twitter, google plus, google bookmarks, gmail, linkedin, pinterest, reddit, tumblr, evernote, digg, delicious, stumbleupon, printfriendly, fancy, amazon, xing, vk, yahoo, mister wong, viadeo, odnoklassniki box.net, diigo, yammer, ycombinator, hotmail, instapaper, mixi, arto, whatsapp, hootsuite, inbound.org, plurk, aim, buffer, meneame, pinboard.in, stumpedia, bitly, blogger, yummly, izeby, kaboodle, weibo, instagram, tinyurl, typepad, weheartit, flipboard, pocket, wanelo, fark, wykop, symphony, kindle, houzz, youtube, sms, onenote, google classroom, disqus, spotify, zillow, feedly, kik, line, livejournal, baidu
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.8
|
6 |
-
Stable tag: 8.
|
7 |
|
8 |
World's leading all-in-one Content Amplification Platform that helps grow your site traffic, engagement, conversions & monetization for FREE.
|
9 |
|
@@ -196,26 +196,30 @@ Please see here: [Usage & Installation Instructions](http://support.shareaholic.
|
|
196 |
|
197 |
== Changelog ==
|
198 |
|
199 |
-
= 8.
|
|
|
|
|
|
|
|
|
200 |
* Enhancement: Added page type tag to shareaholic:keywords (you will soon be able to exclude or include Related Content based on page type ie. page, post, etc)
|
201 |
* Bugfix: Fixed issue where plugin version was not getting updated in some cases
|
202 |
|
203 |
-
= 8.3.0 =
|
204 |
* Bugfix: Fixed issue where Share Buttons and Related Content apps were not showing after excerpts
|
205 |
* Various other performance updates and bug fixes
|
206 |
|
207 |
-
= 8.2.0 =
|
208 |
* New: **[Share Buttons for Images (Image Sharer)](https://blog.shareaholic.com/new-share-buttons-for-images-plugin/)** enhancements - you can now fully customize where these share buttons appear on your images and exactly how they will look and function, including setting opacity, offsets, icon padding, position, custom icon colors, size, and a lot more. All this, without touching ANY code! Also adds support for Facebook, Google+, Twitter, LinkedIn, Email, Fancy.com, Yummly and Houzz.
|
209 |
* New: **[Shareaholic Teams](https://blog.shareaholic.com/shareaholic-teams-work-together-to-manage-your-website/)** – multi-user permissions to enable your team to work together to manage your website
|
210 |
* Enhancement: **[Social Share Count Recovery](https://blog.shareaholic.com/recover-social-share-counts-https/)** - adds support to recover social share counts in case where permalink structure changes
|
211 |
* Various other performance updates and bug fixes
|
212 |
|
213 |
-
= 8.1.0 =
|
214 |
* New: Introducing the **[Tools Badge](https://support.shareaholic.com/hc/en-us/categories/115001014006-Tools-Badge)**! ([learn more](https://support.shareaholic.com/hc/en-us/categories/115001014006-Tools-Badge)) Introducing a brand new way to launch the Shareaholic Console without ever leaving your website! Contains quick-links to your site analytics, help center, and much more to help you manage your site with greater ease. If you'd rather hide this badge or change its location, you can do so from your settings. It is 100% configurable.
|
215 |
* Bugfix: Resolved the 403 Forbidden error that some admins were getting upon clicking the Dashboard link. Affected only sites on cPanel with mod_security enabled ex. HostGator
|
216 |
* Enhancement: Google+ share count is now also available to sites that do not enable Server Side Share counts API
|
217 |
|
218 |
-
= 8.0.1 =
|
219 |
* Version 8 is here bringing with it a brand new revamped and streamlined UI!
|
220 |
|
221 |
= 7.10.1.0 =
|
@@ -645,11 +649,14 @@ Please see here: [Usage & Installation Instructions](http://support.shareaholic.
|
|
645 |
|
646 |
== Upgrade Notice ==
|
647 |
|
|
|
|
|
|
|
648 |
= 8.3.1 =
|
649 |
-
Various bug fixes
|
650 |
|
651 |
= 8.3.0 =
|
652 |
-
Various enhancements
|
653 |
|
654 |
= 8.2.0 =
|
655 |
* Must Upgrade! Enhancements to Social Share Count Recovery - adds support for case where permalink structure changes, Share Buttons for Images (Image Sharer) and introducing Teams.
|
3 |
Tags: share buttons, related content, cookie compliance, eu cookie law, shareaholic, shareholic, sexybookmarks, recommendations, cookie consent, email button, social sharing, social bookmarking, share image, image sharing, follow buttons, floated share buttons, floating share buttons, analytics, social media, social plugin, facebook, twitter, google plus, google bookmarks, gmail, linkedin, pinterest, reddit, tumblr, evernote, digg, delicious, stumbleupon, printfriendly, fancy, amazon, xing, vk, yahoo, mister wong, viadeo, odnoklassniki box.net, diigo, yammer, ycombinator, hotmail, instapaper, mixi, arto, whatsapp, hootsuite, inbound.org, plurk, aim, buffer, meneame, pinboard.in, stumpedia, bitly, blogger, yummly, izeby, kaboodle, weibo, instagram, tinyurl, typepad, weheartit, flipboard, pocket, wanelo, fark, wykop, symphony, kindle, houzz, youtube, sms, onenote, google classroom, disqus, spotify, zillow, feedly, kik, line, livejournal, baidu
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 4.8
|
6 |
+
Stable tag: 8.4.0
|
7 |
|
8 |
World's leading all-in-one Content Amplification Platform that helps grow your site traffic, engagement, conversions & monetization for FREE.
|
9 |
|
196 |
|
197 |
== Changelog ==
|
198 |
|
199 |
+
= 8.4.0 (2017-09-19) =
|
200 |
+
* Bugfix: Mark 404 pages as not recommendable
|
201 |
+
* Various other performance updates and bug fixes
|
202 |
+
|
203 |
+
= 8.3.1 (2017-09-15) =
|
204 |
* Enhancement: Added page type tag to shareaholic:keywords (you will soon be able to exclude or include Related Content based on page type ie. page, post, etc)
|
205 |
* Bugfix: Fixed issue where plugin version was not getting updated in some cases
|
206 |
|
207 |
+
= 8.3.0 (2017-09-13) =
|
208 |
* Bugfix: Fixed issue where Share Buttons and Related Content apps were not showing after excerpts
|
209 |
* Various other performance updates and bug fixes
|
210 |
|
211 |
+
= 8.2.0 (2017-09-11) =
|
212 |
* New: **[Share Buttons for Images (Image Sharer)](https://blog.shareaholic.com/new-share-buttons-for-images-plugin/)** enhancements - you can now fully customize where these share buttons appear on your images and exactly how they will look and function, including setting opacity, offsets, icon padding, position, custom icon colors, size, and a lot more. All this, without touching ANY code! Also adds support for Facebook, Google+, Twitter, LinkedIn, Email, Fancy.com, Yummly and Houzz.
|
213 |
* New: **[Shareaholic Teams](https://blog.shareaholic.com/shareaholic-teams-work-together-to-manage-your-website/)** – multi-user permissions to enable your team to work together to manage your website
|
214 |
* Enhancement: **[Social Share Count Recovery](https://blog.shareaholic.com/recover-social-share-counts-https/)** - adds support to recover social share counts in case where permalink structure changes
|
215 |
* Various other performance updates and bug fixes
|
216 |
|
217 |
+
= 8.1.0 (2017-07-24) =
|
218 |
* New: Introducing the **[Tools Badge](https://support.shareaholic.com/hc/en-us/categories/115001014006-Tools-Badge)**! ([learn more](https://support.shareaholic.com/hc/en-us/categories/115001014006-Tools-Badge)) Introducing a brand new way to launch the Shareaholic Console without ever leaving your website! Contains quick-links to your site analytics, help center, and much more to help you manage your site with greater ease. If you'd rather hide this badge or change its location, you can do so from your settings. It is 100% configurable.
|
219 |
* Bugfix: Resolved the 403 Forbidden error that some admins were getting upon clicking the Dashboard link. Affected only sites on cPanel with mod_security enabled ex. HostGator
|
220 |
* Enhancement: Google+ share count is now also available to sites that do not enable Server Side Share counts API
|
221 |
|
222 |
+
= 8.0.1 (2017-07-10) =
|
223 |
* Version 8 is here bringing with it a brand new revamped and streamlined UI!
|
224 |
|
225 |
= 7.10.1.0 =
|
649 |
|
650 |
== Upgrade Notice ==
|
651 |
|
652 |
+
= 8.4.0 =
|
653 |
+
Various bug fixes and enhancements
|
654 |
+
|
655 |
= 8.3.1 =
|
656 |
+
Various bug fixes and enhancements
|
657 |
|
658 |
= 8.3.0 =
|
659 |
+
Various bug fixes and enhancements
|
660 |
|
661 |
= 8.2.0 =
|
662 |
* Must Upgrade! Enhancements to Social Share Count Recovery - adds support for case where permalink structure changes, Share Buttons for Images (Image Sharer) and introducing Teams.
|
shareaholic.php
CHANGED
@@ -3,14 +3,14 @@
|
|
3 |
* The main file!
|
4 |
*
|
5 |
* @package shareaholic
|
6 |
-
* @version 8.
|
7 |
*/
|
8 |
|
9 |
/*
|
10 |
Plugin Name: Shareaholic | share buttons, analytics, related content
|
11 |
Plugin URI: https://shareaholic.com/publishers/
|
12 |
Description: The world's leading all-in-one Content Amplification Platform that helps grow your website traffic, engagement, conversions & monetization. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for more settings.
|
13 |
-
Version: 8.
|
14 |
Author: Shareaholic
|
15 |
Author URI: https://shareaholic.com
|
16 |
Text Domain: shareaholic
|
@@ -63,7 +63,7 @@ if (!class_exists('Shareaholic')) {
|
|
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 = '8.
|
67 |
|
68 |
/**
|
69 |
* Starts off as false so that ::get_instance() returns
|
@@ -101,7 +101,7 @@ if (!class_exists('Shareaholic')) {
|
|
101 |
add_action('wp_ajax_nopriv_shareaholic_permalink_related', array('ShareaholicPublic', 'permalink_related'));
|
102 |
add_action('wp_ajax_shareaholic_permalink_related', array('ShareaholicPublic', 'permalink_related'));
|
103 |
|
104 |
-
add_action('
|
105 |
add_action('after_setup_theme', array('ShareaholicPublic', 'after_setup_theme'));
|
106 |
add_action('the_content', array('ShareaholicPublic', 'draw_canvases'));
|
107 |
add_action('the_excerpt', array('ShareaholicPublic', 'draw_canvases'));
|
@@ -191,7 +191,7 @@ if (!class_exists('Shareaholic')) {
|
|
191 |
*/
|
192 |
public function shareaholic_init() {
|
193 |
ShareaholicUtilities::localize();
|
194 |
-
|
195 |
if (ShareaholicUtilities::has_accepted_terms_of_service() &&
|
196 |
isset($_GET['page']) && preg_match('/shareaholic/', $_GET['page'])) {
|
197 |
ShareaholicUtilities::get_or_create_api_key();
|
@@ -230,7 +230,7 @@ if (!class_exists('Shareaholic')) {
|
|
230 |
// workaround: http://codex.wordpress.org/Function_Reference/register_activation_hook
|
231 |
add_option( 'Activated_Plugin_Shareaholic', 'shareaholic' );
|
232 |
|
233 |
-
if (ShareaholicUtilities::has_accepted_terms_of_service() && ShareaholicUtilities::get_option('api_key')
|
234 |
ShareaholicUtilities::notify_content_manager_sitemap();
|
235 |
ShareaholicUtilities::notify_content_manager_singledomain();
|
236 |
}
|
@@ -251,6 +251,7 @@ if (!class_exists('Shareaholic')) {
|
|
251 |
ShareaholicUtilities::clear_cache();
|
252 |
ShareaholicCron::deactivate();
|
253 |
delete_option('shareaholic_get_or_create_api_key');
|
|
|
254 |
}
|
255 |
|
256 |
/**
|
@@ -258,8 +259,10 @@ if (!class_exists('Shareaholic')) {
|
|
258 |
*/
|
259 |
public function uninstall() {
|
260 |
ShareaholicUtilities::log_event("Uninstall");
|
|
|
261 |
delete_option('shareaholic_settings');
|
262 |
delete_option('shareaholic_get_or_create_api_key');
|
|
|
263 |
}
|
264 |
}
|
265 |
|
3 |
* The main file!
|
4 |
*
|
5 |
* @package shareaholic
|
6 |
+
* @version 8.4.0
|
7 |
*/
|
8 |
|
9 |
/*
|
10 |
Plugin Name: Shareaholic | share buttons, analytics, related content
|
11 |
Plugin URI: https://shareaholic.com/publishers/
|
12 |
Description: The world's leading all-in-one Content Amplification Platform that helps grow your website traffic, engagement, conversions & monetization. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for more settings.
|
13 |
+
Version: 8.4.0
|
14 |
Author: Shareaholic
|
15 |
Author URI: https://shareaholic.com
|
16 |
Text Domain: shareaholic
|
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 = '8.4.0';
|
67 |
|
68 |
/**
|
69 |
* Starts off as false so that ::get_instance() returns
|
101 |
add_action('wp_ajax_nopriv_shareaholic_permalink_related', array('ShareaholicPublic', 'permalink_related'));
|
102 |
add_action('wp_ajax_shareaholic_permalink_related', array('ShareaholicPublic', 'permalink_related'));
|
103 |
|
104 |
+
add_action('wp_loaded', array('ShareaholicPublic', 'init'));
|
105 |
add_action('after_setup_theme', array('ShareaholicPublic', 'after_setup_theme'));
|
106 |
add_action('the_content', array('ShareaholicPublic', 'draw_canvases'));
|
107 |
add_action('the_excerpt', array('ShareaholicPublic', 'draw_canvases'));
|
191 |
*/
|
192 |
public function shareaholic_init() {
|
193 |
ShareaholicUtilities::localize();
|
194 |
+
|
195 |
if (ShareaholicUtilities::has_accepted_terms_of_service() &&
|
196 |
isset($_GET['page']) && preg_match('/shareaholic/', $_GET['page'])) {
|
197 |
ShareaholicUtilities::get_or_create_api_key();
|
230 |
// workaround: http://codex.wordpress.org/Function_Reference/register_activation_hook
|
231 |
add_option( 'Activated_Plugin_Shareaholic', 'shareaholic' );
|
232 |
|
233 |
+
if (ShareaholicUtilities::has_accepted_terms_of_service() && !empty(ShareaholicUtilities::get_option('api_key'))) {
|
234 |
ShareaholicUtilities::notify_content_manager_sitemap();
|
235 |
ShareaholicUtilities::notify_content_manager_singledomain();
|
236 |
}
|
251 |
ShareaholicUtilities::clear_cache();
|
252 |
ShareaholicCron::deactivate();
|
253 |
delete_option('shareaholic_get_or_create_api_key');
|
254 |
+
delete_option('shareaholic_perform_update');
|
255 |
}
|
256 |
|
257 |
/**
|
259 |
*/
|
260 |
public function uninstall() {
|
261 |
ShareaholicUtilities::log_event("Uninstall");
|
262 |
+
ShareaholicUtilities::delete_api_key();
|
263 |
delete_option('shareaholic_settings');
|
264 |
delete_option('shareaholic_get_or_create_api_key');
|
265 |
+
delete_option('shareaholic_perform_update');
|
266 |
}
|
267 |
}
|
268 |
|
utilities.php
CHANGED
@@ -187,7 +187,7 @@ class ShareaholicUtilities {
|
|
187 |
*
|
188 |
* @return mixed
|
189 |
*/
|
190 |
-
public static function get_option($option) {
|
191 |
$settings = self::get_settings();
|
192 |
return (isset($settings[$option]) ? $settings[$option] : array());
|
193 |
}
|
@@ -201,7 +201,11 @@ class ShareaholicUtilities {
|
|
201 |
public static function update_options($array) {
|
202 |
$old_settings = self::get_settings();
|
203 |
$new_settings = self::array_merge_recursive_distinct($old_settings, $array);
|
204 |
-
|
|
|
|
|
|
|
|
|
205 |
}
|
206 |
|
207 |
/**
|
@@ -331,32 +335,41 @@ class ShareaholicUtilities {
|
|
331 |
*/
|
332 |
public static function perform_update() {
|
333 |
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
|
|
|
|
|
|
338 |
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
|
350 |
-
|
351 |
-
|
352 |
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
}
|
358 |
-
|
359 |
-
// add other things that need to run on version change
|
360 |
}
|
361 |
|
362 |
/**
|
@@ -988,7 +1001,7 @@ class ShareaholicUtilities {
|
|
988 |
return false;
|
989 |
}
|
990 |
|
991 |
-
if (ShareaholicUtilities::has_accepted_terms_of_service() && ShareaholicUtilities::get_option('api_key')
|
992 |
if (in_array($post->post_status, array('draft', 'pending', 'auto-draft'))) {
|
993 |
// Get the correct permalink for a draft
|
994 |
$my_post = clone $post;
|
@@ -1007,6 +1020,7 @@ class ShareaholicUtilities {
|
|
1007 |
array ('force' => true)
|
1008 |
)
|
1009 |
);
|
|
|
1010 |
$response = ShareaholicCurl::post($cm_single_page_job_url, $payload, 'json');
|
1011 |
}
|
1012 |
}
|
@@ -1027,6 +1041,7 @@ class ShareaholicUtilities {
|
|
1027 |
array ('force' => true)
|
1028 |
)
|
1029 |
);
|
|
|
1030 |
$response = ShareaholicCurl::post($cm_sitemap_job_url, $payload, 'json');
|
1031 |
}
|
1032 |
|
@@ -1048,6 +1063,7 @@ class ShareaholicUtilities {
|
|
1048 |
array ('force' => true)
|
1049 |
)
|
1050 |
);
|
|
|
1051 |
$response = ShareaholicCurl::post($cm_single_domain_job_url, $payload, 'json');
|
1052 |
}
|
1053 |
}
|
@@ -1095,6 +1111,24 @@ class ShareaholicUtilities {
|
|
1095 |
|
1096 |
$response = ShareaholicCurl::post($event_api_url, $event_params, '', true);
|
1097 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1098 |
|
1099 |
/**
|
1100 |
* This loads the locales
|
@@ -1378,14 +1412,13 @@ class ShareaholicUtilities {
|
|
1378 |
* Call the content manager for a post before it is updated
|
1379 |
*
|
1380 |
* We do this because a user may change their permalink
|
1381 |
-
* and so we tell CM that the old permalink is
|
1382 |
*
|
1383 |
*/
|
1384 |
public static function before_post_is_updated($post_id) {
|
1385 |
ShareaholicUtilities::notify_content_manager_singlepage(get_post($post_id));
|
1386 |
}
|
1387 |
|
1388 |
-
|
1389 |
public static function user_info() {
|
1390 |
$current_user = wp_get_current_user();
|
1391 |
|
187 |
*
|
188 |
* @return mixed
|
189 |
*/
|
190 |
+
public static function get_option($option) {
|
191 |
$settings = self::get_settings();
|
192 |
return (isset($settings[$option]) ? $settings[$option] : array());
|
193 |
}
|
201 |
public static function update_options($array) {
|
202 |
$old_settings = self::get_settings();
|
203 |
$new_settings = self::array_merge_recursive_distinct($old_settings, $array);
|
204 |
+
|
205 |
+
if (function_exists('wp_cache_delete')) {
|
206 |
+
wp_cache_delete('shareaholic_settings');
|
207 |
+
}
|
208 |
+
update_option('shareaholic_settings', $new_settings, false);
|
209 |
}
|
210 |
|
211 |
/**
|
335 |
*/
|
336 |
public static function perform_update() {
|
337 |
|
338 |
+
if (!self::is_locked('perform_update')) {
|
339 |
+
self::set_lock('perform_update');
|
340 |
+
|
341 |
+
// Upgrade v6 users
|
342 |
+
if (self::get_version() && intval(self::get_version()) <= 6) {
|
343 |
+
ShareaholicSixToSeven::update();
|
344 |
+
}
|
345 |
|
346 |
+
// Re-acquire site content. Important: Run ONLY if API KEY is set
|
347 |
+
if (ShareaholicUtilities::has_accepted_terms_of_service() && !empty(ShareaholicUtilities::get_option('api_key'))) {
|
348 |
+
ShareaholicUtilities::notify_content_manager_sitemap();
|
349 |
+
ShareaholicUtilities::notify_content_manager_singledomain();
|
350 |
+
}
|
351 |
|
352 |
+
// Check for SS Share Counts API connectivity
|
353 |
+
if (has_action('wp_ajax_nopriv_shareaholic_share_counts_api') && has_action('wp_ajax_shareaholic_share_counts_api')) {
|
354 |
+
ShareaholicUtilities::share_counts_api_connectivity_check();
|
355 |
+
}
|
356 |
|
357 |
+
// Activate Shareaholic Cron job
|
358 |
+
ShareaholicCron::activate();
|
359 |
|
360 |
+
// Clear site cache
|
361 |
+
$version = ShareaholicUtilities::get_version();
|
362 |
+
if (!empty($version)){
|
363 |
+
ShareaholicUtilities::clear_cache();
|
364 |
+
}
|
365 |
+
|
366 |
+
// add other things that need to run on version change here
|
367 |
+
|
368 |
+
self::unlock('perform_update');
|
369 |
+
} else {
|
370 |
+
usleep(100000);
|
371 |
+
self::perform_update();
|
372 |
}
|
|
|
|
|
373 |
}
|
374 |
|
375 |
/**
|
1001 |
return false;
|
1002 |
}
|
1003 |
|
1004 |
+
if (ShareaholicUtilities::has_accepted_terms_of_service() && !empty(ShareaholicUtilities::get_option('api_key'))) {
|
1005 |
if (in_array($post->post_status, array('draft', 'pending', 'auto-draft'))) {
|
1006 |
// Get the correct permalink for a draft
|
1007 |
$my_post = clone $post;
|
1020 |
array ('force' => true)
|
1021 |
)
|
1022 |
);
|
1023 |
+
|
1024 |
$response = ShareaholicCurl::post($cm_single_page_job_url, $payload, 'json');
|
1025 |
}
|
1026 |
}
|
1041 |
array ('force' => true)
|
1042 |
)
|
1043 |
);
|
1044 |
+
|
1045 |
$response = ShareaholicCurl::post($cm_sitemap_job_url, $payload, 'json');
|
1046 |
}
|
1047 |
|
1063 |
array ('force' => true)
|
1064 |
)
|
1065 |
);
|
1066 |
+
|
1067 |
$response = ShareaholicCurl::post($cm_single_domain_job_url, $payload, 'json');
|
1068 |
}
|
1069 |
}
|
1111 |
|
1112 |
$response = ShareaholicCurl::post($event_api_url, $event_params, '', true);
|
1113 |
}
|
1114 |
+
|
1115 |
+
/**
|
1116 |
+
* Deletes the api key
|
1117 |
+
*
|
1118 |
+
*/
|
1119 |
+
public static function delete_api_key () {
|
1120 |
+
$payload = array(
|
1121 |
+
'site_id' => self::get_option('api_key'),
|
1122 |
+
'verification_key' => self::get_option('verification_key')
|
1123 |
+
);
|
1124 |
+
|
1125 |
+
$response = ShareaholicCurl::post(
|
1126 |
+
Shareaholic::API_URL . '/integrations/plugin/delete',
|
1127 |
+
$payload,
|
1128 |
+
'json',
|
1129 |
+
true
|
1130 |
+
);
|
1131 |
+
}
|
1132 |
|
1133 |
/**
|
1134 |
* This loads the locales
|
1412 |
* Call the content manager for a post before it is updated
|
1413 |
*
|
1414 |
* We do this because a user may change their permalink
|
1415 |
+
* and so we tell CM that the old permalink is no longer valid
|
1416 |
*
|
1417 |
*/
|
1418 |
public static function before_post_is_updated($post_id) {
|
1419 |
ShareaholicUtilities::notify_content_manager_singlepage(get_post($post_id));
|
1420 |
}
|
1421 |
|
|
|
1422 |
public static function user_info() {
|
1423 |
$current_user = wp_get_current_user();
|
1424 |
|