Version Description
We update this plugin regularly so we can make it better for you. Update to the latest version for all of the available features and improvements. Thanks for using Shareaholic!
Download this release
Release Info
Developer | shareaholic |
Plugin | WordPress Social Tools, Related Posts, Monetization – Shareaholic |
Version | 8.13.9 |
Comparing to | |
See all releases |
Code changes from version 8.13.8 to 8.13.9
- admin.php +5 -4
- assets/css/common.css +64 -0
- assets/css/main.css +0 -57
- curl.php +1 -1
- public.php +6 -20
- readme.txt +9 -4
- shareaholic.php +27 -15
- templates/admin.php +2 -0
- utilities.php +36 -29
admin.php
CHANGED
@@ -149,7 +149,8 @@ class ShareaholicAdmin {
|
|
149 |
<br />
|
150 |
<a onClick="' . "shr_openWindowReload('https://wordpress.org/support/plugin/shareaholic/reviews/?rate=5#new-post', '$dismiss_forever_url')" . '" class="button button-primary">' . __('Ok, you deserve it', 'shareaholic') . '</a>
|
151 |
<a href="' . $dismiss_forlater_url . '">' . __('No, not good enough', 'shareaholic') . '</a>
|
152 |
-
<a href="' . $dismiss_forever_url . '">' . __('I already did', 'shareaholic') . '</a>
|
|
|
153 |
</p>
|
154 |
</div>';
|
155 |
}
|
@@ -244,7 +245,6 @@ JQUERY;
|
|
244 |
*
|
245 |
*/
|
246 |
public static function admin_header() {
|
247 |
-
ShareaholicUtilities::draw_meta_xua();
|
248 |
ShareaholicAdmin::include_remote_js();
|
249 |
}
|
250 |
|
@@ -410,6 +410,7 @@ JQUERY;
|
|
410 |
public static function enqueue_scripts() {
|
411 |
if (isset($_GET['page']) && preg_match('/shareaholic/', $_GET['page'])) {
|
412 |
wp_enqueue_style('shareaholic_bootstrap_css', plugins_url('assets/css/bootstrap.css', __FILE__), false, ShareaholicUtilities::get_version());
|
|
|
413 |
wp_enqueue_style('shareaholic_reveal_css', plugins_url('assets/css/reveal.css', __FILE__), false, ShareaholicUtilities::get_version());
|
414 |
wp_enqueue_style('shareaholic_main_css', plugins_url('assets/css/main.css', __FILE__), false, ShareaholicUtilities::get_version());
|
415 |
wp_enqueue_script('shareholic_bootstrap_js', plugins_url('assets/js/bootstrap.min.js', __FILE__), false, ShareaholicUtilities::get_version());
|
@@ -554,7 +555,7 @@ JQUERY;
|
|
554 |
}
|
555 |
|
556 |
/**
|
557 |
-
* The function for the
|
558 |
*/
|
559 |
public static function admin() {
|
560 |
|
@@ -805,7 +806,7 @@ JQUERY;
|
|
805 |
public static function admin_notices() {
|
806 |
$current_screen = get_current_screen();
|
807 |
|
808 |
-
if ($current_screen->id === 'options-permalink'
|
809 |
$css_class = 'notice notice-warning is-dismissible';
|
810 |
$message = 'WARNING: Updating your URL or permalink structure will reset the social share counts for your pages. <a href="https://www.shareaholic.com/plans">Upgrade Shareaholic</a> to enable <a href="https://support.shareaholic.com/hc/en-us/articles/115002083586">Share Count Recovery</a>.';
|
811 |
echo "<div class='$css_class'><p style='font-weight: bold;'>";
|
149 |
<br />
|
150 |
<a onClick="' . "shr_openWindowReload('https://wordpress.org/support/plugin/shareaholic/reviews/?rate=5#new-post', '$dismiss_forever_url')" . '" class="button button-primary">' . __('Ok, you deserve it', 'shareaholic') . '</a>
|
151 |
<a href="' . $dismiss_forlater_url . '">' . __('No, not good enough', 'shareaholic') . '</a>
|
152 |
+
<a href="' . $dismiss_forever_url . '">' . __('I already did', 'shareaholic') . '</a>
|
153 |
+
<a href="' . $dismiss_forever_url . '">' . __('Dismiss', 'yarpp') . '</a>
|
154 |
</p>
|
155 |
</div>';
|
156 |
}
|
245 |
*
|
246 |
*/
|
247 |
public static function admin_header() {
|
|
|
248 |
ShareaholicAdmin::include_remote_js();
|
249 |
}
|
250 |
|
410 |
public static function enqueue_scripts() {
|
411 |
if (isset($_GET['page']) && preg_match('/shareaholic/', $_GET['page'])) {
|
412 |
wp_enqueue_style('shareaholic_bootstrap_css', plugins_url('assets/css/bootstrap.css', __FILE__), false, ShareaholicUtilities::get_version());
|
413 |
+
wp_enqueue_style('shareaholic_common_css', plugins_url('assets/css/common.css', __FILE__), false, ShareaholicUtilities::get_version());
|
414 |
wp_enqueue_style('shareaholic_reveal_css', plugins_url('assets/css/reveal.css', __FILE__), false, ShareaholicUtilities::get_version());
|
415 |
wp_enqueue_style('shareaholic_main_css', plugins_url('assets/css/main.css', __FILE__), false, ShareaholicUtilities::get_version());
|
416 |
wp_enqueue_script('shareholic_bootstrap_js', plugins_url('assets/js/bootstrap.min.js', __FILE__), false, ShareaholicUtilities::get_version());
|
555 |
}
|
556 |
|
557 |
/**
|
558 |
+
* The function for the App Manager Tab
|
559 |
*/
|
560 |
public static function admin() {
|
561 |
|
806 |
public static function admin_notices() {
|
807 |
$current_screen = get_current_screen();
|
808 |
|
809 |
+
if ($current_screen->id === 'options-permalink') {
|
810 |
$css_class = 'notice notice-warning is-dismissible';
|
811 |
$message = 'WARNING: Updating your URL or permalink structure will reset the social share counts for your pages. <a href="https://www.shareaholic.com/plans">Upgrade Shareaholic</a> to enable <a href="https://support.shareaholic.com/hc/en-us/articles/115002083586">Share Count Recovery</a>.';
|
812 |
echo "<div class='$css_class'><p style='font-weight: bold;'>";
|
assets/css/common.css
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.btn-warning {
|
2 |
+
color: #fff !important;
|
3 |
+
}
|
4 |
+
|
5 |
+
.button-primary {
|
6 |
+
color: #fff !important;
|
7 |
+
}
|
8 |
+
|
9 |
+
.shareaholic-settings-h2 {
|
10 |
+
padding: 0 !important;
|
11 |
+
}
|
12 |
+
|
13 |
+
/* Header */
|
14 |
+
#shr-header {
|
15 |
+
position: initial !important;
|
16 |
+
z-index: auto !important;
|
17 |
+
margin-left: -20px !important;
|
18 |
+
width: auto !important;
|
19 |
+
}
|
20 |
+
|
21 |
+
#shr-header .shr-header-content {
|
22 |
+
max-width: 100% !important;
|
23 |
+
margin: 0 0 0 20px !important;
|
24 |
+
}
|
25 |
+
|
26 |
+
.shr-mobile {
|
27 |
+
z-index: 2147483647 !important;
|
28 |
+
}
|
29 |
+
|
30 |
+
#shr-header .shr-nav-2 .shr-user-menu {
|
31 |
+
z-index: 2147483647 !important;
|
32 |
+
}
|
33 |
+
|
34 |
+
#shr-header .shr-sites-container {
|
35 |
+
z-index: 2147483647 !important;
|
36 |
+
}
|
37 |
+
|
38 |
+
#shr-header .shr-nav-2 .shr-signup-login {
|
39 |
+
margin-right: 2em !important;
|
40 |
+
}
|
41 |
+
|
42 |
+
#shr-header .shr-nav-2 .shr-profile {
|
43 |
+
margin-right: 15px !important;
|
44 |
+
}
|
45 |
+
|
46 |
+
/* End Header */
|
47 |
+
|
48 |
+
/* Hides WP Nag Screen */
|
49 |
+
#update-nag, .update-nag {
|
50 |
+
display: none !important;
|
51 |
+
}
|
52 |
+
|
53 |
+
/*** Hides notice pollution from other plugins ***/
|
54 |
+
.notice {
|
55 |
+
display: none !important;
|
56 |
+
}
|
57 |
+
.error {
|
58 |
+
display: none !important;
|
59 |
+
}
|
60 |
+
/* ensure Shareaholic notices show */
|
61 |
+
.notice.notice-info.is-dismissible.shareaholic-review-notice {
|
62 |
+
display: block !important;
|
63 |
+
}
|
64 |
+
/*** Hides notice pollution ***/
|
assets/css/main.css
CHANGED
@@ -12,63 +12,6 @@ body {
|
|
12 |
text-decoration: none;
|
13 |
}
|
14 |
|
15 |
-
/* Hides WP Nag Screen */
|
16 |
-
#update-nag, .update-nag {
|
17 |
-
display: none !important;
|
18 |
-
}
|
19 |
-
|
20 |
-
/*** Hides notice pollution from other plugins ***/
|
21 |
-
.notice {
|
22 |
-
display: none !important;
|
23 |
-
}
|
24 |
-
.error {
|
25 |
-
display: none !important;
|
26 |
-
}
|
27 |
-
/* ensure Shareaholic notices show */
|
28 |
-
.notice.notice-info.shareaholic-notice {
|
29 |
-
display: block !important;
|
30 |
-
}
|
31 |
-
/*** Hides notice pollution ***/
|
32 |
-
|
33 |
-
.btn-warning {
|
34 |
-
color: #fff !important;
|
35 |
-
}
|
36 |
-
|
37 |
-
/* Header */
|
38 |
-
#shr-header {
|
39 |
-
position: initial !important;
|
40 |
-
z-index: auto !important;
|
41 |
-
margin-left: -20px !important;
|
42 |
-
width: auto !important;
|
43 |
-
}
|
44 |
-
|
45 |
-
#shr-header .shr-header-content {
|
46 |
-
max-width: 100% !important;
|
47 |
-
margin: 0 0 0 20px !important;
|
48 |
-
}
|
49 |
-
|
50 |
-
.shr-mobile {
|
51 |
-
z-index: 2147483647 !important;
|
52 |
-
}
|
53 |
-
|
54 |
-
#shr-header .shr-nav-2 .shr-user-menu {
|
55 |
-
z-index: 2147483647 !important;
|
56 |
-
}
|
57 |
-
|
58 |
-
#shr-header .shr-sites-container {
|
59 |
-
z-index: 2147483647 !important;
|
60 |
-
}
|
61 |
-
|
62 |
-
#shr-header .shr-nav-2 .shr-signup-login {
|
63 |
-
margin-right: 2em !important;
|
64 |
-
}
|
65 |
-
|
66 |
-
#shr-header .shr-nav-2 .shr-profile {
|
67 |
-
margin-right: 15px !important;
|
68 |
-
}
|
69 |
-
|
70 |
-
/* End Header */
|
71 |
-
|
72 |
.container-fluid {
|
73 |
padding: 0px;
|
74 |
clear: both;
|
12 |
text-decoration: none;
|
13 |
}
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
.container-fluid {
|
16 |
padding: 0px;
|
17 |
clear: both;
|
curl.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* @package shareaholic
|
6 |
*/
|
7 |
|
8 |
-
require_once(
|
9 |
|
10 |
/**
|
11 |
* This class is a library to easily interface with PHP's native
|
5 |
* @package shareaholic
|
6 |
*/
|
7 |
|
8 |
+
require_once(SHAREAHOLIC_PATH . 'query_string_builder.php');
|
9 |
|
10 |
/**
|
11 |
* This class is a library to easily interface with PHP's native
|
public.php
CHANGED
@@ -6,10 +6,10 @@
|
|
6 |
*/
|
7 |
|
8 |
// Get the required libraries for the Share Counts API
|
9 |
-
require_once(
|
10 |
-
require_once(
|
11 |
-
require_once(
|
12 |
-
require_once(
|
13 |
|
14 |
/**
|
15 |
* This class is all about drawing the stuff in publishers'
|
@@ -19,13 +19,6 @@ require_once(SHAREAHOLIC_DIR . '/public_js.php');
|
|
19 |
*/
|
20 |
class ShareaholicPublic {
|
21 |
|
22 |
-
/**
|
23 |
-
* Loads before all else
|
24 |
-
*/
|
25 |
-
public static function init() {
|
26 |
-
add_filter('wp_headers', array('ShareaholicUtilities', 'add_header_xua'));
|
27 |
-
}
|
28 |
-
|
29 |
/**
|
30 |
* Loads before all else
|
31 |
*/
|
@@ -595,12 +588,6 @@ class ShareaholicPublic {
|
|
595 |
exit;
|
596 |
}
|
597 |
|
598 |
-
if (ShareaholicUtilities::get_option('disable_internal_share_counts_api') == NULL || ShareaholicUtilities::get_option('disable_internal_share_counts_api') == "off"){
|
599 |
-
$server_side_share_count_status = "on";
|
600 |
-
} else {
|
601 |
-
$server_side_share_count_status = "off";
|
602 |
-
}
|
603 |
-
|
604 |
if (ShareaholicUtilities::has_accepted_terms_of_service() == 1){
|
605 |
$tos_status = "accepted";
|
606 |
} else {
|
@@ -631,8 +618,7 @@ class ShareaholicPublic {
|
|
631 |
'version' => $curl_version,
|
632 |
),
|
633 |
'plugins' => array(
|
634 |
-
'active' =>
|
635 |
-
'sitewide' => get_site_option('active_sitewide_plugins', array()),
|
636 |
),
|
637 |
),
|
638 |
'app_locations' => array(
|
@@ -640,7 +626,7 @@ class ShareaholicPublic {
|
|
640 |
'recommendations' => ShareaholicUtilities::get_option('recommendations'),
|
641 |
),
|
642 |
'advanced_settings' => array(
|
643 |
-
'server_side_share_count_api' =>
|
644 |
'facebook_access_token' => ShareaholicUtilities::fetch_fb_access_token() === false ? 'no' : 'yes',
|
645 |
'facebook_auth_check' => ShareaholicUtilities::facebook_auth_check(),
|
646 |
'enable_user_nicename' => ShareaholicUtilities::get_option('enable_user_nicename'),
|
6 |
*/
|
7 |
|
8 |
// Get the required libraries for the Share Counts API
|
9 |
+
require_once(SHAREAHOLIC_PATH . 'lib/social-share-counts/wordpress_http.php');
|
10 |
+
require_once(SHAREAHOLIC_PATH . 'lib/social-share-counts/seq_share_count.php');
|
11 |
+
require_once(SHAREAHOLIC_PATH . 'lib/social-share-counts/curl_multi_share_count.php');
|
12 |
+
require_once(SHAREAHOLIC_PATH . 'public_js.php');
|
13 |
|
14 |
/**
|
15 |
* This class is all about drawing the stuff in publishers'
|
19 |
*/
|
20 |
class ShareaholicPublic {
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
/**
|
23 |
* Loads before all else
|
24 |
*/
|
588 |
exit;
|
589 |
}
|
590 |
|
|
|
|
|
|
|
|
|
|
|
|
|
591 |
if (ShareaholicUtilities::has_accepted_terms_of_service() == 1){
|
592 |
$tos_status = "accepted";
|
593 |
} else {
|
618 |
'version' => $curl_version,
|
619 |
),
|
620 |
'plugins' => array(
|
621 |
+
'active' => ShareaholicUtilities::get_active_plugins(),
|
|
|
622 |
),
|
623 |
),
|
624 |
'app_locations' => array(
|
626 |
'recommendations' => ShareaholicUtilities::get_option('recommendations'),
|
627 |
),
|
628 |
'advanced_settings' => array(
|
629 |
+
'server_side_share_count_api' => ShareaholicUtilities::get_internal_share_counts_api_status(),
|
630 |
'facebook_access_token' => ShareaholicUtilities::fetch_fb_access_token() === false ? 'no' : 'yes',
|
631 |
'facebook_auth_check' => ShareaholicUtilities::facebook_auth_check(),
|
632 |
'enable_user_nicename' => ShareaholicUtilities::get_option('enable_user_nicename'),
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: social, social sharing, google analytics, pinterest, twitter, share butto
|
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 5.2
|
6 |
Requires PHP: 5.2
|
7 |
-
Stable tag: 8.13.
|
8 |
|
9 |
|
10 |
Boost Audience Engagement with Award Winning Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
|
@@ -297,10 +297,10 @@ If you want to prevent the Review Notice from appearing you can use the function
|
|
297 |
* Disable Shareaholic Review Notice
|
298 |
*
|
299 |
*/
|
300 |
-
function
|
301 |
remove_action('admin_notices', array('ShareaholicAdmin', 'display_review_notice'));
|
302 |
}
|
303 |
-
add_action('admin_init', '
|
304 |
`
|
305 |
|
306 |
= How can I change the thumbnail image size for Shareaholic Related Posts? =
|
@@ -310,6 +310,11 @@ The default Shareaholic thumbnail width is 640px with dynamic height and no crop
|
|
310 |
Each time you change Shareaholic's thumbnail dimensions like this, you will probably want to have WordPress regenerate appropriate sized thumbnails for all of your images. We highly recommend the [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) plugin for this purpose.
|
311 |
|
312 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
313 |
= 8.13.8 (2019-09-16) =
|
314 |
* Enhancement: Review Notice updates
|
315 |
* Enhancement: Advanced Option to disable the Review Notice for everyone
|
@@ -992,7 +997,7 @@ Each time you change Shareaholic's thumbnail dimensions like this, you will prob
|
|
992 |
* Show Related Posts data status
|
993 |
|
994 |
== Upgrade Notice ==
|
995 |
-
= 8.13.
|
996 |
We update this plugin regularly so we can make it better for you. Update to the latest version for all of the available features and improvements. Thanks for using Shareaholic!
|
997 |
|
998 |
= 8.12.1 =
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 5.2
|
6 |
Requires PHP: 5.2
|
7 |
+
Stable tag: 8.13.9
|
8 |
|
9 |
|
10 |
Boost Audience Engagement with Award Winning Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
|
297 |
* Disable Shareaholic Review Notice
|
298 |
*
|
299 |
*/
|
300 |
+
function shareaholic_disable_review_notice() {
|
301 |
remove_action('admin_notices', array('ShareaholicAdmin', 'display_review_notice'));
|
302 |
}
|
303 |
+
add_action('admin_init', 'shareaholic_disable_review_notice', 11);
|
304 |
`
|
305 |
|
306 |
= How can I change the thumbnail image size for Shareaholic Related Posts? =
|
310 |
Each time you change Shareaholic's thumbnail dimensions like this, you will probably want to have WordPress regenerate appropriate sized thumbnails for all of your images. We highly recommend the [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) plugin for this purpose.
|
311 |
|
312 |
== Changelog ==
|
313 |
+
= 8.13.9 (2019-09-19) =
|
314 |
+
* Enhancement: Removed < IE10 specific compatibility code
|
315 |
+
* Bugfix: Various fixes to Content Syncing
|
316 |
+
* Bugfix: Fixed notice placement on App Manager page
|
317 |
+
|
318 |
= 8.13.8 (2019-09-16) =
|
319 |
* Enhancement: Review Notice updates
|
320 |
* Enhancement: Advanced Option to disable the Review Notice for everyone
|
997 |
* Show Related Posts data status
|
998 |
|
999 |
== Upgrade Notice ==
|
1000 |
+
= 8.13.9 =
|
1001 |
We update this plugin regularly so we can make it better for you. Update to the latest version for all of the available features and improvements. Thanks for using Shareaholic!
|
1002 |
|
1003 |
= 8.12.1 =
|
shareaholic.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Shareaholic - Grow and Engage Your Audience
|
4 |
Plugin URI: https://www.shareaholic.com/website-tools/
|
5 |
Description: Shareaholic’s official WordPress plugin allows you to add Award-Winning Social Share Buttons, Related Posts, Content Analytics, Ad Monetization, and more to your website.
|
6 |
-
Version: 8.13.
|
7 |
Author: Shareaholic
|
8 |
Author URI: https://www.shareaholic.com
|
9 |
Text Domain: shareaholic
|
@@ -14,7 +14,7 @@ Domain Path: /languages
|
|
14 |
* The main file!
|
15 |
*
|
16 |
* @package shareaholic
|
17 |
-
* @version 8.13.
|
18 |
*/
|
19 |
|
20 |
/**
|
@@ -31,21 +31,34 @@ Domain Path: /languages
|
|
31 |
* error_reporting(E_ALL ^ E_NOTICE);
|
32 |
*/
|
33 |
|
34 |
-
if(!defined('
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
// Caching
|
38 |
-
if(!defined('SHARE_COUNTS_CHECK_CACHE_LENGTH'))
|
|
|
|
|
39 |
|
40 |
// because define can use function returns and const can't
|
41 |
-
if(!defined('SHAREAHOLIC_DEBUG'))
|
|
|
|
|
42 |
|
43 |
-
require_once(
|
44 |
-
require_once(
|
45 |
-
require_once(
|
46 |
-
require_once(
|
47 |
-
require_once(
|
48 |
-
require_once(
|
49 |
|
50 |
if (!class_exists('Shareaholic')) {
|
51 |
/**
|
@@ -59,7 +72,7 @@ if (!class_exists('Shareaholic')) {
|
|
59 |
const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
|
60 |
const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
|
61 |
|
62 |
-
const VERSION = '8.13.
|
63 |
|
64 |
/**
|
65 |
* Starts off as false so that ::get_instance() returns
|
@@ -97,7 +110,6 @@ if (!class_exists('Shareaholic')) {
|
|
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('wp_loaded', array('ShareaholicPublic', 'init'));
|
101 |
add_action('after_setup_theme', array('ShareaholicPublic', 'after_setup_theme'));
|
102 |
|
103 |
add_action('pre_get_posts', array($this, 'shareaholic_draw_canvas'));
|
@@ -276,7 +288,7 @@ if (!class_exists('Shareaholic')) {
|
|
276 |
/**
|
277 |
* This function fires when the plugin is uninstalled.
|
278 |
*/
|
279 |
-
public function uninstall() {
|
280 |
ShareaholicUtilities::log_event("Uninstall");
|
281 |
delete_option('shareaholic_has_accepted_tos');
|
282 |
delete_option('shareaholic_settings');
|
3 |
Plugin Name: Shareaholic - Grow and Engage Your Audience
|
4 |
Plugin URI: https://www.shareaholic.com/website-tools/
|
5 |
Description: Shareaholic’s official WordPress plugin allows you to add Award-Winning Social Share Buttons, Related Posts, Content Analytics, Ad Monetization, and more to your website.
|
6 |
+
Version: 8.13.9
|
7 |
Author: Shareaholic
|
8 |
Author URI: https://www.shareaholic.com
|
9 |
Text Domain: shareaholic
|
14 |
* The main file!
|
15 |
*
|
16 |
* @package shareaholic
|
17 |
+
* @version 8.13.9
|
18 |
*/
|
19 |
|
20 |
/**
|
31 |
* error_reporting(E_ALL ^ E_NOTICE);
|
32 |
*/
|
33 |
|
34 |
+
if (!defined('SHAREAHOLIC_FILE')) {
|
35 |
+
define('SHAREAHOLIC_FILE', __FILE__);
|
36 |
+
}
|
37 |
+
|
38 |
+
if (!defined('SHAREAHOLIC_PATH')) {
|
39 |
+
define('SHAREAHOLIC_PATH', plugin_dir_path(SHAREAHOLIC_FILE));
|
40 |
+
}
|
41 |
+
|
42 |
+
if(!defined('SHAREAHOLIC_ASSET_DIR')) {
|
43 |
+
define('SHAREAHOLIC_ASSET_DIR', plugins_url( '/assets/' , __FILE__ ));
|
44 |
+
}
|
45 |
|
46 |
// Caching
|
47 |
+
if(!defined('SHARE_COUNTS_CHECK_CACHE_LENGTH')) {
|
48 |
+
define( 'SHARE_COUNTS_CHECK_CACHE_LENGTH', 900 ); // 900 seconds
|
49 |
+
}
|
50 |
|
51 |
// because define can use function returns and const can't
|
52 |
+
if(!defined('SHAREAHOLIC_DEBUG')) {
|
53 |
+
define('SHAREAHOLIC_DEBUG', getenv('SHAREAHOLIC_DEBUG'));
|
54 |
+
}
|
55 |
|
56 |
+
require_once(SHAREAHOLIC_PATH . 'utilities.php');
|
57 |
+
require_once(SHAREAHOLIC_PATH . 'global_functions.php');
|
58 |
+
require_once(SHAREAHOLIC_PATH . 'admin.php');
|
59 |
+
require_once(SHAREAHOLIC_PATH . 'public.php');
|
60 |
+
require_once(SHAREAHOLIC_PATH . 'notifier.php');
|
61 |
+
require_once(SHAREAHOLIC_PATH . 'cron.php');
|
62 |
|
63 |
if (!class_exists('Shareaholic')) {
|
64 |
/**
|
72 |
const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
|
73 |
const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
|
74 |
|
75 |
+
const VERSION = '8.13.9';
|
76 |
|
77 |
/**
|
78 |
* Starts off as false so that ::get_instance() returns
|
110 |
add_action('wp_ajax_nopriv_shareaholic_permalink_related', array('ShareaholicPublic', 'permalink_related'));
|
111 |
add_action('wp_ajax_shareaholic_permalink_related', array('ShareaholicPublic', 'permalink_related'));
|
112 |
|
|
|
113 |
add_action('after_setup_theme', array('ShareaholicPublic', 'after_setup_theme'));
|
114 |
|
115 |
add_action('pre_get_posts', array($this, 'shareaholic_draw_canvas'));
|
288 |
/**
|
289 |
* This function fires when the plugin is uninstalled.
|
290 |
*/
|
291 |
+
public static function uninstall() {
|
292 |
ShareaholicUtilities::log_event("Uninstall");
|
293 |
delete_option('shareaholic_has_accepted_tos');
|
294 |
delete_option('shareaholic_settings');
|
templates/admin.php
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
<?php ShareaholicAdmin::show_header(); ?>
|
4 |
|
5 |
<div class='wrap'>
|
|
|
|
|
6 |
<script>
|
7 |
window.ShareaholicConfig = {
|
8 |
apiKey: "<?php echo $api_key ?>",
|
3 |
<?php ShareaholicAdmin::show_header(); ?>
|
4 |
|
5 |
<div class='wrap'>
|
6 |
+
<!-- h2 tag needed for WP to know where to place notices -->
|
7 |
+
<h2 class="shareaholic-settings-h2"></h2>
|
8 |
<script>
|
9 |
window.ShareaholicConfig = {
|
10 |
apiKey: "<?php echo $api_key ?>",
|
utilities.php
CHANGED
@@ -5,9 +5,9 @@
|
|
5 |
* @package shareaholic
|
6 |
*/
|
7 |
|
8 |
-
require_once(
|
9 |
-
require_once(
|
10 |
-
require_once(
|
11 |
|
12 |
/**
|
13 |
* This class is just a holder for general functions that have
|
@@ -660,6 +660,34 @@ class ShareaholicUtilities {
|
|
660 |
return (isset($stats) ? $stats : array());
|
661 |
}
|
662 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
663 |
/**
|
664 |
* Returns the api key or creates a new one.
|
665 |
*
|
@@ -1119,7 +1147,7 @@ class ShareaholicUtilities {
|
|
1119 |
/**
|
1120 |
* This is a wrapper for the Heartbeat API
|
1121 |
*
|
1122 |
-
*/
|
1123 |
public static function heartbeat() {
|
1124 |
$data = array(
|
1125 |
'platform' => 'wordpress',
|
@@ -1139,15 +1167,14 @@ class ShareaholicUtilities {
|
|
1139 |
'theme' => get_option('template'),
|
1140 |
'multisite' => is_multisite(),
|
1141 |
'plugins' => array(
|
1142 |
-
'active' =>
|
1143 |
-
'sitewide' => get_site_option('active_sitewide_plugins', array()),
|
1144 |
),
|
1145 |
),
|
1146 |
'endpoints' => array(
|
1147 |
'ajax_url' => admin_url('admin-ajax.php')
|
1148 |
),
|
1149 |
'advanced_settings' => array(
|
1150 |
-
'server_side_share_count_api' =>
|
1151 |
'facebook_access_token' => ShareaholicUtilities::fetch_fb_access_token() === false ? 'no' : 'yes',
|
1152 |
'facebook_auth_check' => ShareaholicUtilities::facebook_auth_check(),
|
1153 |
'enable_user_nicename' => ShareaholicUtilities::get_option('enable_user_nicename'),
|
@@ -1158,8 +1185,8 @@ class ShareaholicUtilities {
|
|
1158 |
),
|
1159 |
);
|
1160 |
|
1161 |
-
$
|
1162 |
-
$response = ShareaholicCurl::post($
|
1163 |
}
|
1164 |
|
1165 |
/**
|
@@ -1187,26 +1214,6 @@ class ShareaholicUtilities {
|
|
1187 |
public static function localize() {
|
1188 |
load_plugin_textdomain('shareaholic', false, basename(dirname(__FILE__)) . '/languages/');
|
1189 |
}
|
1190 |
-
|
1191 |
-
/*
|
1192 |
-
* Adds a xua response header
|
1193 |
-
*
|
1194 |
-
* @return array Where header => header value
|
1195 |
-
*/
|
1196 |
-
public static function add_header_xua($headers) {
|
1197 |
-
if(!isset($headers['X-UA-Compatible'])) {
|
1198 |
-
$headers['X-UA-Compatible'] = 'IE=edge';
|
1199 |
-
}
|
1200 |
-
return $headers;
|
1201 |
-
}
|
1202 |
-
|
1203 |
-
/*
|
1204 |
-
* Draws xua meta tag
|
1205 |
-
*
|
1206 |
-
*/
|
1207 |
-
public static function draw_meta_xua() {
|
1208 |
-
echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
|
1209 |
-
}
|
1210 |
|
1211 |
/**
|
1212 |
* Function to return a list of permalink keywords
|
5 |
* @package shareaholic
|
6 |
*/
|
7 |
|
8 |
+
require_once(SHAREAHOLIC_PATH . 'curl.php');
|
9 |
+
require_once(SHAREAHOLIC_PATH . 'six_to_seven.php');
|
10 |
+
require_once(SHAREAHOLIC_PATH . 'lib/social-share-counts/seq_share_count.php');
|
11 |
|
12 |
/**
|
13 |
* This class is just a holder for general functions that have
|
660 |
return (isset($stats) ? $stats : array());
|
661 |
}
|
662 |
|
663 |
+
/**
|
664 |
+
* Returns Active Plugins
|
665 |
+
*
|
666 |
+
*/
|
667 |
+
public static function get_active_plugins() {
|
668 |
+
$plugins = get_option('active_plugins', array());
|
669 |
+
|
670 |
+
if (is_multisite()) {
|
671 |
+
$network_plugins = (array) get_site_option('active_sitewide_plugins', array());
|
672 |
+
$plugins = array_merge($plugins, array_keys($network_plugins));
|
673 |
+
}
|
674 |
+
|
675 |
+
return (isset($plugins) ? array_unique($plugins) : array());
|
676 |
+
}
|
677 |
+
|
678 |
+
/**
|
679 |
+
* Returns Local Share Count Proxy Status
|
680 |
+
*
|
681 |
+
*/
|
682 |
+
public static function get_internal_share_counts_api_status() {
|
683 |
+
if (ShareaholicUtilities::get_option('disable_internal_share_counts_api') == NULL || ShareaholicUtilities::get_option('disable_internal_share_counts_api') == "off"){
|
684 |
+
$server_side_share_count_status = "on";
|
685 |
+
} else {
|
686 |
+
$server_side_share_count_status = "off";
|
687 |
+
}
|
688 |
+
return $server_side_share_count_status;
|
689 |
+
}
|
690 |
+
|
691 |
/**
|
692 |
* Returns the api key or creates a new one.
|
693 |
*
|
1147 |
/**
|
1148 |
* This is a wrapper for the Heartbeat API
|
1149 |
*
|
1150 |
+
*/
|
1151 |
public static function heartbeat() {
|
1152 |
$data = array(
|
1153 |
'platform' => 'wordpress',
|
1167 |
'theme' => get_option('template'),
|
1168 |
'multisite' => is_multisite(),
|
1169 |
'plugins' => array(
|
1170 |
+
'active' => ShareaholicUtilities::get_active_plugins(),
|
|
|
1171 |
),
|
1172 |
),
|
1173 |
'endpoints' => array(
|
1174 |
'ajax_url' => admin_url('admin-ajax.php')
|
1175 |
),
|
1176 |
'advanced_settings' => array(
|
1177 |
+
'server_side_share_count_api' => ShareaholicUtilities::get_internal_share_counts_api_status(),
|
1178 |
'facebook_access_token' => ShareaholicUtilities::fetch_fb_access_token() === false ? 'no' : 'yes',
|
1179 |
'facebook_auth_check' => ShareaholicUtilities::facebook_auth_check(),
|
1180 |
'enable_user_nicename' => ShareaholicUtilities::get_option('enable_user_nicename'),
|
1185 |
),
|
1186 |
);
|
1187 |
|
1188 |
+
$heartbeat_api_url = Shareaholic::API_URL . '/api/plugin_heartbeats';
|
1189 |
+
$response = ShareaholicCurl::post($heartbeat_api_url, $data, 'json', true, 2);
|
1190 |
}
|
1191 |
|
1192 |
/**
|
1214 |
public static function localize() {
|
1215 |
load_plugin_textdomain('shareaholic', false, basename(dirname(__FILE__)) . '/languages/');
|
1216 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1217 |
|
1218 |
/**
|
1219 |
* Function to return a list of permalink keywords
|