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

Version Description

  • Enhancement: added support for Yummly and Fancy server-side share counts
Download this release

Release Info

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

Code changes from version 7.6.1.4 to 7.6.1.5

lib/social-share-counts/share_count.php CHANGED
@@ -102,6 +102,18 @@ abstract class ShareaholicShareCount {
102
  'timeout' => 1,
103
  'callback' => 'odnoklassniki_count_callback',
104
  ),
 
 
 
 
 
 
 
 
 
 
 
 
105
  );
106
  }
107
 
@@ -395,7 +407,43 @@ abstract class ShareaholicShareCount {
395
  return isset($matches[1]) ? intval($matches[1]) : false;
396
  }
397
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
398
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  /**
400
  * The abstract function to be implemented by its children
401
  * This function should get all the counts for the
102
  'timeout' => 1,
103
  'callback' => 'odnoklassniki_count_callback',
104
  ),
105
+ 'fancy' => array(
106
+ 'url' => 'http://fancy.com/fancyit/count?ItemURL=%s',
107
+ 'method' => 'GET',
108
+ 'timeout' => 1,
109
+ 'callback' => 'fancy_count_callback',
110
+ ),
111
+ 'yummly' => array(
112
+ 'url' => 'http://www.yummly.com/services/yum-count?url=%s',
113
+ 'method' => 'GET',
114
+ 'timeout' => 1,
115
+ 'callback' => 'yummly_count_callback',
116
+ ),
117
  );
118
  }
119
 
407
  return isset($matches[1]) ? intval($matches[1]) : false;
408
  }
409
 
410
+ /**
411
+ * Callback function for Fancy count API
412
+ * Gets the Fancy counts from response
413
+ *
414
+ * @param Array $response The response from calling the API
415
+ * @return mixed The counts from the API or false if error
416
+ */
417
+ public function fancy_count_callback($response) {
418
+ if($this->has_http_error($response)) {
419
+ return false;
420
+ }
421
+
422
+ // Fancy always provides a JS callback like this in the response:
423
+ // '__FIB.collectCount({"url": "http://www.google.com", "count": 26, "thing_url": "http://fancy.com/things/263001623/Google%27s-Jim-Henson-75th-Anniversary-logo", "showcount": 1});'
424
+ // strip out the callback and parse the JSON from there
425
+ $response['body'] = str_replace('__FIB.collectCount(', '', $response['body']);
426
+ $response['body'] = substr($response['body'], 0, strlen($response['body']) - 2);
427
 
428
+ $body = json_decode($response['body'], true);
429
+ return isset($body['count']) ? intval($body['count']) : false;
430
+ }
431
+
432
+ /**
433
+ * Callback function for Yummly count API
434
+ * Gets the Yummly counts from response
435
+ *
436
+ * @param Array $response The response from calling the API
437
+ * @return mixed The counts from the API or false if error
438
+ */
439
+ public function yummly_count_callback($response) {
440
+ if($this->has_http_error($response)) {
441
+ return false;
442
+ }
443
+ $body = json_decode($response['body'], true);
444
+ return isset($body['count']) ? intval($body['count']) : false;
445
+ }
446
+
447
  /**
448
  * The abstract function to be implemented by its children
449
  * This function should get all the counts for the
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: shareaholic
3
  Tags: sexybookmarks, shareaholic, shareholic, recommendations, related content, cookie consent, share buttons, email button, social sharing, social bookmarking, share image, image sharing, follow buttons, floated share buttons, analytics, social media, social plugin
4
  Requires at least: 3.0
5
  Tested up to: 4.2.1
6
- Stable tag: 7.6.1.4
7
 
8
  The easiest, most effective way to grow your website traffic, effectively engage your audience, monetize, and gain insights for free.
9
 
@@ -170,6 +170,9 @@ Please see here: [Usage & Installation Instructions](http://support.shareaholic.
170
 
171
  == Changelog ==
172
 
 
 
 
173
  = 7.6.1.4 =
174
  * Minor enhancements
175
 
@@ -1204,6 +1207,9 @@ Please see here: [Usage & Installation Instructions](http://support.shareaholic.
1204
 
1205
  == Upgrade Notice ==
1206
 
 
 
 
1207
  = 7.6.1.4 =
1208
  Minor enhancements.
1209
 
3
  Tags: sexybookmarks, shareaholic, shareholic, recommendations, related content, cookie consent, share buttons, email button, social sharing, social bookmarking, share image, image sharing, follow buttons, floated share buttons, analytics, social media, social plugin
4
  Requires at least: 3.0
5
  Tested up to: 4.2.1
6
+ Stable tag: 7.6.1.5
7
 
8
  The easiest, most effective way to grow your website traffic, effectively engage your audience, monetize, and gain insights for free.
9
 
170
 
171
  == Changelog ==
172
 
173
+ = 7.6.1.5 =
174
+ * Enhancement: added support for Yummly and Fancy server-side share counts
175
+
176
  = 7.6.1.4 =
177
  * Minor enhancements
178
 
1207
 
1208
  == Upgrade Notice ==
1209
 
1210
+ = 7.6.1.5 =
1211
+ * Enhancement: added support for Yummly and Fancy server-side share counts
1212
+
1213
  = 7.6.1.4 =
1214
  Minor enhancements.
1215
 
shareaholic.php CHANGED
@@ -3,14 +3,14 @@
3
  * The main file!
4
  *
5
  * @package shareaholic
6
- * @version 7.6.1.4
7
  */
8
 
9
  /*
10
  Plugin Name: Shareaholic | share buttons, analytics, related content
11
  Plugin URI: https://shareaholic.com/publishers/
12
  Description: Whether you want to get people sharing, grow your fans, make money, or know who's reading your content, Shareaholic will help you get it done. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for more settings.
13
- Version: 7.6.1.4
14
  Author: Shareaholic
15
  Author URI: https://shareaholic.com
16
  Text Domain: shareaholic
@@ -64,7 +64,7 @@ if (!class_exists('Shareaholic')) {
64
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
65
  const REC_API_URL = 'http://recommendations.shareaholic.com';
66
 
67
- const VERSION = '7.6.1.4';
68
 
69
  /**
70
  * Starts off as false so that ::get_instance() returns
3
  * The main file!
4
  *
5
  * @package shareaholic
6
+ * @version 7.6.1.5
7
  */
8
 
9
  /*
10
  Plugin Name: Shareaholic | share buttons, analytics, related content
11
  Plugin URI: https://shareaholic.com/publishers/
12
  Description: Whether you want to get people sharing, grow your fans, make money, or know who's reading your content, Shareaholic will help you get it done. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for more settings.
13
+ Version: 7.6.1.5
14
  Author: Shareaholic
15
  Author URI: https://shareaholic.com
16
  Text Domain: shareaholic
64
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
65
  const REC_API_URL = 'http://recommendations.shareaholic.com';
66
 
67
+ const VERSION = '7.6.1.5';
68
 
69
  /**
70
  * Starts off as false so that ::get_instance() returns
templates/header.php CHANGED
@@ -20,6 +20,9 @@ window.shareaholic_add_location_nonce = '<?php echo wp_create_nonce("shareaholic
20
  <nav class="header-nav">
21
  </nav>
22
  <ul class="user-nav js-logged-out" style="display:none;">
 
 
 
23
  <li><a href="#" class="btn dark-green js-action-signup">Sign Up Free</a></li>
24
  <li><a href="#" class="btn js-action-login">Log In</a></li>
25
  </ul>
@@ -39,6 +42,9 @@ window.shareaholic_add_location_nonce = '<?php echo wp_create_nonce("shareaholic
39
  <li><a href="#" class="help js-action-help" target="_blank">Help</a></li>
40
  </ul>
41
  <img class="avatar js-avatar">
 
 
 
42
  </div>
43
  <!-- Mobile Start -->
44
  <a href="#" class="mobile-menu-link"><span class="fa fa-bars"></span></a>
20
  <nav class="header-nav">
21
  </nav>
22
  <ul class="user-nav js-logged-out" style="display:none;">
23
+ <div class="hiring">
24
+ <a href="https://shareaholic.com/careers?utm_source=univ_header_wp_plugin&utm_medium=link&utm_campaign=careers" target="_blank">We're Hiring</a>
25
+ </div>
26
  <li><a href="#" class="btn dark-green js-action-signup">Sign Up Free</a></li>
27
  <li><a href="#" class="btn js-action-login">Log In</a></li>
28
  </ul>
42
  <li><a href="#" class="help js-action-help" target="_blank">Help</a></li>
43
  </ul>
44
  <img class="avatar js-avatar">
45
+ <div class="hiring">
46
+ <a href="https://shareaholic.com/careers?utm_source=univ_header_wp_plugin&utm_medium=link&utm_campaign=careers" target="_blank">We're Hiring</a>
47
+ </div>
48
  </div>
49
  <!-- Mobile Start -->
50
  <a href="#" class="mobile-menu-link"><span class="fa fa-bars"></span></a>