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

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.12.4
Comparing to
See all releases

Code changes from version 8.12.3 to 8.12.4

assets/css/main.css CHANGED
@@ -12,7 +12,8 @@ body {
12
  text-decoration: none;
13
  }
14
 
15
- .update-nag {
 
16
  display: none !important;
17
  }
18
 
12
  text-decoration: none;
13
  }
14
 
15
+ /* Hides WP Nag Screen */
16
+ #update-nag, .update-nag {
17
  display: none !important;
18
  }
19
 
lib/social-share-counts/curl_multi_share_count.php CHANGED
@@ -26,7 +26,7 @@ class ShareaholicCurlMultiShareCount extends ShareaholicShareCount {
26
  * the keys and the counts as the value.
27
  *
28
  * Example:
29
- * array('facebook' => 12, 'google_plus' => 0, 'twitter' => 14, ...);
30
  *
31
  * @return Array an associative array of service => counts
32
  */
26
  * the keys and the counts as the value.
27
  *
28
  * Example:
29
+ * array('facebook' => 12, 'pinterest' => 0, 'twitter' => 14, ...);
30
  *
31
  * @return Array an associative array of service => counts
32
  */
lib/social-share-counts/seq_share_count.php CHANGED
@@ -26,7 +26,7 @@ class ShareaholicSeqShareCount extends ShareaholicShareCount {
26
  * the keys and the counts as the value.
27
  *
28
  * Example:
29
- * array('facebook' => 12, 'google_plus' => 0, 'twitter' => 14, ...);
30
  *
31
  * @return Array an associative array of service => counts
32
  */
26
  * the keys and the counts as the value.
27
  *
28
  * Example:
29
+ * array('facebook' => 12, 'pinterest' => 0, 'twitter' => 14, ...);
30
  *
31
  * @return Array an associative array of service => counts
32
  */
lib/social-share-counts/share_count.php CHANGED
@@ -34,26 +34,11 @@ abstract class ShareaholicShareCount {
34
  public static function get_services_config() {
35
  return array(
36
  'facebook' => array(
37
- 'url' => 'https://graph.facebook.com/?id=%s',
38
  'method' => 'GET',
39
  'timeout' => 3, // in number of seconds
40
  'callback' => 'facebook_count_callback',
41
  ),
42
- 'linkedin' => array(
43
- 'url' => 'https://www.linkedin.com/countserv/count/share?format=json&url=%s',
44
- 'method' => 'GET',
45
- 'timeout' => 3,
46
- 'callback' => 'linkedin_count_callback',
47
- ),
48
- 'google_plus' => array(
49
- 'url' => 'https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ',
50
- 'method' => 'POST',
51
- 'timeout' => 2,
52
- 'headers' => array('Content-Type' => 'application/json'),
53
- 'body' => NULL,
54
- 'prepare' => 'google_plus_prepare_request',
55
- 'callback' => 'google_plus_count_callback',
56
- ),
57
  'pinterest' => array(
58
  'url' => 'https://api.pinterest.com/v1/urls/count.json?url=%s&callback=f',
59
  'method' => 'GET',
@@ -66,39 +51,38 @@ abstract class ShareaholicShareCount {
66
  'timeout' => 1,
67
  'callback' => 'buffer_count_callback',
68
  ),
69
- 'stumbleupon' => array(
70
- 'url' => 'https://www.stumbleupon.com/services/1.01/badge.getinfo?url=%s',
71
- 'method' => 'GET',
72
- 'timeout' => 1,
73
- 'callback' => 'stumbleupon_count_callback',
74
- ),
75
  'reddit' => array(
76
- 'url' => 'https://buttons.reddit.com/button_info.json?url=%s',
77
  'method' => 'GET',
78
  'timeout' => 1,
79
  'callback' => 'reddit_count_callback',
80
  ),
81
  'vk' => array(
82
- 'url' => 'http://vk.com/share.php?act=count&url=%s',
83
  'method' => 'GET',
84
  'timeout' => 1,
85
  'callback' => 'vk_count_callback',
86
  ),
 
 
 
 
 
 
87
  'odnoklassniki' => array(
88
  'url' => 'https://connect.ok.ru/dk?st.cmd=extLike&uid=odklcnt0&ref=%s',
89
  'method' => 'GET',
90
  'timeout' => 1,
91
  'callback' => 'odnoklassniki_count_callback',
92
  ),
93
-
94
  'fancy' => array(
95
- 'url' => 'http://fancy.com/fancyit/count?ItemURL=%s',
96
  'method' => 'GET',
97
  'timeout' => 1,
98
  'callback' => 'fancy_count_callback',
99
  ),
100
  'yummly' => array(
101
- 'url' => 'http://www.yummly.com/services/yum-count?url=%s',
102
  'method' => 'GET',
103
  'timeout' => 1,
104
  'callback' => 'yummly_count_callback',
@@ -177,82 +161,7 @@ abstract class ShareaholicShareCount {
177
  return false;
178
  }
179
  $body = json_decode($response['body'], true);
180
- return isset($body['share']['share_count']) ? intval($body['share']['share_count']) : false;
181
- }
182
-
183
-
184
- /**
185
- * Callback function for linkedin count API
186
- * Gets the linkedin counts from response
187
- *
188
- * @param Array $response The response from calling the API
189
- * @return mixed The counts from the API or false if error
190
- */
191
- public function linkedin_count_callback($response) {
192
- if($this->has_http_error($response)) {
193
- return false;
194
- }
195
- $body = json_decode($response['body'], true);
196
- return isset($body['count']) ? intval($body['count']) : false;
197
- }
198
-
199
-
200
- /**
201
- * A preprocess function to be called necessary to prepare
202
- * the request to the service.
203
- *
204
- * One may customize the headers or body to their liking
205
- * before the request is sent. The customization should
206
- * update the services config where it will be read by
207
- * the get_counts() function
208
- *
209
- * @param $url The url needed by google_plus to be passed in to the body
210
- * @param $config The services configuration object to be updated
211
- */
212
- public function google_plus_prepare_request($url, &$config) {
213
- if ($this->is_url_encoded($url)) {
214
- $url = urldecode($url);
215
- }
216
- $post_fields = array(
217
- array(
218
- 'method' => 'pos.plusones.get',
219
- 'id' => 'p',
220
- 'params' => array(
221
- 'nolog' => true,
222
- 'id' => $url,
223
- 'source' => 'widget',
224
- 'userId' => '@viewer',
225
- 'groupId' => '@self',
226
- ),
227
- 'jsonrpc' => '2.0',
228
- 'key' => 'p',
229
- 'apiVersion' => 'v1',
230
- )
231
- );
232
-
233
- $ip = $this->get_client_ip();
234
- if ($ip && !empty($ip)) {
235
- $post_fields[0]['params']['userIp'] = $ip;
236
- }
237
-
238
- $config['google_plus']['body'] = $post_fields;
239
- }
240
-
241
-
242
- /**
243
- * Callback function for google plus count API
244
- * Gets the google plus counts from response
245
- *
246
- * @param Array $response The response from calling the API
247
- * @return mixed The counts from the API or false if error
248
- */
249
- public function google_plus_count_callback($response) {
250
- if($this->has_http_error($response)) {
251
- return false;
252
- }
253
- $body = json_decode($response['body'], true);
254
- // special case: do not return false if the count is not set because the api can return without counts
255
- return isset($body[0]['result']['metadata']['globalCounts']['count']) ? intval($body[0]['result']['metadata']['globalCounts']['count']) : 0;
256
  }
257
 
258
 
@@ -289,23 +198,6 @@ abstract class ShareaholicShareCount {
289
  }
290
 
291
 
292
- /**
293
- * Callback function for stumbleupon count API
294
- * Gets the stumbleupon counts from response
295
- *
296
- * @param Array $response The response from calling the API
297
- * @return mixed The counts from the API or false if error
298
- */
299
- public function stumbleupon_count_callback($response) {
300
- if($this->has_http_error($response)) {
301
- return false;
302
- }
303
- $body = json_decode($response['body'], true);
304
- // special case: do not return false if views is not set because the api can return it not set
305
- return isset($body['result']['views']) ? intval($body['result']['views']) : 0;
306
- }
307
-
308
-
309
  /**
310
  * Callback function for reddit count API
311
  * Gets the reddit counts from response
@@ -384,6 +276,21 @@ abstract class ShareaholicShareCount {
384
  $body = json_decode($response['body'], true);
385
  return isset($body['count']) ? intval($body['count']) : false;
386
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
387
 
388
  /**
389
  * Callback function for Yummly count API
@@ -409,7 +316,7 @@ abstract class ShareaholicShareCount {
409
  * the keys and the counts as the value.
410
  *
411
  * Example:
412
- * array('facebook' => 12, 'google_plus' => 0, 'twitter' => 14, ...);
413
  *
414
  * @return Array an associative array of service => counts
415
  */
34
  public static function get_services_config() {
35
  return array(
36
  'facebook' => array(
37
+ 'url' => 'https://graph.facebook.com/?fields=og_object{engagement{count}}&id=%s',
38
  'method' => 'GET',
39
  'timeout' => 3, // in number of seconds
40
  'callback' => 'facebook_count_callback',
41
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  'pinterest' => array(
43
  'url' => 'https://api.pinterest.com/v1/urls/count.json?url=%s&callback=f',
44
  'method' => 'GET',
51
  'timeout' => 1,
52
  'callback' => 'buffer_count_callback',
53
  ),
 
 
 
 
 
 
54
  'reddit' => array(
55
+ 'url' => 'https://www.reddit.com/button_info.json?url=%s',
56
  'method' => 'GET',
57
  'timeout' => 1,
58
  'callback' => 'reddit_count_callback',
59
  ),
60
  'vk' => array(
61
+ 'url' => 'https://vk.com/share.php?act=count&url=%s',
62
  'method' => 'GET',
63
  'timeout' => 1,
64
  'callback' => 'vk_count_callback',
65
  ),
66
+ 'tumblr' => array(
67
+ 'url' => 'https://api.tumblr.com/v2/share/stats?url=%s',
68
+ 'method' => 'GET',
69
+ 'timeout' => 1,
70
+ 'callback' => 'tumblr_count_callback',
71
+ ),
72
  'odnoklassniki' => array(
73
  'url' => 'https://connect.ok.ru/dk?st.cmd=extLike&uid=odklcnt0&ref=%s',
74
  'method' => 'GET',
75
  'timeout' => 1,
76
  'callback' => 'odnoklassniki_count_callback',
77
  ),
 
78
  'fancy' => array(
79
+ 'url' => 'https://fancy.com/fancyit/count?ItemURL=%s',
80
  'method' => 'GET',
81
  'timeout' => 1,
82
  'callback' => 'fancy_count_callback',
83
  ),
84
  'yummly' => array(
85
+ 'url' => 'https://www.yummly.com/services/yum-count?url=%s',
86
  'method' => 'GET',
87
  'timeout' => 1,
88
  'callback' => 'yummly_count_callback',
161
  return false;
162
  }
163
  $body = json_decode($response['body'], true);
164
+ return isset($body['og_object']['engagement']['count']) ? intval($body['og_object']['engagement']['count']) : false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  }
166
 
167
 
198
  }
199
 
200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  /**
202
  * Callback function for reddit count API
203
  * Gets the reddit counts from response
276
  $body = json_decode($response['body'], true);
277
  return isset($body['count']) ? intval($body['count']) : false;
278
  }
279
+
280
+ /**
281
+ * Callback function for Tumblr count API
282
+ * Gets the Tumblr counts from response
283
+ *
284
+ * @param Array $response The response from calling the API
285
+ * @return mixed The counts from the API or false if error
286
+ */
287
+ public function tumblr_count_callback($response) {
288
+ if($this->has_http_error($response)) {
289
+ return false;
290
+ }
291
+ $body = json_decode($response['body'], true);
292
+ return isset($body['response']['note_count']) ? intval($body['response']['note_count']) : false;
293
+ }
294
 
295
  /**
296
  * Callback function for Yummly count API
316
  * the keys and the counts as the value.
317
  *
318
  * Example:
319
+ * array('facebook' => 12, 'pinterest' => 0, 'twitter' => 14, ...);
320
  *
321
  * @return Array an associative array of service => counts
322
  */
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: buttons, related posts, google analytics, share buttons, social sharing,
4
  Requires at least: 3.3
5
  Tested up to: 5.1
6
  Requires PHP: 5.2
7
- Stable tag: 8.12.3
8
 
9
 
10
  Boost Audience Engagement with Award Winning Site-Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
@@ -267,6 +267,11 @@ The default Shareaholic thumbnail width is 640px with dynamic height and no crop
267
  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.
268
 
269
  == Changelog ==
 
 
 
 
 
270
  = 8.12.3 (2019-04-10) =
271
  * Enhancement: New Admin UI (Beta) is now localized in Dutch (nl), French (fr), German (de), Italian (it), Japanese (jp), Polish (pl), Portugese (pt), Russian (ru) and Spanish (es)
272
  * Bugfix: All-share panel was hidding icons on the last row
@@ -884,7 +889,7 @@ Each time you change Shareaholic's thumbnail dimensions like this, you will prob
884
  * Show Related Posts data status
885
 
886
  == Upgrade Notice ==
887
- = 8.12.3 =
888
  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!
889
 
890
  = 8.12.1 =
4
  Requires at least: 3.3
5
  Tested up to: 5.1
6
  Requires PHP: 5.2
7
+ Stable tag: 8.12.4
8
 
9
 
10
  Boost Audience Engagement with Award Winning Site-Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
267
  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.
268
 
269
  == Changelog ==
270
+ = 8.12.4 (2019-04-19) =
271
+ * Enhancement: Header now consistent and language localized across all menus
272
+ * Fix: Facebook changed their [Share Count API](https://www.shareaholic.com/sharecounter/?url=https://www.amazon.com/). So, we adapted.
273
+ * Fix: Various updates to Server Side Share Counts service
274
+
275
  = 8.12.3 (2019-04-10) =
276
  * Enhancement: New Admin UI (Beta) is now localized in Dutch (nl), French (fr), German (de), Italian (it), Japanese (jp), Polish (pl), Portugese (pt), Russian (ru) and Spanish (es)
277
  * Bugfix: All-share panel was hidding icons on the last row
889
  * Show Related Posts data status
890
 
891
  == Upgrade Notice ==
892
+ = 8.12.4 =
893
  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!
894
 
895
  = 8.12.1 =
shareaholic.php CHANGED
@@ -3,14 +3,14 @@
3
  * The main file!
4
  *
5
  * @package shareaholic
6
- * @version 8.12.3
7
  */
8
 
9
  /*
10
  Plugin Name: Fast Share Buttons, Analytics, Related Posts and More - Shareaholic
11
  Plugin URI: https://www.shareaholic.com/website-tools/
12
  Description: The award winning all-in-one Social Media and Related Posts solution for WordPress. Get found on social and grow your following. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for settings.
13
- Version: 8.12.3
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.12.3';
65
 
66
  /**
67
  * Starts off as false so that ::get_instance() returns
3
  * The main file!
4
  *
5
  * @package shareaholic
6
+ * @version 8.12.4
7
  */
8
 
9
  /*
10
  Plugin Name: Fast Share Buttons, Analytics, Related Posts and More - Shareaholic
11
  Plugin URI: https://www.shareaholic.com/website-tools/
12
  Description: The award winning all-in-one Social Media and Related Posts solution for WordPress. Get found on social and grow your following. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for settings.
13
+ Version: 8.12.4
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.12.4';
65
 
66
  /**
67
  * Starts off as false so that ::get_instance() returns
templates/advanced_settings.php CHANGED
@@ -1,4 +1,16 @@
1
  <?php ShareaholicAdmin::show_header(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
2
  <div class='wrap'>
3
  <h2><?php _e('Advanced Settings', 'shareaholic'); ?></h2>
4
  <div style="margin-top:10px;"></div>
1
  <?php ShareaholicAdmin::show_header(); ?>
2
+
3
+ <script>
4
+ window.ShareaholicConfig = {
5
+ apiHost: "<?php echo Shareaholic::API_URL ?>",
6
+ serviceHost: "<?php echo Shareaholic::URL ?>",
7
+ assetHost: "<?php echo ShareaholicUtilities::asset_url_admin() ?>",
8
+ assetFolders: true,
9
+ origin: "wp_plugin",
10
+ language: "<?php echo strtolower(get_bloginfo('language')) ?>"
11
+ };
12
+ </script>
13
+
14
  <div class='wrap'>
15
  <h2><?php _e('Advanced Settings', 'shareaholic'); ?></h2>
16
  <div style="margin-top:10px;"></div>
templates/settings.php CHANGED
@@ -1,4 +1,16 @@
1
  <?php ShareaholicAdmin::show_header(); ?>
 
 
 
 
 
 
 
 
 
 
 
 
2
  <div class='wrap'>
3
  <h2><?php echo sprintf(__('App Manager', 'shareaholic')); ?></h2>
4
 
1
  <?php ShareaholicAdmin::show_header(); ?>
2
+
3
+ <script>
4
+ window.ShareaholicConfig = {
5
+ apiHost: "<?php echo Shareaholic::API_URL ?>",
6
+ serviceHost: "<?php echo Shareaholic::URL ?>",
7
+ assetHost: "<?php echo ShareaholicUtilities::asset_url_admin() ?>",
8
+ assetFolders: true,
9
+ origin: "wp_plugin",
10
+ language: "<?php echo strtolower(get_bloginfo('language')) ?>"
11
+ };
12
+ </script>
13
+
14
  <div class='wrap'>
15
  <h2><?php echo sprintf(__('App Manager', 'shareaholic')); ?></h2>
16