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

Version Description

Various reliablity improvements

Download this release

Release Info

Developer shareaholic
Plugin Icon 128x128 WordPress Social Tools, Related Posts, Monetization – Shareaholic
Version 8.10.2
Comparing to
See all releases

Code changes from version 8.10.1 to 8.10.2

Files changed (4) hide show
  1. admin.php +2 -2
  2. readme.txt +7 -1
  3. shareaholic.php +3 -3
  4. utilities.php +15 -8
admin.php CHANGED
@@ -357,8 +357,8 @@ JQUERY;
357
  /*
358
  add_submenu_page(
359
  'shareaholic-settings',
360
- __('App Manager - beta!', 'shareaholic'),
361
- __('App Manager - beta!', 'shareaholic'),
362
  'manage_options',
363
  'shareaholic-settings-beta',
364
  array('ShareaholicAdmin', 'admin_beta')
357
  /*
358
  add_submenu_page(
359
  'shareaholic-settings',
360
+ __('App Manager [beta]', 'shareaholic'),
361
+ __('App Manager [beta]', 'shareaholic'),
362
  'manage_options',
363
  'shareaholic-settings-beta',
364
  array('ShareaholicAdmin', 'admin_beta')
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: buttons, related posts, google analytics, share buttons, social sharing,
4
  Requires at least: 3.0
5
  Tested up to: 5.0
6
  Requires PHP: 5.2
7
- Stable tag: 8.10.1
8
 
9
 
10
  Improve Audience Engagement with Award Winning Site-Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
@@ -259,6 +259,8 @@ The default Shareaholic thumbnail width is 640px with dynamic height and no crop
259
  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.
260
 
261
  == Changelog ==
 
 
262
 
263
  = 8.10.1 (2018-11-19) =
264
  * Bugfix: Fixed `Call to undefined function wp_list_sort()` (thank you Jorge García de Opazo for debugging help)
@@ -838,6 +840,10 @@ Each time you change Shareaholic's thumbnail dimensions like this, you will prob
838
 
839
  == Upgrade Notice ==
840
 
 
 
 
 
841
  = 8.10.1 =
842
 
843
  Various reliablity improvements
4
  Requires at least: 3.0
5
  Tested up to: 5.0
6
  Requires PHP: 5.2
7
+ Stable tag: 8.10.2
8
 
9
 
10
  Improve Audience Engagement with Award Winning Site-Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
259
  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.
260
 
261
  == Changelog ==
262
+ = 8.10.2 (2018-11-20) =
263
+ * Bugfix: Fixed issue with Site Profile ID generation introduced in 8.10.0
264
 
265
  = 8.10.1 (2018-11-19) =
266
  * Bugfix: Fixed `Call to undefined function wp_list_sort()` (thank you Jorge García de Opazo for debugging help)
840
 
841
  == Upgrade Notice ==
842
 
843
+ = 8.10.2 =
844
+
845
+ Various reliablity improvements
846
+
847
  = 8.10.1 =
848
 
849
  Various reliablity improvements
shareaholic.php CHANGED
@@ -3,14 +3,14 @@
3
  * The main file!
4
  *
5
  * @package shareaholic
6
- * @version 8.10.1
7
  */
8
 
9
  /*
10
  Plugin Name: Shareaholic - Share Buttons, Analytics, Related Posts
11
  Plugin URI: https://www.shareaholic.com/website-tools/
12
  Description: The best WordPress all-in-one Social Media and Related Posts solution. Get found on social and grow your following. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for settings.
13
- Version: 8.10.1
14
  Author: Shareaholic
15
  Author URI: https://www.shareaholic.com
16
  Text Domain: shareaholic
@@ -61,7 +61,7 @@ if (!class_exists('Shareaholic')) {
61
  const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
62
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
63
 
64
- const VERSION = '8.10.1';
65
 
66
  /**
67
  * Starts off as false so that ::get_instance() returns
3
  * The main file!
4
  *
5
  * @package shareaholic
6
+ * @version 8.10.2
7
  */
8
 
9
  /*
10
  Plugin Name: Shareaholic - Share Buttons, Analytics, Related Posts
11
  Plugin URI: https://www.shareaholic.com/website-tools/
12
  Description: The best WordPress all-in-one Social Media and Related Posts solution. Get found on social and grow your following. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for settings.
13
+ Version: 8.10.2
14
  Author: Shareaholic
15
  Author URI: https://www.shareaholic.com
16
  Text Domain: shareaholic
61
  const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
62
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
63
 
64
+ const VERSION = '8.10.2';
65
 
66
  /**
67
  * Starts off as false so that ::get_instance() returns
utilities.php CHANGED
@@ -508,6 +508,15 @@ class ShareaholicUtilities {
508
  */
509
  public static function get_new_location_name_ids($api_key) {
510
  $response = ShareaholicCurl::get(Shareaholic::API_URL . "/publisher_tools/{$api_key}.json");
 
 
 
 
 
 
 
 
 
511
  $publisher_configuration = $response['body'];
512
  $result = array();
513
 
@@ -653,6 +662,9 @@ class ShareaholicUtilities {
653
  * is wrapped in a mutex to keep two requests from
654
  * trying to create new api keys at the same time.
655
  *
 
 
 
656
  * @return string
657
  */
658
  public static function get_or_create_api_key() {
@@ -660,14 +672,7 @@ class ShareaholicUtilities {
660
 
661
  // ensure api key set is atleast 30 characters
662
  if ($api_key && (strlen($api_key) > 30)) {
663
- // ensure api key exists on server
664
- $response = ShareaholicCurl::get(Shareaholic::API_URL . "/publisher_tools/{$api_key}.json");
665
- if(is_array($response) && array_key_exists('body', $response)) {
666
- $response_code = wp_remote_retrieve_response_code($response);
667
- if ($response_code != "404"){
668
- return $api_key;
669
- }
670
- }
671
  }
672
 
673
  if (!self::is_locked('get_or_create_api_key')) {
@@ -743,6 +748,8 @@ class ShareaholicUtilities {
743
  self::get_or_create_api_key();
744
  }
745
  }
 
 
746
 
747
 
748
  /**
508
  */
509
  public static function get_new_location_name_ids($api_key) {
510
  $response = ShareaholicCurl::get(Shareaholic::API_URL . "/publisher_tools/{$api_key}.json");
511
+
512
+ if(is_array($response) && array_key_exists('body', $response)) {
513
+ $response_code = wp_remote_retrieve_response_code($response);
514
+ if ($response_code == "404"){
515
+ delete_option('shareaholic_settings');
516
+ ShareaholicUtilities::get_or_create_api_key();
517
+ }
518
+ }
519
+
520
  $publisher_configuration = $response['body'];
521
  $result = array();
522
 
662
  * is wrapped in a mutex to keep two requests from
663
  * trying to create new api keys at the same time.
664
  *
665
+ * Note: this function is called on every pageload.
666
+ * So please keep it as fast as possible.
667
+ *
668
  * @return string
669
  */
670
  public static function get_or_create_api_key() {
672
 
673
  // ensure api key set is atleast 30 characters
674
  if ($api_key && (strlen($api_key) > 30)) {
675
+ return $api_key;
 
 
 
 
 
 
 
676
  }
677
 
678
  if (!self::is_locked('get_or_create_api_key')) {
748
  self::get_or_create_api_key();
749
  }
750
  }
751
+
752
+
753
 
754
 
755
  /**