WordPress Social Tools, Related Posts, Monetization – Shareaholic - Version 8.13.7

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 Icon 128x128 WordPress Social Tools, Related Posts, Monetization – Shareaholic
Version 8.13.7
Comparing to
See all releases

Code changes from version 8.13.6 to 8.13.7

admin.php CHANGED
@@ -14,7 +14,7 @@ class ShareaholicAdmin {
14
 
15
  const ACTIVATE_TIMESTAMP_OPTION = 'shareaholic_activate_timestamp';
16
  const REVIEW_DISMISS_OPTION = 'shareaholic_review_notice';
17
- const REVIEW_FIRST_PERIOD = 259200; // 3 days in seconds
18
  const REVIEW_LATER_PERIOD = 5184000; // 60 days in seconds
19
  const REVIEW_FOREVER_PERIOD = 63113904; // 2 years in seconds
20
 
@@ -48,7 +48,7 @@ class ShareaholicAdmin {
48
  $user_id = $current_user->ID;
49
 
50
  if (!is_admin() ||
51
- !current_user_can('manage_options') ||
52
  !isset($_GET['_wpnonce']) ||
53
  !wp_verify_nonce($_GET['_wpnonce'], 'review-nonce') ||
54
  !isset($_GET['shr_defer_t']) ||
@@ -110,12 +110,34 @@ class ShareaholicAdmin {
110
  $dismiss_forlater_url = wp_nonce_url($dismiss_forlater, 'review-nonce');
111
 
112
  echo '
113
- <div class="notice notice-info shareaholic-notice" style="background-size: contain; background-position: right bottom; background-repeat: no-repeat; background-image: url(' . plugins_url('assets/img/happy-people-cover.png', __FILE__) . ');">
114
- <p style="background: rgba(255, 255, 255, 0.85); text-shadow: white 0px 0px 10px;">' . __('Hey there! We noticed that you have had some success using ', 'shareaholic') . '<a href="' . admin_url('admin.php?page=shareaholic-settings') . '">Shareaholic</a>' . __(' — awesome! Could you please do us a BIG favor and give us a quick 5-star rating on WordPress? Just to help us spread the word and boost our motivation. We would really appreciate it 🙂 ~ Your friends @ Shareaholic', 'shareaholic') . '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  <br />
116
  <br />
117
  <a onclick="location.href=\'' . $dismiss_forever_url . '\';" class="button button-primary" href="' . esc_url('https://wordpress.org/support/plugin/shareaholic/reviews/?rate=5#new-post') . '" target="_blank">' . __('Ok, you deserve it', 'shareaholic') . '</a> &nbsp;
118
- <a href="' . $dismiss_forlater_url . '">' . __('No, maybe later', 'shareaholic') . '</a> &nbsp;
119
  <a href="' . $dismiss_forever_url . '">' . __('I already did', 'shareaholic') . '</a>
120
  </p>
121
  </div>';
@@ -418,8 +440,8 @@ JQUERY;
418
  );
419
  add_submenu_page(
420
  'shareaholic-settings',
421
- __('App Manager [beta]', 'shareaholic'),
422
- __('App Manager [beta]', 'shareaholic'),
423
  'manage_options',
424
  'shareaholic-settings',
425
  array('ShareaholicAdmin', 'admin')
14
 
15
  const ACTIVATE_TIMESTAMP_OPTION = 'shareaholic_activate_timestamp';
16
  const REVIEW_DISMISS_OPTION = 'shareaholic_review_notice';
17
+ const REVIEW_FIRST_PERIOD = 432000; // 5 days in seconds
18
  const REVIEW_LATER_PERIOD = 5184000; // 60 days in seconds
19
  const REVIEW_FOREVER_PERIOD = 63113904; // 2 years in seconds
20
 
48
  $user_id = $current_user->ID;
49
 
50
  if (!is_admin() ||
51
+ !current_user_can('edit_posts') ||
52
  !isset($_GET['_wpnonce']) ||
53
  !wp_verify_nonce($_GET['_wpnonce'], 'review-nonce') ||
54
  !isset($_GET['shr_defer_t']) ||
110
  $dismiss_forlater_url = wp_nonce_url($dismiss_forlater, 'review-nonce');
111
 
112
  echo '
113
+ <style>
114
+ .shareaholic-review-notice {
115
+ background-size: contain; background-position: right bottom; background-repeat: no-repeat; background-image: url(' . plugins_url('assets/img/icon-256x256.png', __FILE__) . ');
116
+ }
117
+ .shareaholic-review-notice-text {
118
+ background: rgba(255, 255, 255, 0.9); text-shadow: white 0px 0px 10px; margin-right: 8em !important;
119
+ }
120
+
121
+ @media only screen and (max-width: 782px) {
122
+ .shareaholic-review-notice-text {
123
+ margin-right: 12em !important;
124
+ }
125
+ }
126
+ @media screen and (max-width: 580px) {
127
+ .shareaholic-review-notice {
128
+ background: #ffffff;
129
+ }
130
+ .shareaholic-review-notice-text {
131
+ margin-right: 0 !important;
132
+ }
133
+ }
134
+ </style>
135
+ <div class="notice notice-info is-dismissible shareaholic-review-notice">
136
+ <p class="shareaholic-review-notice-text">' . __('Hey there! We noticed that you have had success using ', 'shareaholic') . '<a href="' . admin_url('admin.php?page=shareaholic-settings') . '">Shareaholic</a>' . __(' — awesome! Could you please do us a BIG favor and give us a quick 5-star rating on WordPress? It would help us spread the word and boost our motivation. We would really appreciate it 🙂 ~ Your friends @ Shareaholic', 'shareaholic') . '
137
  <br />
138
  <br />
139
  <a onclick="location.href=\'' . $dismiss_forever_url . '\';" class="button button-primary" href="' . esc_url('https://wordpress.org/support/plugin/shareaholic/reviews/?rate=5#new-post') . '" target="_blank">' . __('Ok, you deserve it', 'shareaholic') . '</a> &nbsp;
140
+ <a class="button button-secondary" href="' . $dismiss_forlater_url . '">' . __('No, maybe later', 'shareaholic') . '</a> &nbsp;
141
  <a href="' . $dismiss_forever_url . '">' . __('I already did', 'shareaholic') . '</a>
142
  </p>
143
  </div>';
440
  );
441
  add_submenu_page(
442
  'shareaholic-settings',
443
+ __('App Manager', 'shareaholic'),
444
+ __('App Manager', 'shareaholic'),
445
  'manage_options',
446
  'shareaholic-settings',
447
  array('ShareaholicAdmin', 'admin')
assets/img/icon-256x256.png ADDED
Binary file
cron.php CHANGED
@@ -12,20 +12,30 @@
12
  */
13
  class ShareaholicCron {
14
 
15
- const TRANSIENT_SCHEDULE = 'hourly';
16
-
17
  /**
18
  * Schedules the cron jobs if it does not exist
19
  */
20
  public static function activate() {
 
 
21
  if (!wp_next_scheduled('shareaholic_remove_transients_hourly')) {
22
  // schedule the first occurrence 1 min from now
23
  wp_schedule_event(
24
- time() + 60, self::TRANSIENT_SCHEDULE, 'shareaholic_remove_transients_hourly'
 
 
 
 
 
 
 
 
 
 
25
  );
26
- ShareaholicUtilities::log('Shareaholic is now scheduled');
27
  } else {
28
- ShareaholicUtilities::log('Shareaholic is already scheduled');
29
  }
30
  }
31
 
@@ -35,12 +45,23 @@ class ShareaholicCron {
35
  public static function deactivate() {
36
  if (wp_next_scheduled('shareaholic_remove_transients_hourly')) {
37
  wp_clear_scheduled_hook('shareaholic_remove_transients_hourly');
38
- ShareaholicUtilities::log('Shareaholic schedule cleared');
 
 
 
 
 
 
 
39
  } else {
40
- ShareaholicUtilities::log('no need to clear nonexistent Shareaholic schedule');
41
  }
42
  }
43
 
 
 
 
 
44
  /**
45
  * A job that clears up the shareaholic share counts transients
46
  */
@@ -63,7 +84,7 @@ class ShareaholicCron {
63
  $result = $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name IN ({$options_names})");
64
 
65
  if (!$result) {
66
- ShareaholicUtilities::log('Transient Query Error!!!');
67
  }
68
  }
69
  // Cleanup leftover mutex
12
  */
13
  class ShareaholicCron {
14
 
 
 
15
  /**
16
  * Schedules the cron jobs if it does not exist
17
  */
18
  public static function activate() {
19
+
20
+ // Transient Cleanup
21
  if (!wp_next_scheduled('shareaholic_remove_transients_hourly')) {
22
  // schedule the first occurrence 1 min from now
23
  wp_schedule_event(
24
+ time() + 60, 'hourly', 'shareaholic_remove_transients_hourly'
25
+ );
26
+ ShareaholicUtilities::log('Cron: shareaholic_remove_transients_hourly is now scheduled');
27
+ } else {
28
+ ShareaholicUtilities::log('Cron: shareaholic_remove_transients_hourly is already scheduled');
29
+ }
30
+
31
+ // Content Sync Heartbeat
32
+ if (!wp_next_scheduled('shareaholic_heartbeat')) {
33
+ wp_schedule_event(
34
+ time() + rand(1, 60), 'daily', 'shareaholic_heartbeat'
35
  );
36
+ ShareaholicUtilities::log('Cron: shareaholic_heartbeat is now scheduled');
37
  } else {
38
+ ShareaholicUtilities::log('Cron: shareaholic_heartbeat is already scheduled');
39
  }
40
  }
41
 
45
  public static function deactivate() {
46
  if (wp_next_scheduled('shareaholic_remove_transients_hourly')) {
47
  wp_clear_scheduled_hook('shareaholic_remove_transients_hourly');
48
+ ShareaholicUtilities::log('Cron: shareaholic_remove_transients_hourly cleared');
49
+ } else {
50
+ ShareaholicUtilities::log('Cron: no need to clear shareaholic_remove_transients_hourly schedule');
51
+ }
52
+
53
+ if (wp_next_scheduled('shareaholic_heartbeat')) {
54
+ wp_clear_scheduled_hook('shareaholic_heartbeat');
55
+ ShareaholicUtilities::log('Cron: shareaholic_heartbeat cleared');
56
  } else {
57
+ ShareaholicUtilities::log('Cron: no need to clear shareaholic_heartbeat schedule');
58
  }
59
  }
60
 
61
+ public static function heartbeat() {
62
+ ShareaholicUtilities::heartbeat();
63
+ }
64
+
65
  /**
66
  * A job that clears up the shareaholic share counts transients
67
  */
84
  $result = $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name IN ({$options_names})");
85
 
86
  if (!$result) {
87
+ ShareaholicUtilities::log('Transient Query Error!');
88
  }
89
  }
90
  // Cleanup leftover mutex
public.php CHANGED
@@ -590,85 +590,79 @@ class ShareaholicPublic {
590
  * @return debug info in JSON
591
  */
592
  public static function debug_info() {
593
- global $wpdb;
594
-
595
  if (ShareaholicUtilities::get_option('disable_debug_info') == "on"){
596
  exit;
597
  }
598
-
599
  if (ShareaholicUtilities::get_option('disable_internal_share_counts_api') == NULL || ShareaholicUtilities::get_option('disable_internal_share_counts_api') == "off"){
600
  $server_side_share_count_status = "on";
601
  } else {
602
  $server_side_share_count_status = "off";
603
  }
604
-
605
  if (ShareaholicUtilities::has_accepted_terms_of_service() == 1){
606
  $tos_status = "accepted";
607
  } else {
608
  $tos_status = "pending";
609
  }
610
-
611
  if (function_exists('curl_version')){
612
  $curl_version = curl_version();
613
  }
614
-
615
  $info = array(
616
- 'plugin_version' => Shareaholic::VERSION,
617
- 'plugin_version_in_db' => ShareaholicUtilities::get_version(),
618
- 'site_id' => ShareaholicUtilities::get_option('api_key'),
619
- 'domain' => get_bloginfo('url'),
620
- 'language' => get_bloginfo('language'),
621
- 'tos_status' => $tos_status,
622
- 'stats' => array (
623
- 'posts_total' => $wpdb->get_var( "SELECT count(ID) FROM $wpdb->posts where post_type = 'post' AND post_status = 'publish'" ),
624
- 'pages_total' => $wpdb->get_var( "SELECT count(ID) FROM $wpdb->posts where post_type = 'page' AND post_status = 'publish'" ),
625
- 'users_total' => $wpdb->get_var("SELECT count(ID) FROM $wpdb->users"),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
626
  ),
627
- 'diagnostics' => array (
628
- 'theme' => get_option('template'),
629
- 'multisite' => is_multisite(),
630
- 'shareaholic_server_reachable' => ShareaholicUtilities::connectivity_check(),
631
- 'server_side_share_count_api_reachable' => ShareaholicUtilities::share_counts_api_connectivity_check(),
632
- 'php_version' => phpversion(),
633
- 'wp_version' => get_bloginfo('version'),
634
- 'curl' => array (
635
- 'status' => ShareaholicPublic::has_curl(),
636
- 'version' => $curl_version,
637
- ),
638
- 'plugins' => array (
639
- 'active' => get_option('active_plugins', array()),
640
- 'sitewide' => get_site_option('active_sitewide_plugins', array()),
641
- ),
642
- ),
643
- 'app_locations' => array (
644
- 'share_buttons' => ShareaholicUtilities::get_option('share_buttons'),
645
- 'recommendations' => ShareaholicUtilities::get_option('recommendations'),
646
- 'recommendations_display_on_excerpts' => ShareaholicUtilities::get_option('recommendations_display_on_excerpts'),
647
- 'share_buttons_display_on_excerpts' => ShareaholicUtilities::get_option('share_buttons_display_on_excerpts'),
648
- ),
649
- 'advanced_settings' => array (
650
- 'server_side_share_count_api' => $server_side_share_count_status,
651
- 'facebook_access_token' => ShareaholicUtilities::fetch_fb_access_token() === false ? 'no' : 'yes',
652
- 'facebook_auth_check' => ShareaholicUtilities::facebook_auth_check(),
653
- 'enable_user_nicename' => ShareaholicUtilities::get_option('enable_user_nicename'),
654
- 'disable_og_tags' => ShareaholicUtilities::get_option('disable_og_tags'),
655
- 'disable_admin_bar_menu' => ShareaholicUtilities::get_option('disable_admin_bar_menu'),
656
- )
657
  );
658
-
659
  header('Content-Type: application/json');
660
  echo json_encode($info);
661
  exit;
662
  }
663
-
664
-
665
  /**
666
  * Function to return list of permalinks
667
  *
668
  * @return list of permalinks in JSON or plain text
669
  */
670
  public static function permalink_list(){
671
-
672
  // Input Params
673
  $post_type = isset($_GET['post_type']) ? $_GET['post_type'] : "any";
674
  $n = isset($_GET['n']) ? intval($_GET['n']) : -1;
590
  * @return debug info in JSON
591
  */
592
  public static function debug_info() {
593
+
 
594
  if (ShareaholicUtilities::get_option('disable_debug_info') == "on"){
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 {
607
  $tos_status = "pending";
608
  }
609
+
610
  if (function_exists('curl_version')){
611
  $curl_version = curl_version();
612
  }
613
+
614
  $info = array(
615
+ 'plugin_version' => Shareaholic::VERSION,
616
+ 'plugin_version_in_db' => ShareaholicUtilities::get_version(),
617
+ 'site_id' => ShareaholicUtilities::get_option('api_key'),
618
+ 'domain' => get_bloginfo('url'),
619
+ 'language' => get_bloginfo('language'),
620
+ 'tos_status' => $tos_status,
621
+ 'stats' => ShareaholicUtilities::get_stats(),
622
+ 'diagnostics' => array(
623
+ 'theme' => get_option('template'),
624
+ 'multisite' => is_multisite(),
625
+ 'shareaholic_server_reachable' => ShareaholicUtilities::connectivity_check(),
626
+ 'server_side_share_count_api_reachable' => ShareaholicUtilities::share_counts_api_connectivity_check(),
627
+ 'php_version' => phpversion(),
628
+ 'wp_version' => get_bloginfo('version'),
629
+ 'curl' => array (
630
+ 'status' => ShareaholicPublic::has_curl(),
631
+ 'version' => $curl_version,
632
+ ),
633
+ 'plugins' => array(
634
+ 'active' => get_option('active_plugins', array()),
635
+ 'sitewide' => get_site_option('active_sitewide_plugins', array()),
636
+ ),
637
+ ),
638
+ 'app_locations' => array(
639
+ 'share_buttons' => ShareaholicUtilities::get_option('share_buttons'),
640
+ 'recommendations' => ShareaholicUtilities::get_option('recommendations'),
641
+ ),
642
+ 'advanced_settings' => array(
643
+ 'server_side_share_count_api' => $server_side_share_count_status,
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'),
647
+ 'disable_og_tags' => ShareaholicUtilities::get_option('disable_og_tags'),
648
+ 'disable_admin_bar_menu' => ShareaholicUtilities::get_option('disable_admin_bar_menu'),
649
+ 'recommendations_display_on_excerpts' => ShareaholicUtilities::get_option('recommendations_display_on_excerpts'),
650
+ 'share_buttons_display_on_excerpts' => ShareaholicUtilities::get_option('share_buttons_display_on_excerpts'),
651
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
652
  );
653
+
654
  header('Content-Type: application/json');
655
  echo json_encode($info);
656
  exit;
657
  }
658
+
659
+
660
  /**
661
  * Function to return list of permalinks
662
  *
663
  * @return list of permalinks in JSON or plain text
664
  */
665
  public static function permalink_list(){
 
666
  // Input Params
667
  $post_type = isset($_GET['post_type']) ? $_GET['post_type'] : "any";
668
  $n = isset($_GET['n']) ? intval($_GET['n']) : -1;
public_js.php CHANGED
@@ -24,6 +24,11 @@ class ShareaholicPublicJS {
24
  )
25
  );
26
 
 
 
 
 
 
27
  $disable_share_counts_api = ShareaholicUtilities::get_option('disable_internal_share_counts_api');
28
  $share_counts_connect_check = ShareaholicUtilities::get_option('share_counts_connect_check');
29
 
24
  )
25
  );
26
 
27
+ $site_id = ShareaholicUtilities::get_option('api_key');
28
+ if (!empty($site_id)) {
29
+ $base_settings['site_id'] = $site_id;
30
+ }
31
+
32
  $disable_share_counts_api = ShareaholicUtilities::get_option('disable_internal_share_counts_api');
33
  $share_counts_connect_check = ShareaholicUtilities::get_option('share_counts_connect_check');
34
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === WordPress Share Buttons, Related Posts, Google Analytics - Shareaholic ===
2
  Contributors: shareaholic
3
- Tags: buttons, related posts, google analytics, share buttons, social sharing, image sharing, related content, woocommerce, typepad, amazon, analytics, arto, baidu, bitly, blogger, buffer, cookie compliance, cookie consent, delicious, digg, diigo, disqus, email button, eu cookie law, evernote, facebook, facebook sharing, fancy, fark, feedly, flipboard, floated share buttons, floating share buttons, follow buttons, GDPR, gmail, google bookmarks, google classroom, google plus, hootsuite, hotmail, houzz, inbound.org, instagram, instagram sharing, instapaper, kik, kindle, line, linkedin, livejournal, meneame, mister wong, mix, mixi, odnoklassniki, box.net, onenote, pinboard.in, pinterest, pinterest sharing, plurk, pocket, printfriendly, recommendations, reddit, sexybookmarks, share buttons, share image, shareaholic, shareholic, sms, social bookmarking, social media, social plugin, social share buttons, spotify, stumbleupon, stumpedia, symphony, tinyurl, tumblr, twitter, viadeo, vk, wanelo, wechat, weheartit, weibo, whatsapp, wykop, xing, yahoo, yammer, ycombinator, hacker news, youtube, yummly, zillow
4
  Requires at least: 3.7
5
  Tested up to: 5.2
6
  Requires PHP: 5.2
7
- Stable tag: 8.13.6
8
 
9
 
10
  Boost Audience Engagement with Award Winning Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
@@ -285,6 +285,29 @@ The default Shareaholic thumbnail width is 640px with dynamic height and no crop
285
  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.
286
 
287
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
  = 8.13.6 (2019-07-11) =
289
  * New: Hosted/cloud option for Share Count Proxy now available [More info](https://www.shareaholic.com/blog/social-share-count-api/)
290
  * Enhancement: Performance improvements to Share Count Proxy (stricter timeouts for API calls)
@@ -940,7 +963,7 @@ Each time you change Shareaholic's thumbnail dimensions like this, you will prob
940
  * Show Related Posts data status
941
 
942
  == Upgrade Notice ==
943
- = 8.13.6 =
944
  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!
945
 
946
  = 8.12.1 =
1
  === WordPress Share Buttons, Related Posts, Google Analytics - Shareaholic ===
2
  Contributors: shareaholic
3
+ Tags: social, social sharing, google analytics, pinterest, twitter, share buttons, content, woocommerce, typepad, amazon, analytics, arto, baidu, bitly, blogger, buffer, cookie compliance, cookie consent, delicious, digg, diigo, disqus, email button, eu cookie law, evernote, facebook, facebook sharing, fancy, fark, feedly, flipboard, floated share buttons, floating share buttons, follow buttons, GDPR, gmail, google bookmarks, google classroom, google plus, hootsuite, hotmail, houzz, inbound.org, instagram, instagram sharing, instapaper, kik, kindle, line, linkedin, livejournal, meneame, mister wong, mix, mixi, odnoklassniki, box.net, onenote, pinboard.in, pinterest, pinterest sharing, plurk, pocket, printfriendly, recommendations, reddit, sexybookmarks, share buttons, share image, shareaholic, shareholic, sms, social bookmarking, social media, social plugin, social share buttons, spotify, stumbleupon, stumpedia, symphony, tinyurl, tumblr, twitter, viadeo, vk, wanelo, wechat, weheartit, weibo, whatsapp, wykop, xing, yahoo, yammer, ycombinator, hacker news, youtube, yummly, zillow
4
  Requires at least: 3.7
5
  Tested up to: 5.2
6
  Requires PHP: 5.2
7
+ Stable tag: 8.13.7
8
 
9
 
10
  Boost Audience Engagement with Award Winning Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
285
  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.
286
 
287
  == Changelog ==
288
+ = 8.13.7 (2019-09-16) =
289
+ * Huge Enhancement: We have been working hard on reducing Shareaholic's code footprint. We are pleased to share that Shareaholic code has shed ~20% of its size, is much faster, and is no longer dependent on jQuery! More work is actively being done here - stay tuned.
290
+ * Enhancement: Calls to the Share Count Proxy [More info](https://www.shareaholic.com/blog/social-share-count-api/) are consolidated to one single request for a given page. This dramatically cuts down on the number of requests on a page for faster load times.
291
+ * Enhancement: Facebook Messenger Share Button now works on Mobile devices
292
+ * Enhancement: Better compatibility with various Site Speed plugins and Minification
293
+ * Enhancement: Share Buttons for Images rendering is noticeably faster
294
+ * Enhancement: Improved rendering of Floated Share Buttons on Mobile
295
+ * Enhancement: Revamped Review Notice design
296
+ * Enhancement: Better content syncing for Related Posts App & Content Analytics
297
+ * New Share Buttons
298
+ * MeWe
299
+ * Admin UI is now localized in -
300
+ * Chinese Simplified - 简体中文 (zh-CN)
301
+ * Chinese Traditional - 中國傳統的 (zh-TW)
302
+ * Romanian - Română (ro)
303
+ * Swedish - svenska (sv)
304
+ * Catalan - Català (ca)
305
+ * Greek - Ελληνικά (el)
306
+ * Vietnamese - Tiếng Việt (vi)
307
+ * Estonian - Eestlane (et)
308
+ * Turkish - Türk (tr)
309
+ * Bugfix: Floated Share Buttons Targeting Rules were not visible
310
+
311
  = 8.13.6 (2019-07-11) =
312
  * New: Hosted/cloud option for Share Count Proxy now available [More info](https://www.shareaholic.com/blog/social-share-count-api/)
313
  * Enhancement: Performance improvements to Share Count Proxy (stricter timeouts for API calls)
963
  * Show Related Posts data status
964
 
965
  == Upgrade Notice ==
966
+ = 8.13.7 =
967
  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!
968
 
969
  = 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.6
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.6
18
  */
19
 
20
  /**
@@ -59,7 +59,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.6';
63
 
64
  /**
65
  * Starts off as false so that ::get_instance() returns
@@ -128,8 +128,11 @@ if (!class_exists('Shareaholic')) {
128
  add_action('wp_before_admin_bar_render', array('ShareaholicUtilities', 'admin_bar_extended'));
129
  add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'ShareaholicUtilities::admin_plugin_action_links', -10);
130
 
131
- // Add custom action to run Shareaholic cron job
132
  add_action('shareaholic_remove_transients_hourly', array('ShareaholicCron', 'remove_transients'));
 
 
 
133
 
134
  // do something before a post is updated
135
  add_action('pre_post_update', array('ShareaholicUtilities', 'before_post_is_updated'));
@@ -275,11 +278,11 @@ if (!class_exists('Shareaholic')) {
275
  */
276
  public function uninstall() {
277
  ShareaholicUtilities::log_event("Uninstall");
278
- ShareaholicUtilities::delete_api_key();
279
  delete_option('shareaholic_has_accepted_tos');
280
  delete_option('shareaholic_settings');
281
  delete_option('shareaholic_activate_timestamp');
282
  delete_option('shareaholic_review_dismiss'); // legacy flag for reviews; can remove later
 
283
  ShareaholicUtilities::delete_mutex();
284
  }
285
  }
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
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.7
18
  */
19
 
20
  /**
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.7';
63
 
64
  /**
65
  * Starts off as false so that ::get_instance() returns
128
  add_action('wp_before_admin_bar_render', array('ShareaholicUtilities', 'admin_bar_extended'));
129
  add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'ShareaholicUtilities::admin_plugin_action_links', -10);
130
 
131
+ // Add custom action to run remove_transients cron job
132
  add_action('shareaholic_remove_transients_hourly', array('ShareaholicCron', 'remove_transients'));
133
+
134
+ // Add custom action to run shareaholic_heartbeat cron job
135
+ add_action('shareaholic_heartbeat', array('ShareaholicCron', 'heartbeat'));
136
 
137
  // do something before a post is updated
138
  add_action('pre_post_update', array('ShareaholicUtilities', 'before_post_is_updated'));
278
  */
279
  public function uninstall() {
280
  ShareaholicUtilities::log_event("Uninstall");
 
281
  delete_option('shareaholic_has_accepted_tos');
282
  delete_option('shareaholic_settings');
283
  delete_option('shareaholic_activate_timestamp');
284
  delete_option('shareaholic_review_dismiss'); // legacy flag for reviews; can remove later
285
+ ShareaholicUtilities::delete_api_key();
286
  ShareaholicUtilities::delete_mutex();
287
  }
288
  }
templates/script_tag.php CHANGED
@@ -1,11 +1,8 @@
1
- <!-- Powered by Shareaholic; Grow your audience faster! - https://www.shareaholic.com -->
2
- <link rel='preload' href='<?php echo ShareaholicUtilities::asset_url('assets/pub/shareaholic.js') ?>' as='script' />
3
- <script data-cfasync='false'>
4
  //<![CDATA[
5
  _SHR_SETTINGS = <?php echo json_encode($base_settings); ?>;
6
  //]]>
7
  </script>
8
- <script data-cfasync='false'
9
- src='<?php echo ShareaholicUtilities::asset_url('assets/pub/shareaholic.js') ?>'
10
- data-shr-siteid='<?php echo $api_key; ?>' async <?php echo $overrides ?>>
11
- </script>
1
+ <!-- Powered by Shareaholic; Grow your Audience faster! - https://www.shareaholic.com -->
2
+ <link rel='preload' href='<?php echo ShareaholicUtilities::asset_url('assets/pub/shareaholic.js') ?>' as='script'/>
3
+ <script data-no-minify='1' data-cfasync='false'>
4
  //<![CDATA[
5
  _SHR_SETTINGS = <?php echo json_encode($base_settings); ?>;
6
  //]]>
7
  </script>
8
+ <script data-no-minify='1' data-cfasync='false' src='<?php echo ShareaholicUtilities::asset_url('assets/pub/shareaholic.js') ?>' data-shr-siteid='<?php echo $api_key; ?>' async <?php echo $overrides ?>></script>
 
 
 
utilities.php CHANGED
@@ -643,6 +643,22 @@ class ShareaholicUtilities {
643
  }
644
  }
645
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
646
  /**
647
  * Returns the api key or creates a new one.
648
  *
@@ -1074,52 +1090,87 @@ class ShareaholicUtilities {
1074
  * @param array $extra_params any extra data points to be included
1075
  */
1076
  public static function log_event($event_name = 'Default', $extra_params = false) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1077
 
1078
- global $wpdb;
 
 
 
1079
 
1080
- $event_metadata = array(
1081
- 'plugin_version' => Shareaholic::VERSION,
1082
- 'api_key' => self::get_option('api_key'),
1083
- 'domain' => get_bloginfo('url'),
1084
- 'language' => get_bloginfo('language'),
1085
- 'stats' => array (
1086
- 'posts_total' => $wpdb->get_var( "SELECT count(ID) FROM $wpdb->posts where post_type = 'post' AND post_status = 'publish'" ),
1087
- 'pages_total' => $wpdb->get_var( "SELECT count(ID) FROM $wpdb->posts where post_type = 'page' AND post_status = 'publish'" ),
1088
- 'users_total' => $wpdb->get_var("SELECT count(ID) FROM $wpdb->users"),
1089
- ),
1090
- 'diagnostics' => array (
1091
- 'php_version' => phpversion(),
1092
- 'wp_version' => get_bloginfo('version'),
1093
- 'theme' => get_option('template'),
1094
- 'active_plugins' => get_option('active_plugins', array()),
1095
- 'multisite' => is_multisite(),
1096
- ),
1097
- 'features' => array (
1098
- 'share_buttons' => self::get_option('share_buttons'),
1099
- 'recommendations' => self::get_option('recommendations'),
1100
- )
1101
- );
1102
-
1103
- if ($extra_params) {
1104
- $event_metadata = array_merge($event_metadata, $extra_params);
1105
- }
1106
-
1107
- $event_api_url = Shareaholic::API_URL . '/api/events';
1108
- $event_params = array('name' => "WordPress:".$event_name, 'data' => json_encode($event_metadata) );
1109
-
1110
- $response = ShareaholicCurl::post($event_api_url, $event_params, '', true, 2);
 
 
 
 
 
 
 
 
 
 
 
 
 
1111
  }
1112
-
1113
  /**
1114
  * Deletes the api key
1115
  *
1116
  */
1117
  public static function delete_api_key () {
1118
  $payload = array(
1119
- 'site_id' => self::get_option('api_key'),
1120
- 'verification_key' => self::get_option('verification_key')
1121
- );
1122
-
1123
  $response = ShareaholicCurl::post(
1124
  Shareaholic::API_URL . '/integrations/plugin/delete',
1125
  $payload,
643
  }
644
  }
645
 
646
+ /**
647
+ * Returns Stats
648
+ *
649
+ */
650
+ public static function get_stats() {
651
+ global $wpdb;
652
+
653
+ $stats = array(
654
+ 'posts_total' => $wpdb->get_var( "SELECT count(ID) FROM $wpdb->posts where post_type = 'post' AND post_status = 'publish'" ),
655
+ 'pages_total' => $wpdb->get_var( "SELECT count(ID) FROM $wpdb->posts where post_type = 'page' AND post_status = 'publish'" ),
656
+ 'users_total' => $wpdb->get_var("SELECT count(ID) FROM $wpdb->users"),
657
+ );
658
+
659
+ return (isset($stats) ? $stats : array());
660
+ }
661
+
662
  /**
663
  * Returns the api key or creates a new one.
664
  *
1090
  * @param array $extra_params any extra data points to be included
1091
  */
1092
  public static function log_event($event_name = 'Default', $extra_params = false) {
1093
+ $event_metadata = array(
1094
+ 'plugin_version' => Shareaholic::VERSION,
1095
+ 'api_key' => self::get_option('api_key'),
1096
+ 'domain' => get_bloginfo('url'),
1097
+ 'diagnostics' => array (
1098
+ 'php_version' => phpversion(),
1099
+ 'wp_version' => get_bloginfo('version'),
1100
+ 'theme' => get_option('template'),
1101
+ 'multisite' => is_multisite(),
1102
+ ),
1103
+ 'features' => array(
1104
+ 'share_buttons' => self::get_option('share_buttons'),
1105
+ 'recommendations' => self::get_option('recommendations')
1106
+ ),
1107
+ );
1108
+
1109
+ if ($extra_params) {
1110
+ $event_metadata = array_merge($event_metadata, $extra_params);
1111
+ }
1112
 
1113
+ $event_api_url = Shareaholic::API_URL . '/api/events';
1114
+ $event_params = array('name' => "WordPress:".$event_name, 'data' => json_encode($event_metadata) );
1115
+ $response = ShareaholicCurl::post($event_api_url, $event_params, '', true, 2);
1116
+ }
1117
 
1118
+ /**
1119
+ * This is a wrapper for the Heartbeat API
1120
+ *
1121
+ */
1122
+ public static function heartbeat() {
1123
+ $data = array(
1124
+ 'platform' => 'wordpress',
1125
+ 'plugin_name' => 'shareaholic',
1126
+ 'plugin_version' => Shareaholic::VERSION,
1127
+ 'api_key' => self::get_option('api_key'),
1128
+ 'verification_key' => self::get_option('verification_key'),
1129
+ 'domain' => preg_replace('#^https?://#', '', get_bloginfo('url')),
1130
+ 'language' => get_bloginfo('language'),
1131
+ 'stats' => ShareaholicUtilities::get_stats(),
1132
+ 'diagnostics' => array(
1133
+ 'tos_status' => ShareaholicUtilities::has_accepted_terms_of_service(),
1134
+ 'shareaholic_server_reachable' => ShareaholicUtilities::connectivity_check(),
1135
+ 'server_side_share_count_api_reachable' => ShareaholicUtilities::share_counts_api_connectivity_check(),
1136
+ 'php_version' => phpversion(),
1137
+ 'wp_version' => get_bloginfo('version'),
1138
+ 'theme' => get_option('template'),
1139
+ 'multisite' => is_multisite(),
1140
+ 'plugins' => array(
1141
+ 'active' => get_option('active_plugins', array()),
1142
+ 'sitewide' => get_site_option('active_sitewide_plugins', array()),
1143
+ ),
1144
+ ),
1145
+ 'endpoints' => array(
1146
+ 'ajax_url' => admin_url('admin-ajax.php')
1147
+ ),
1148
+ 'advanced_settings' => array(
1149
+ 'server_side_share_count_api' => $server_side_share_count_status,
1150
+ 'facebook_access_token' => ShareaholicUtilities::fetch_fb_access_token() === false ? 'no' : 'yes',
1151
+ 'facebook_auth_check' => ShareaholicUtilities::facebook_auth_check(),
1152
+ 'enable_user_nicename' => ShareaholicUtilities::get_option('enable_user_nicename'),
1153
+ 'disable_og_tags' => ShareaholicUtilities::get_option('disable_og_tags'),
1154
+ 'disable_admin_bar_menu' => ShareaholicUtilities::get_option('disable_admin_bar_menu'),
1155
+ 'recommendations_display_on_excerpts' => ShareaholicUtilities::get_option('recommendations_display_on_excerpts'),
1156
+ 'share_buttons_display_on_excerpts' => ShareaholicUtilities::get_option('share_buttons_display_on_excerpts'),
1157
+ ),
1158
+ );
1159
+
1160
+ $event_api_url = Shareaholic::API_URL . '/api/plugin_heartbeats';
1161
+ $response = ShareaholicCurl::post($event_api_url, $data, '', true, 2);
1162
  }
1163
+
1164
  /**
1165
  * Deletes the api key
1166
  *
1167
  */
1168
  public static function delete_api_key () {
1169
  $payload = array(
1170
+ 'site_id' => self::get_option('api_key'),
1171
+ 'verification_key' => self::get_option('verification_key')
1172
+ );
1173
+
1174
  $response = ShareaholicCurl::post(
1175
  Shareaholic::API_URL . '/integrations/plugin/delete',
1176
  $payload,