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

Version Description

Various Related Posts enhancements

Download this release

Release Info

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

Code changes from version 8.8.1 to 8.8.2

public.php CHANGED
@@ -850,6 +850,7 @@ class ShareaholicPublic {
850
  if ($permalink == NULL){
851
  // default to random match if no permalink is available
852
  $match = "random";
 
853
  } else {
854
  $post_id = url_to_postid($permalink);
855
 
@@ -865,36 +866,37 @@ class ShareaholicPublic {
865
  }
866
  }
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_exclude = array('page', 'attachment', 'nav_menu_item');
873
- $post_types_filtered = array_diff($post_types, $post_types_exclude);
874
-
875
  // Query
876
- $args = array( 'post_type' => $post_types_filtered, 'posts_per_page' => $n, 'orderby' => 'rand' );
877
  $rand_posts = get_posts( $args );
878
  foreach ( $rand_posts as $post ){
879
  if ($post->post_title) {
880
  $related_link = array(
881
- 'page_id' => $post->ID,
882
  'url' => get_permalink($post->ID),
883
- 'display_url' => get_permalink($post->ID),
884
  'title' => $post->post_title,
885
  'description' => $post->post_excerpt,
886
  'author' => get_userdata($post->post_author)->display_name,
 
 
887
  'published_date' => get_the_date( DATE_W3C ),
888
  'modified_date' => get_the_modified_date( DATE_W3C ),
889
- 'image_url' => preg_replace('#^https?://#', '//', ShareaholicUtilities::permalink_thumbnail($post->ID)),
890
- 'score' => 1
891
  );
892
  array_push($related_permalink_list, $related_link);
893
  }
894
  }
895
  wp_reset_postdata();
896
  } else {
897
- // other methods coming soon
898
  }
899
 
900
  // Construct results array
850
  if ($permalink == NULL){
851
  // default to random match if no permalink is available
852
  $match = "random";
853
+ $post_id = 0;
854
  } else {
855
  $post_id = url_to_postid($permalink);
856
 
866
  }
867
  }
868
  }
869
+
870
  if ($match == "random"){
871
  // Determine which page types to show
872
  $post_types = get_post_types(array('public' => true));
873
+ $post_types_exclude = array('page', 'attachment', 'nav_menu_item');
874
+ $post_types_filtered = array_diff($post_types, $post_types_exclude);
875
+
876
  // Query
877
+ $args = array( 'post_type' => $post_types_filtered, 'post__not_in' => array($post_id), 'posts_per_page' => $n, 'orderby' => 'rand' );
878
  $rand_posts = get_posts( $args );
879
  foreach ( $rand_posts as $post ){
880
  if ($post->post_title) {
881
  $related_link = array(
882
+ 'content_id' => $post->ID,
883
  'url' => get_permalink($post->ID),
 
884
  'title' => $post->post_title,
885
  'description' => $post->post_excerpt,
886
  'author' => get_userdata($post->post_author)->display_name,
887
+ 'image_url' => preg_replace('#^https?://#', '//', ShareaholicUtilities::permalink_thumbnail($post->ID)),
888
+ 'score' => 1,
889
  'published_date' => get_the_date( DATE_W3C ),
890
  'modified_date' => get_the_modified_date( DATE_W3C ),
891
+ 'channel_id' => 'plugin',
892
+ 'display_url' => get_permalink($post->ID),
893
  );
894
  array_push($related_permalink_list, $related_link);
895
  }
896
  }
897
  wp_reset_postdata();
898
  } else {
899
+ // other match methods can be added here
900
  }
901
 
902
  // Construct results array
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.8.1
8
 
9
  Consolidate plugins with a high-speed suite of social tools: social share buttons, related content, related posts, ad monetization & Google Analytics.
10
 
@@ -247,6 +247,10 @@ The default Shareaholic thumbnail width is 640px with dynamic height and no crop
247
  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.
248
 
249
  == Changelog ==
 
 
 
 
250
  = 8.8.1 (2018-07-31) =
251
  * General maintenance release
252
 
@@ -772,30 +776,31 @@ Each time you change Shareaholic's thumbnail dimensions like this, you will prob
772
 
773
  == Upgrade Notice ==
774
 
775
- == Changelog ==
 
 
776
  = 8.8.1 =
777
- * General maintenance release
778
 
779
  = 8.8.0 =
780
- * Fixed Share Buttons configurator. Icon drag and drop now works. Update also includes new theme options for Related Posts.
781
 
782
  = 8.7.2 =
783
- * Various performance updates and bug fixes
784
 
785
  = 8.7.1 =
786
- * Various performance updates and bug fixes
787
 
788
  = 8.7.0 =
789
  * Several performance upgrades to make Shareaholic EVEN FASTER!!
790
-
791
  * Performance Enhancement: Settings file is now loaded from a globally distributed CDN (Amazon), which will make Shareaholic faster on your site
792
  * Performance Enhancement: Added support for DNS-Prefetch and Preload which will make Shareaholic EVEN FASTER!!
793
 
794
  = 8.6.7 =
795
- * Fixed bug where share buttons and other apps were showing up intermittently due to a race condition in the loading sequence
796
 
797
  = 8.6.6 =
798
- * New: You can now set custom Related Posts thumbnail dimensions. See [FAQ in the readme](https://wordpress.org/plugins/shareaholic/) if you would like to change the thumbnail size.
799
 
800
  = 8.6.5 =
801
  We've improved the server connectivity check. If you've been getting the 'retry' error message after installing Shareaholic, this one is for you.
4
  Requires at least: 3.0
5
  Tested up to: 5.0
6
  Requires PHP: 5.2
7
+ Stable tag: 8.8.2
8
 
9
  Consolidate plugins with a high-speed suite of social tools: social share buttons, related content, related posts, ad monetization & Google Analytics.
10
 
247
  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.
248
 
249
  == Changelog ==
250
+
251
+ = 8.8.2 (2018-08-08) =
252
+ * Various [Related Posts](https://www.shareaholic.com/website-tools/related-content) enhancements
253
+
254
  = 8.8.1 (2018-07-31) =
255
  * General maintenance release
256
 
776
 
777
  == Upgrade Notice ==
778
 
779
+ = 8.8.2 =
780
+ Various [Related Posts](https://www.shareaholic.com/website-tools/related-content) enhancements
781
+
782
  = 8.8.1 =
783
+ General maintenance release
784
 
785
  = 8.8.0 =
786
+ Fixed Share Buttons configurator. Icon drag and drop now works. Update also includes new theme options for Related Posts.
787
 
788
  = 8.7.2 =
789
+ Various performance updates and bug fixes
790
 
791
  = 8.7.1 =
792
+ Various performance updates and bug fixes
793
 
794
  = 8.7.0 =
795
  * Several performance upgrades to make Shareaholic EVEN FASTER!!
 
796
  * Performance Enhancement: Settings file is now loaded from a globally distributed CDN (Amazon), which will make Shareaholic faster on your site
797
  * Performance Enhancement: Added support for DNS-Prefetch and Preload which will make Shareaholic EVEN FASTER!!
798
 
799
  = 8.6.7 =
800
+ Fixed bug where share buttons and other apps were showing up intermittently due to a race condition in the loading sequence
801
 
802
  = 8.6.6 =
803
+ New: You can now set custom Related Posts thumbnail dimensions. See [FAQ in the readme](https://wordpress.org/plugins/shareaholic/) if you would like to change the thumbnail size.
804
 
805
  = 8.6.5 =
806
  We've improved the server connectivity check. If you've been getting the 'retry' error message after installing Shareaholic, this one is for you.
shareaholic.php CHANGED
@@ -3,14 +3,14 @@
3
  * The main file!
4
  *
5
  * @package shareaholic
6
- * @version 8.8.1
7
  */
8
 
9
  /*
10
  Plugin Name: Shareaholic | share buttons, analytics, related posts
11
  Plugin URI: https://www.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.8.1
14
  Author: Shareaholic
15
  Author URI: https://www.shareaholic.com
16
  Text Domain: shareaholic
@@ -61,9 +61,8 @@ if (!class_exists('Shareaholic')) {
61
  const URL = 'https://www.shareaholic.com';
62
  const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
63
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
64
- const REC_API_URL = 'https://recommendations.shareaholic.com';
65
 
66
- const VERSION = '8.8.1';
67
 
68
  /**
69
  * Starts off as false so that ::get_instance() returns
3
  * The main file!
4
  *
5
  * @package shareaholic
6
+ * @version 8.8.2
7
  */
8
 
9
  /*
10
  Plugin Name: Shareaholic | share buttons, analytics, related posts
11
  Plugin URI: https://www.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.8.2
14
  Author: Shareaholic
15
  Author URI: https://www.shareaholic.com
16
  Text Domain: shareaholic
61
  const URL = 'https://www.shareaholic.com';
62
  const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
63
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
 
64
 
65
+ const VERSION = '8.8.2';
66
 
67
  /**
68
  * Starts off as false so that ::get_instance() returns
templates/advanced_settings.php CHANGED
@@ -37,7 +37,7 @@
37
  <?php if (isset($settings['disable_internal_share_counts_api'])) { ?>
38
  <?php echo ($settings['disable_internal_share_counts_api'] == 'on' ? 'checked' : '') ?>
39
  <?php } ?>>
40
- <label class="font-normal" for="share_counts"> <?php echo sprintf(__('Disable server-side Share Counts API', 'shareaholic')); ?> <?php echo sprintf(__('(This feature uses server resources. When "enabled" share counts will appear for <a href="https://github.com/shareaholic/shareaholic-api-docs/blob/master/api_share.md" target="_blank">additional social networks</a>.)', 'shareaholic')); ?></label>
41
  <p>
42
  <input type='submit' class="btn btn-primary btn-medium" onclick="this.value='<?php echo sprintf(__('Saving Changes...', 'shareaholic')); ?>';" value='<?php echo sprintf(__('Save Changes', 'shareaholic')); ?>'>
43
  </p>
37
  <?php if (isset($settings['disable_internal_share_counts_api'])) { ?>
38
  <?php echo ($settings['disable_internal_share_counts_api'] == 'on' ? 'checked' : '') ?>
39
  <?php } ?>>
40
+ <label class="font-normal" for="share_counts"> <?php echo sprintf(__('Disable server-side Share Counts API', 'shareaholic')); ?> <?php echo sprintf(__('(This GDPR feature uses server resources. When "enabled" share counts will appear for <a href="https://github.com/shareaholic/shareaholic-api-docs/blob/master/api_share.md" target="_blank">additional social networks</a>.)', 'shareaholic')); ?></label>
41
  <p>
42
  <input type='submit' class="btn btn-primary btn-medium" onclick="this.value='<?php echo sprintf(__('Saving Changes...', 'shareaholic')); ?>';" value='<?php echo sprintf(__('Save Changes', 'shareaholic')); ?>'>
43
  </p>
templates/settings.php CHANGED
@@ -17,7 +17,7 @@
17
  <div id='app_settings'>
18
 
19
  <div class="app">
20
- <h2>Getting Started</h2>
21
  <p><?php echo sprintf(__('%sLearn the basics of how to get started and configure Shareaholic through our popular WordPress plugin.%s', 'shareaholic'), '<a href="https://support.shareaholic.com/hc/en-us/categories/200101476-WordPress-Plugin" target="_blank">','</a>'); ?> <?php echo sprintf(__('If you are upgrading from an earlier version of Shareaholic for WordPress and need help, have a question or have a bug to report, please %slet us know%s.', 'shareaholic'), '<a href="https://www.shareaholic.com/help/message" target="_blank">','</a>'); ?>
22
  </p>
23
  </div>
@@ -71,7 +71,7 @@
71
 
72
  <div class='fieldset-footer'>
73
  <p>
74
- Brand your shares with your @Twitterhandle, pick your favorite URL shortener, share buttons for images, etc.
75
  </p>
76
  <p>
77
  <button class='app_wide_settings btn btn-success wide-button' data-href='share_buttons/edit'><?php _e('Edit Settings', 'shareaholic'); ?></button>
@@ -119,14 +119,19 @@
119
 
120
  <div class='fieldset-footer'>
121
  <p>
122
- Re-sync your content, exclude pages from being recommended, etc.
123
  </p>
124
  <p>
125
  <button class='app_wide_settings btn btn-success wide-button' data-href='recommendations/edit'><?php _e('Edit Settings', 'shareaholic'); ?></button>
126
  </p>
127
  </div>
 
 
 
 
 
128
  </div>
129
-
130
  <div class="app">
131
  <h2>
132
  <i class="icon icon-affiliate"></i> <?php echo sprintf(__('Monetization Settings', 'shareaholic')); ?>
17
  <div id='app_settings'>
18
 
19
  <div class="app">
20
+ <h2><?php echo sprintf(__('Getting Started')); ?></h2>
21
  <p><?php echo sprintf(__('%sLearn the basics of how to get started and configure Shareaholic through our popular WordPress plugin.%s', 'shareaholic'), '<a href="https://support.shareaholic.com/hc/en-us/categories/200101476-WordPress-Plugin" target="_blank">','</a>'); ?> <?php echo sprintf(__('If you are upgrading from an earlier version of Shareaholic for WordPress and need help, have a question or have a bug to report, please %slet us know%s.', 'shareaholic'), '<a href="https://www.shareaholic.com/help/message" target="_blank">','</a>'); ?>
22
  </p>
23
  </div>
71
 
72
  <div class='fieldset-footer'>
73
  <p>
74
+ <?php echo sprintf(__('Brand your shares with your @Twitterhandle, pick your favorite URL shortener, share buttons for images, etc.')); ?>
75
  </p>
76
  <p>
77
  <button class='app_wide_settings btn btn-success wide-button' data-href='share_buttons/edit'><?php _e('Edit Settings', 'shareaholic'); ?></button>
119
 
120
  <div class='fieldset-footer'>
121
  <p>
122
+ <?php echo sprintf(__('Rebuild your Content Index, exclude pages from being recommended, tweak algorithms, and more.', 'shareaholic')); ?>
123
  </p>
124
  <p>
125
  <button class='app_wide_settings btn btn-success wide-button' data-href='recommendations/edit'><?php _e('Edit Settings', 'shareaholic'); ?></button>
126
  </p>
127
  </div>
128
+ <div class='fieldset-footer'>
129
+ <p>
130
+ <?php echo sprintf(__('Note: Shareaholic offloads Related Posts processing to the cloud, so there is no additional load on your server or database, giving you the fastest and most efficient Related Posts solution on the market. The %scloud API%s starts working as soon as your site is live. Until the cloud-based system starts, we use a basic placeholder API powered by the plugin. This API is temporary and does not respect advanced settings such as content exclusion rules.', 'shareaholic'), '<a href="https://shrlc.com/1IzOGiI" target="_blank">','</a>'); ?>
131
+ </p>
132
+ </div>
133
  </div>
134
+
135
  <div class="app">
136
  <h2>
137
  <i class="icon icon-affiliate"></i> <?php echo sprintf(__('Monetization Settings', 'shareaholic')); ?>