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

Version Description

  • Enhancement: Detect permalink changes in order to serve up-to-date content
Download this release

Release Info

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

Code changes from version 7.6.1.7 to 7.6.1.8

Files changed (3) hide show
  1. readme.txt +9 -3
  2. shareaholic.php +9 -3
  3. utilities.php +16 -3
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Shareaholic | share buttons, related posts, social analytics & more ===
2
  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.2
6
- Stable tag: 7.6.1.7
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.7 =
174
  * Bugfix: fix issue with Server side share count option
175
 
@@ -1213,6 +1216,9 @@ Please see here: [Usage & Installation Instructions](http://support.shareaholic.
1213
 
1214
  == Upgrade Notice ==
1215
 
 
 
 
1216
  = 7.6.1.7 =
1217
  * Bugfix: fix issue with Server side share count option
1218
 
1
  === Shareaholic | share buttons, related posts, social analytics & more ===
2
  Contributors: shareaholic
3
+ Tags: shareaholic, shareholic, sexybookmarks, recommendations, related content, cookie consent, share buttons, email button, social sharing, social bookmarking, share image, image sharing, follow buttons, floated share buttons, floating share buttons, analytics, social media, social plugin, facebook, twitter, google plus, google bookmarks, gmail, linkedin, pinterest, reddit, tumblr, evernote, digg, delicious, stumbleupon, printfriendly, fancy, amazon, xing, vk, yahoo, mister wong, viadeo, odnoklassniki box.net, diigo, yammer, ycombinator, hotmail, instapaper, mixi, arto, whatsapp, hootsuite, inbound.org, plurk, aim, buffer, meneame, pinboard.in, stumpedia, bitly, blogger, yummly, izeby, kaboodle, weibo, instagram, tinyurl, typepad, weheartit, flipboard, pocket, wanelo, fark, wykop, symphony, kindle, houzz, youtube, sms, onenote
4
  Requires at least: 3.0
5
+ Tested up to: 4.2.4
6
+ Stable tag: 7.6.1.8
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.8 =
174
+ * Enhancement: Detect permalink changes in order to serve up-to-date content
175
+
176
  = 7.6.1.7 =
177
  * Bugfix: fix issue with Server side share count option
178
 
1216
 
1217
  == Upgrade Notice ==
1218
 
1219
+ = 7.6.1.8 =
1220
+ * Enhancement: Detect permalink changes in order to serve up-to-date content
1221
+
1222
  = 7.6.1.7 =
1223
  * Bugfix: fix issue with Server side share count option
1224
 
shareaholic.php CHANGED
@@ -3,14 +3,14 @@
3
  * The main file!
4
  *
5
  * @package shareaholic
6
- * @version 7.6.1.7
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.7
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.7';
68
 
69
  /**
70
  * Starts off as false so that ::get_instance() returns
@@ -132,6 +132,12 @@ if (!class_exists('Shareaholic')) {
132
 
133
  // Add custom action to run Shareaholic cron job
134
  add_action('shareaholic_remove_transients_hourly', array('ShareaholicCron', 'remove_transients'));
 
 
 
 
 
 
135
  }
136
 
137
  /**
3
  * The main file!
4
  *
5
  * @package shareaholic
6
+ * @version 7.6.1.8
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.8
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.8';
68
 
69
  /**
70
  * Starts off as false so that ::get_instance() returns
132
 
133
  // Add custom action to run Shareaholic cron job
134
  add_action('shareaholic_remove_transients_hourly', array('ShareaholicCron', 'remove_transients'));
135
+
136
+ // do something before a post is updated
137
+ add_action('pre_post_update', array('ShareaholicUtilities', 'before_post_is_updated'));
138
+
139
+ // do something before a site's permalink structure changes
140
+ add_action('update_option_permalink_structure', array('ShareaholicUtilities', 'notify_content_manager_sitemap'));
141
  }
142
 
143
  /**
utilities.php CHANGED
@@ -894,7 +894,7 @@ class ShareaholicUtilities {
894
  if ($post == NULL) {
895
  return false;
896
  }
897
-
898
  if (in_array($post->post_status, array('draft', 'pending', 'auto-draft'))) {
899
  // Get the correct permalink for a draft
900
  $my_post = clone $post;
@@ -922,8 +922,8 @@ class ShareaholicUtilities {
922
  *
923
  * @param string $domain
924
  */
925
- public static function notify_content_manager_sitemap() {
926
- $text_sitemap_url = admin_url('admin-ajax.php') . '?action=shareaholic_permalink_list&n=500&format=text';
927
 
928
  $cm_sitemap_job_url = Shareaholic::CM_API_URL . '/jobs/sitemap';
929
  $payload = array (
@@ -1271,6 +1271,19 @@ class ShareaholicUtilities {
1271
  return 'SUCCESS';
1272
  }
1273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1274
  /**
1275
  * This is a wrapper for the Recommendations API
1276
  *
894
  if ($post == NULL) {
895
  return false;
896
  }
897
+
898
  if (in_array($post->post_status, array('draft', 'pending', 'auto-draft'))) {
899
  // Get the correct permalink for a draft
900
  $my_post = clone $post;
922
  *
923
  * @param string $domain
924
  */
925
+ public static function notify_content_manager_sitemap() {
926
+ $text_sitemap_url = admin_url('admin-ajax.php') . '?action=shareaholic_permalink_list&n=1000&format=text';
927
 
928
  $cm_sitemap_job_url = Shareaholic::CM_API_URL . '/jobs/sitemap';
929
  $payload = array (
1271
  return 'SUCCESS';
1272
  }
1273
 
1274
+
1275
+ /**
1276
+ * Call the content manager for a post before it is updated
1277
+ *
1278
+ * We do this because a user may change their permalink
1279
+ * and so we tell CM that the old permalink is not longer valid
1280
+ *
1281
+ */
1282
+ public static function before_post_is_updated($post_id) {
1283
+ ShareaholicUtilities::notify_content_manager_singlepage(get_post($post_id));
1284
+ }
1285
+
1286
+
1287
  /**
1288
  * This is a wrapper for the Recommendations API
1289
  *