Related Posts for WordPress - Version 1.7.5

Version Description

Download this release

Release Info

Developer barrykooij
Plugin Icon 128x128 Related Posts for WordPress
Version 1.7.5
Comparing to
See all releases

Code changes from version 1.7.4 to 1.7.5

classes/class-multisite-notice.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ class RP4WP_Multisite_Notice {
8
+ public static function display() {
9
+ echo '<div class="error"><p>';
10
+ printf( __( "The free version of Related Posts for WordPress doesn't support WordPress Multisite/Network!" ), '<b>', '</b>' );
11
+ echo "<br /><br />";
12
+ printf( __( "%sBuy the premium version%s or disable the plugin." ), '<a href="https://www.relatedpostsforwp.com/upgrade-premium/?utm_source=plugin&utm_medium=link&utm_campaign=multisite-notice" target="_blank">', '</a>' );
13
+ echo "</p></div>";
14
+ }
15
+ }
classes/class-related-post-manager.php CHANGED
@@ -80,7 +80,7 @@ class RP4WP_Related_Post_Manager {
80
  public function get_uncached_post_count() {
81
  global $wpdb;
82
 
83
- $post_count = $wpdb->get_var( "SELECT COUNT(P.ID) FROM " . $wpdb->posts . " P LEFT JOIN wp_postmeta PM ON (P.ID = PM.post_id AND PM.meta_key = '" . RP4WP_Constants::PM_POST_AUTO_LINKED . "') WHERE 1=1 AND P.post_type = 'post' AND P.post_status = 'publish' AND PM.post_id IS NULL GROUP BY P.post_status" );
84
 
85
  if ( ! is_numeric( $post_count ) ) {
86
  $post_count = 0;
80
  public function get_uncached_post_count() {
81
  global $wpdb;
82
 
83
+ $post_count = $wpdb->get_var( "SELECT COUNT(P.ID) FROM " . $wpdb->posts . " P LEFT JOIN ".$wpdb->postmeta." PM ON (P.ID = PM.post_id AND PM.meta_key = '" . RP4WP_Constants::PM_POST_AUTO_LINKED . "') WHERE 1=1 AND P.post_type = 'post' AND P.post_status = 'publish' AND PM.post_id IS NULL GROUP BY P.post_status" );
84
 
85
  if ( ! is_numeric( $post_count ) ) {
86
  $post_count = 0;
classes/class-related-word-manager.php CHANGED
@@ -375,7 +375,7 @@ class RP4WP_Related_Word_Manager {
375
  public function get_uncached_post_count() {
376
  global $wpdb;
377
 
378
- $post_count = $wpdb->get_var( "SELECT COUNT(P.ID) FROM " . $wpdb->posts . " P LEFT JOIN wp_postmeta PM ON (P.ID = PM.post_id AND PM.meta_key = '" . RP4WP_Constants::PM_CACHED . "') WHERE 1=1 AND P.post_type = 'post' AND P.post_status = 'publish' AND PM.post_id IS NULL GROUP BY P.post_status" );
379
 
380
  if ( ! is_numeric( $post_count ) ) {
381
  $post_count = 0;
375
  public function get_uncached_post_count() {
376
  global $wpdb;
377
 
378
+ $post_count = $wpdb->get_var( "SELECT COUNT(P.ID) FROM " . $wpdb->posts . " P LEFT JOIN ".$wpdb->postmeta." PM ON (P.ID = PM.post_id AND PM.meta_key = '" . RP4WP_Constants::PM_CACHED . "') WHERE 1=1 AND P.post_type = 'post' AND P.post_status = 'publish' AND PM.post_id IS NULL GROUP BY P.post_status" );
379
 
380
  if ( ! is_numeric( $post_count ) ) {
381
  $post_count = 0;
classes/class-rp4wp.php CHANGED
@@ -8,7 +8,7 @@ class RP4WP {
8
 
9
  private static $instance = null;
10
 
11
- const VERSION = '1.7.4';
12
 
13
  /**
14
  * @var RP4WP_Settings
@@ -69,6 +69,13 @@ class RP4WP {
69
  // Load plugin text domain
70
  load_plugin_textdomain( 'related-posts-for-wp', false, dirname( plugin_basename( RP4WP_PLUGIN_FILE ) ) . '/languages/' );
71
 
 
 
 
 
 
 
 
72
  // Check if we need to run the installer
73
  if ( is_admin() && get_option( RP4WP_Constants::OPTION_DO_INSTALL, false ) ) {
74
 
8
 
9
  private static $instance = null;
10
 
11
+ const VERSION = '1.7.5';
12
 
13
  /**
14
  * @var RP4WP_Settings
69
  // Load plugin text domain
70
  load_plugin_textdomain( 'related-posts-for-wp', false, dirname( plugin_basename( RP4WP_PLUGIN_FILE ) ) . '/languages/' );
71
 
72
+ // Check for multisite, we don't support that
73
+ if ( is_multisite() && ( is_admin() || is_network_admin() ) ) {
74
+ add_action( 'admin_notices', array( 'RP4WP_Multisite_Notice', 'display' ) );
75
+ add_action( 'network_admin_notices', array( 'RP4WP_Multisite_Notice', 'display' ) );
76
+ return;
77
+ }
78
+
79
  // Check if we need to run the installer
80
  if ( is_admin() && get_option( RP4WP_Constants::OPTION_DO_INSTALL, false ) ) {
81
 
classes/filters/class-filter-plugin-links.php CHANGED
@@ -21,7 +21,7 @@ if ( ! class_exists( 'RP4WP_Filter_Plugin_Links' ) ) {
21
  */
22
  public function run( $links ) {
23
  array_unshift( $links, '<a href="' . admin_url( 'options-general.php?page=rp4wp' ) . '">' . __( 'Settings', 'related-posts-for-wp' ) . '</a>' );
24
- array_unshift( $links, '<a href="https://www.relatedpostsforwp.com/?utm_source=plugin&utm_medium=link&utm_campaign=plugins-page" target="_blank" style="color:green;font-weight:bold;">' . __( 'Upgrade to Premium', 'related-posts-for-wp' ) . '</a>' );
25
 
26
  return $links;
27
  }
21
  */
22
  public function run( $links ) {
23
  array_unshift( $links, '<a href="' . admin_url( 'options-general.php?page=rp4wp' ) . '">' . __( 'Settings', 'related-posts-for-wp' ) . '</a>' );
24
+ array_unshift( $links, '<a href="https://www.relatedpostsforwp.com/upgrade-premium/?utm_source=plugin&utm_medium=link&utm_campaign=plugins-page" target="_blank" style="color:green;font-weight:bold;">' . __( 'Upgrade to Premium', 'related-posts-for-wp' ) . '</a>' );
25
 
26
  return $links;
27
  }
classes/hooks/class-hook-page-install.php CHANGED
@@ -177,7 +177,7 @@ class RP4WP_Hook_Page_Install extends RP4WP_Hook {
177
 
178
  <p><?php _e( "Premium features include custom post type support, related post themes, custom taxonomy support and priority support.", 'related-posts-for-wp' ); ?></p>
179
 
180
- <p><?php printf( __( "%sMore information about Related Posts for WP Premium (opens in new window) »%s", 'related-posts-for-wp' ), '<a href="https://www.relatedpostsforwp.com/?utm_source=plugin&utm_medium=link&utm_campaign=install" target="_blank">', '</a>' ); ?></p>
181
  </div>
182
 
183
  </div>
177
 
178
  <p><?php _e( "Premium features include custom post type support, related post themes, custom taxonomy support and priority support.", 'related-posts-for-wp' ); ?></p>
179
 
180
+ <p><?php printf( __( "%sMore information about Related Posts for WP Premium (opens in new window) »%s", 'related-posts-for-wp' ), '<a href="https://www.relatedpostsforwp.com/upgrade-premium/?utm_source=plugin&utm_medium=link&utm_campaign=install" target="_blank">', '</a>' ); ?></p>
181
  </div>
182
 
183
  </div>
classes/hooks/class-hook-settings-page.php CHANGED
@@ -56,7 +56,7 @@ class RP4WP_Hook_Settings_Page extends RP4WP_Hook {
56
 
57
  <p><?php _e( "This plugin has an even better premium version, I am sure you will love it.", 'related-posts-for-wp' ); ?></p>
58
  <p><?php _e( "Premium features include custom post type support, related post themes, custom taxonomy support and priority support.", 'related-posts-for-wp' ); ?></p>
59
- <p><?php printf( __( "%sMore information about Related Posts for WP Premium »%s", 'related-posts-for-wp' ), '<a href="https://www.relatedpostsforwp.com/?utm_source=plugin&utm_medium=link&utm_campaign=upgrade-box" target="_blank">', '</a>' ); ?></p>
60
  </div>
61
 
62
  <div class="rp4wp-box">
@@ -74,7 +74,7 @@ class RP4WP_Hook_Settings_Page extends RP4WP_Hook {
74
 
75
  <p><?php printf( __( "For support please visit the <a href='%s' target='_blank'>WordPress.org forums</a>.", 'related-posts-for-wp' ), 'http://wordpress.org/support/plugin/related-posts-for-wp' ); ?></p>
76
 
77
- <p style="color: green;font-weight: bold;"><?php printf( __( "Did you know that Related Posts for WordPress Premium clients get priority email support? %sClick here to upgrade.%s", 'related-posts-for-wp' ), '<a href="https://www.relatedpostsforwp.com/?utm_source=plugin&utm_medium=link&utm_campaign=support" target="_blank">', '</a>' ); ?></p>
78
  </div>
79
 
80
  <div class="rp4wp-box">
@@ -95,7 +95,7 @@ class RP4WP_Hook_Settings_Page extends RP4WP_Hook {
95
 
96
  <p><?php _e( "Barry likes contributing to opensource projects and visiting WordCamps and WordPress meetups. He’s the organizer of the WordPress meetup in Tilburg.", 'related-posts-for-wp' ); ?></p>
97
 
98
- <p><?php printf( __( "<a href='%s' target='_blank'>You can follow Barry on Twitter</a>", 'related-posts-for-wp' ), 'https://twitter.com/cageNL' ); ?></p>
99
  </div>
100
 
101
  </div>
56
 
57
  <p><?php _e( "This plugin has an even better premium version, I am sure you will love it.", 'related-posts-for-wp' ); ?></p>
58
  <p><?php _e( "Premium features include custom post type support, related post themes, custom taxonomy support and priority support.", 'related-posts-for-wp' ); ?></p>
59
+ <p><?php printf( __( "%sMore information about Related Posts for WP Premium »%s", 'related-posts-for-wp' ), '<a href="https://www.relatedpostsforwp.com/upgrade-premium/?utm_source=plugin&utm_medium=link&utm_campaign=upgrade-box" target="_blank">', '</a>' ); ?></p>
60
  </div>
61
 
62
  <div class="rp4wp-box">
74
 
75
  <p><?php printf( __( "For support please visit the <a href='%s' target='_blank'>WordPress.org forums</a>.", 'related-posts-for-wp' ), 'http://wordpress.org/support/plugin/related-posts-for-wp' ); ?></p>
76
 
77
+ <p style="color: green;font-weight: bold;"><?php printf( __( "Did you know that Related Posts for WordPress Premium clients get priority email support? %sClick here to upgrade.%s", 'related-posts-for-wp' ), '<a href="https://www.relatedpostsforwp.com/upgrade-premium/?utm_source=plugin&utm_medium=link&utm_campaign=support" target="_blank">', '</a>' ); ?></p>
78
  </div>
79
 
80
  <div class="rp4wp-box">
95
 
96
  <p><?php _e( "Barry likes contributing to opensource projects and visiting WordCamps and WordPress meetups. He’s the organizer of the WordPress meetup in Tilburg.", 'related-posts-for-wp' ); ?></p>
97
 
98
+ <p><?php printf( __( "<a href='%s' target='_blank'>Follow Barry on Twitter</a>", 'related-posts-for-wp' ), 'https://twitter.com/cageNL' ); ?></p>
99
  </div>
100
 
101
  </div>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.relatedpostsforwp.com/
4
  Tags: related posts for wordpress, related posts for wp, simple related posts, easy related posts, related posts, related, relations, internal links, seo, bounce rate
5
  Requires at least: 3.6
6
  Tested up to: 4.0
7
- Stable tag: 1.7.4
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -27,7 +27,7 @@ Our installation wizard will do all the hard work for you, simply activate the p
27
  > - WordPress Network / Multisite support<br />
28
  > - Priority Email Support<br />
29
  >
30
- > [More information](https://www.relatedpostsforwp.com/features/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-info-link) | [Purchase >>](https://www.relatedpostsforwp.com/checkout/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-purchase-link)
31
 
32
  = Related Posts for WordPress won't lag your server! =
33
  We don't think having related posts should slow down your website. That's why Related Posts for WordPress creates its own cache and does all the heavy lifting in the admin panel, keeping your website fast as it should be!
@@ -73,7 +73,7 @@ Related Posts for Wordpress has a widget allowing you to display related posts i
73
  > - WordPress Network / Multisite support<br />
74
  > - Priority Email Support<br />
75
  >
76
- > [More information](https://www.relatedpostsforwp.com/features/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-info-link) | [Purchase >>](https://www.relatedpostsforwp.com/checkout/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-purchase-link)
77
 
78
  = Where's the settings screen? =
79
  Settings > Related Posts.
@@ -112,8 +112,9 @@ There is one custom table created for the post cache, this table will however no
112
 
113
  == Changelog ==
114
 
115
- = Trunk: November xx, 2014 =
116
  * Fixed a hardcoded database table bug.
 
117
 
118
  = 1.7.4: November 12, 2014 =
119
  * Fixed an UTF-8 - iconv bug.
4
  Tags: related posts for wordpress, related posts for wp, simple related posts, easy related posts, related posts, related, relations, internal links, seo, bounce rate
5
  Requires at least: 3.6
6
  Tested up to: 4.0
7
+ Stable tag: 1.7.5
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
27
  > - WordPress Network / Multisite support<br />
28
  > - Priority Email Support<br />
29
  >
30
+ > [More information](https://www.relatedpostsforwp.com/features/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-info-link) | [Upgrade >>](https://www.relatedpostsforwp.com/upgrade-premium/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=after-features-purchase-link)
31
 
32
  = Related Posts for WordPress won't lag your server! =
33
  We don't think having related posts should slow down your website. That's why Related Posts for WordPress creates its own cache and does all the heavy lifting in the admin panel, keeping your website fast as it should be!
73
  > - WordPress Network / Multisite support<br />
74
  > - Priority Email Support<br />
75
  >
76
+ > [More information](https://www.relatedpostsforwp.com/features/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-info-link) | [Upgrade >>](https://www.relatedpostsforwp.com/upgrade-premium/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=faq-purchase-link)
77
 
78
  = Where's the settings screen? =
79
  Settings > Related Posts.
112
 
113
  == Changelog ==
114
 
115
+ = 1.7.5: November 15, 2014 =
116
  * Fixed a hardcoded database table bug.
117
+ * Display notice and don't load plugin on multisite.
118
 
119
  = 1.7.4: November 12, 2014 =
120
  * Fixed an UTF-8 - iconv bug.
related-posts-for-wp.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Related Posts for WordPress
4
  Plugin URI: http://www.relatedpostsforwp.com/
5
  Description: Related Posts for WordPress, the best way to display related posts in WordPress.
6
- Version: 1.7.4
7
  Author: Barry Kooij
8
  Author URI: http://www.barrykooij.com/
9
  License: GPL v3
@@ -46,7 +46,7 @@ function rp4wp_load_plugin() {
46
  add_action( 'plugins_loaded', 'rp4wp_load_plugin', 20 );
47
 
48
  //
49
- if( is_admin() && ( false === defined( 'DOING_AJAX' ) || false === DOING_AJAX ) ) {
50
 
51
  // Load installer functions
52
  require_once plugin_dir_path( __FILE__ ) . 'includes/installer-functions.php';
3
  Plugin Name: Related Posts for WordPress
4
  Plugin URI: http://www.relatedpostsforwp.com/
5
  Description: Related Posts for WordPress, the best way to display related posts in WordPress.
6
+ Version: 1.7.5
7
  Author: Barry Kooij
8
  Author URI: http://www.barrykooij.com/
9
  License: GPL v3
46
  add_action( 'plugins_loaded', 'rp4wp_load_plugin', 20 );
47
 
48
  //
49
+ if ( is_admin() && ! is_multisite() && ( false === defined( 'DOING_AJAX' ) || false === DOING_AJAX ) ) {
50
 
51
  // Load installer functions
52
  require_once plugin_dir_path( __FILE__ ) . 'includes/installer-functions.php';