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

Version Description

  • Various performance updates and bug fixes
Download this release

Release Info

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

Code changes from version 8.7.0 to 8.7.1

Files changed (5) hide show
  1. public.php +24 -12
  2. public_js.php +2 -1
  3. readme.txt +8 -1
  4. shareaholic.php +4 -5
  5. utilities.php +0 -20
public.php CHANGED
@@ -70,7 +70,8 @@ class ShareaholicPublic {
70
  '//grace.shareaholic.com',
71
  '//analytics.shareaholic.com',
72
  '//recs.shareaholic.com',
73
- '//go.shareaholic.com'
 
74
  );
75
  }
76
  }
@@ -831,7 +832,7 @@ class ShareaholicPublic {
831
  }
832
 
833
  /**
834
- * Function to return related permalinks for a given permalink to bootstrap the Related Content app until the off-line processing routines complete
835
  *
836
  * @return list of related permalinks in JSON
837
  */
@@ -866,18 +867,29 @@ class ShareaholicPublic {
866
  }
867
 
868
  if ($match == "random"){
869
- $args = array( 'posts_per_page' => $n, 'orderby' => 'rand' );
 
 
 
 
 
870
  $rand_posts = get_posts( $args );
871
  foreach ( $rand_posts as $post ){
872
- $related_link = array(
873
- 'page_id' => $post->ID,
874
- 'url' => get_permalink($post->ID),
875
- 'title' => $post->post_title,
876
- 'description' => $post->post_excerpt,
877
- 'image_url' => ShareaholicUtilities::permalink_thumbnail($post->ID),
878
- 'score' => 1
879
- );
880
- array_push($related_permalink_list, $related_link);
 
 
 
 
 
 
881
  }
882
  wp_reset_postdata();
883
  } else {
70
  '//grace.shareaholic.com',
71
  '//analytics.shareaholic.com',
72
  '//recs.shareaholic.com',
73
+ '//go.shareaholic.com',
74
+ '//partner.shareaholic.com'
75
  );
76
  }
77
  }
832
  }
833
 
834
  /**
835
+ * Function to return related permalinks for a given permalink to bootstrap the Related Posts app until cloud-based processing routines complete
836
  *
837
  * @return list of related permalinks in JSON
838
  */
867
  }
868
 
869
  if ($match == "random"){
870
+ // Determine which page types to show
871
+ $post_types = get_post_types(array("public" => true));
872
+ $post_types_filtered = array_diff($post_types, ["page", "attachment"]);
873
+
874
+ // Query
875
+ $args = array( 'post_type' => $post_types_filtered, 'posts_per_page' => $n, 'orderby' => 'rand' );
876
  $rand_posts = get_posts( $args );
877
  foreach ( $rand_posts as $post ){
878
+ if ($post->post_title) {
879
+ $related_link = array(
880
+ 'page_id' => $post->ID,
881
+ 'url' => get_permalink($post->ID),
882
+ 'display_url' => get_permalink($post->ID),
883
+ 'title' => $post->post_title,
884
+ 'description' => $post->post_excerpt,
885
+ 'author' => get_userdata($post->post_author)->display_name,
886
+ 'published_date' => get_the_date( DATE_W3C ),
887
+ 'modified_date' => get_the_modified_date( DATE_W3C ),
888
+ 'image_url' => preg_replace('#^https?://#', '//', ShareaholicUtilities::permalink_thumbnail($post->ID)),
889
+ 'score' => 1
890
+ );
891
+ array_push($related_permalink_list, $related_link);
892
+ }
893
  }
894
  wp_reset_postdata();
895
  } else {
public_js.php CHANGED
@@ -19,7 +19,8 @@ class ShareaholicPublicJS {
19
  public static function get_base_settings() {
20
  $base_settings = array(
21
  'endpoints' => array(
22
- 'local_recs_url' => admin_url('admin-ajax.php') . '?action=shareaholic_permalink_related'
 
23
  )
24
  );
25
 
19
  public static function get_base_settings() {
20
  $base_settings = array(
21
  'endpoints' => array(
22
+ 'local_recs_url' => admin_url('admin-ajax.php') . '?action=shareaholic_permalink_related',
23
+ 'ajax_url' => admin_url('admin-ajax.php')
24
  )
25
  );
26
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: shareaholic
3
  Tags: Social Tools, 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, izeby, kaboodle, kik, kindle, line, linkedin, livejournal, meneame, mister wong, 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, weheartit, weibo, whatsapp, wykop, xing, yahoo, yammer, ycombinator, hacker news, youtube, yummly, zillow
4
  Requires at least: 3.0
5
  Tested up to: 4.9
6
- Stable tag: 8.7.0
7
 
8
  Consolidate plugins with a high-speed suite of social tools: social share buttons, related content, related posts, ad monetization & Google Analytics.
9
 
@@ -225,6 +225,10 @@ The default Shareaholic thumbnail width is 640px with dynamic height and no crop
225
  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.
226
 
227
  == Changelog ==
 
 
 
 
228
  = 8.7.0 (2018-06-04) =
229
  * Performance Enhancement: Settings file is now loaded from a globally distributed CDN (Amazon), which will make Shareaholic faster on your site
230
  * Performance Enhancement: Added support for DNS-Prefetch and Preload which will make Shareaholic EVEN FASTER!!
@@ -735,6 +739,9 @@ Each time you change Shareaholic's thumbnail dimensions like this, you will prob
735
  * Show Related Posts data status
736
 
737
  == Upgrade Notice ==
 
 
 
738
  = 8.7.0 =
739
  * Several performance upgrades to make Shareaholic EVEN FASTER!!
740
 
3
  Tags: Social Tools, 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, izeby, kaboodle, kik, kindle, line, linkedin, livejournal, meneame, mister wong, 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, weheartit, weibo, whatsapp, wykop, xing, yahoo, yammer, ycombinator, hacker news, youtube, yummly, zillow
4
  Requires at least: 3.0
5
  Tested up to: 4.9
6
+ Stable tag: 8.7.1
7
 
8
  Consolidate plugins with a high-speed suite of social tools: social share buttons, related content, related posts, ad monetization & Google Analytics.
9
 
225
  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.
226
 
227
  == Changelog ==
228
+ = 8.7.1 (2018-06-10) =
229
+ * Enhancements: Improvements to installation flow
230
+ * General cleanup
231
+
232
  = 8.7.0 (2018-06-04) =
233
  * Performance Enhancement: Settings file is now loaded from a globally distributed CDN (Amazon), which will make Shareaholic faster on your site
234
  * Performance Enhancement: Added support for DNS-Prefetch and Preload which will make Shareaholic EVEN FASTER!!
739
  * Show Related Posts data status
740
 
741
  == Upgrade Notice ==
742
+ = 8.7.1 =
743
+ * Various performance updates and bug fixes
744
+
745
  = 8.7.0 =
746
  * Several performance upgrades to make Shareaholic EVEN FASTER!!
747
 
shareaholic.php CHANGED
@@ -3,14 +3,14 @@
3
  * The main file!
4
  *
5
  * @package shareaholic
6
- * @version 8.7.0
7
  */
8
 
9
  /*
10
  Plugin Name: Shareaholic | share buttons, analytics, related posts
11
  Plugin URI: https://shareaholic.com/publishers/
12
  Description: The world's leading all-in-one Audience Amplification Platform that helps grow your website traffic, engagement, conversions & monetization. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for more settings.
13
- Version: 8.7.0
14
  Author: Shareaholic
15
  Author URI: https://shareaholic.com
16
  Text Domain: shareaholic
@@ -63,7 +63,7 @@ if (!class_exists('Shareaholic')) {
63
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
64
  const REC_API_URL = 'http://recommendations.shareaholic.com';
65
 
66
- const VERSION = '8.7.0';
67
 
68
  /**
69
  * Starts off as false so that ::get_instance() returns
@@ -139,7 +139,7 @@ if (!class_exists('Shareaholic')) {
139
  add_action('pre_post_update', array('ShareaholicUtilities', 'before_post_is_updated'));
140
 
141
  // do something before a site's permalink structure changes
142
- add_action('update_option_permalink_structure', array('ShareaholicUtilities', 'notify_content_manager_sitemap'));
143
 
144
  // Show ToS notice
145
  if (!ShareaholicUtilities::has_accepted_terms_of_service()) {
@@ -238,7 +238,6 @@ if (!class_exists('Shareaholic')) {
238
  add_option( 'Activated_Plugin_Shareaholic', 'shareaholic' );
239
  $api_key = ShareaholicUtilities::get_option('api_key');
240
  if (ShareaholicUtilities::has_accepted_terms_of_service() && !empty($api_key)) {
241
- ShareaholicUtilities::notify_content_manager_sitemap();
242
  ShareaholicUtilities::notify_content_manager_singledomain();
243
  }
244
 
3
  * The main file!
4
  *
5
  * @package shareaholic
6
+ * @version 8.7.1
7
  */
8
 
9
  /*
10
  Plugin Name: Shareaholic | share buttons, analytics, related posts
11
  Plugin URI: https://shareaholic.com/publishers/
12
  Description: The world's leading all-in-one Audience Amplification Platform that helps grow your website traffic, engagement, conversions & monetization. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for more settings.
13
+ Version: 8.7.1
14
  Author: Shareaholic
15
  Author URI: https://shareaholic.com
16
  Text Domain: shareaholic
63
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
64
  const REC_API_URL = 'http://recommendations.shareaholic.com';
65
 
66
+ const VERSION = '8.7.1';
67
 
68
  /**
69
  * Starts off as false so that ::get_instance() returns
139
  add_action('pre_post_update', array('ShareaholicUtilities', 'before_post_is_updated'));
140
 
141
  // do something before a site's permalink structure changes
142
+ add_action('update_option_permalink_structure', array('ShareaholicUtilities', 'notify_content_manager_singledomain'));
143
 
144
  // Show ToS notice
145
  if (!ShareaholicUtilities::has_accepted_terms_of_service()) {
238
  add_option( 'Activated_Plugin_Shareaholic', 'shareaholic' );
239
  $api_key = ShareaholicUtilities::get_option('api_key');
240
  if (ShareaholicUtilities::has_accepted_terms_of_service() && !empty($api_key)) {
 
241
  ShareaholicUtilities::notify_content_manager_singledomain();
242
  }
243
 
utilities.php CHANGED
@@ -355,7 +355,6 @@ class ShareaholicUtilities {
355
  /*
356
  $api_key = ShareaholicUtilities::get_option('api_key');
357
  if (ShareaholicUtilities::has_accepted_terms_of_service() && !empty($api_key)) {
358
- ShareaholicUtilities::notify_content_manager_sitemap();
359
  ShareaholicUtilities::notify_content_manager_singledomain();
360
  }
361
  */
@@ -1042,25 +1041,6 @@ class ShareaholicUtilities {
1042
  }
1043
  }
1044
  }
1045
-
1046
- /**
1047
- * Wrapper for the Shareaholic Content Manager Single Domain worker API
1048
- *
1049
- * @param string $domain
1050
- */
1051
- public static function notify_content_manager_sitemap() {
1052
- $text_sitemap_url = admin_url('admin-ajax.php') . '?action=shareaholic_permalink_list&n=1000&format=text';
1053
-
1054
- $cm_sitemap_job_url = Shareaholic::CM_API_URL . '/jobs/sitemap';
1055
- $payload = array (
1056
- 'args' => array (
1057
- $text_sitemap_url,
1058
- array ('force' => true)
1059
- )
1060
- );
1061
-
1062
- $response = ShareaholicCurl::post($cm_sitemap_job_url, $payload, 'json');
1063
- }
1064
 
1065
  /**
1066
  * Wrapper for the Shareaholic Content Manager Single Domain worker API
355
  /*
356
  $api_key = ShareaholicUtilities::get_option('api_key');
357
  if (ShareaholicUtilities::has_accepted_terms_of_service() && !empty($api_key)) {
 
358
  ShareaholicUtilities::notify_content_manager_singledomain();
359
  }
360
  */
1041
  }
1042
  }
1043
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1044
 
1045
  /**
1046
  * Wrapper for the Shareaholic Content Manager Single Domain worker API