Yet Another Related Posts Plugin (YARPP) - Version 3.4.3b1

Version Description

Download this release

Release Info

Developer mitchoyoshitaka
Plugin Icon 128x128 Yet Another Related Posts Plugin (YARPP)
Version 3.4.3b1
Comparing to
See all releases

Code changes from version 3.4.2b1 to 3.4.3b1

Files changed (4) hide show
  1. cache-postmeta.php +1 -0
  2. cache-tables.php +9 -3
  3. readme.txt +6 -1
  4. yarpp.php +2 -2
cache-postmeta.php CHANGED
@@ -149,6 +149,7 @@ class YARPP_Cache_Postmeta extends YARPP_Cache {
149
// clear each cache
150
foreach($reference_ID as $id) {
151
delete_post_meta( $id, YARPP_POSTMETA_RELATED_KEY );
152
}
153
}
154
149
// clear each cache
150
foreach($reference_ID as $id) {
151
delete_post_meta( $id, YARPP_POSTMETA_RELATED_KEY );
152
+ delete_post_meta( $id, YARPP_POSTMETA_KEYWORDS_KEY );
153
}
154
}
155
cache-tables.php CHANGED
@@ -173,10 +173,13 @@ class YARPP_Cache_Tables extends YARPP_Cache {
173
174
public function clear($reference_ID) {
175
global $wpdb;
176
- if (is_array($reference_ID) && count($reference_ID))
177
$wpdb->query("delete from {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " where reference_ID in (".implode(',',$reference_ID).")");
178
- else if (is_int($reference_ID))
179
$wpdb->query("delete from {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " where reference_ID = {$reference_ID}");
180
}
181
182
// @return YARPP_RELATED | YARPP_NO_RELATED | YARPP_NOT_CACHED
@@ -263,7 +266,10 @@ class YARPP_Cache_Tables extends YARPP_Cache {
263
$title_terms = $this->title_keywords($ID);
264
265
if ( !empty($wpdb->dbh) && defined('DB_CHARSET') ) {
266
- $wpdb->set_charset( $wpdb->dbh, DB_CHARSET );
267
}
268
269
$wpdb->query("insert into {$wpdb->prefix}" . YARPP_TABLES_KEYWORDS_TABLE . " (ID,body,title) values ($ID,'$body_terms ','$title_terms ') on duplicate key update date = now(), body = '$body_terms ', title = '$title_terms '");
173
174
public function clear($reference_ID) {
175
global $wpdb;
176
+ if (is_array($reference_ID) && count($reference_ID)) {
177
$wpdb->query("delete from {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " where reference_ID in (".implode(',',$reference_ID).")");
178
+ $wpdb->query("delete from {$wpdb->prefix}" . YARPP_TABLES_KEYWORDS_TABLE . " where ID in (".implode(',',$reference_ID).")");
179
+ } else if (is_int($reference_ID)) {
180
$wpdb->query("delete from {$wpdb->prefix}" . YARPP_TABLES_RELATED_TABLE . " where reference_ID = {$reference_ID}");
181
+ $wpdb->query("delete from {$wpdb->prefix}" . YARPP_TABLES_KEYWORDS_TABLE . " where ID = {$reference_ID}");
182
+ }
183
}
184
185
// @return YARPP_RELATED | YARPP_NO_RELATED | YARPP_NOT_CACHED
266
$title_terms = $this->title_keywords($ID);
267
268
if ( !empty($wpdb->dbh) && defined('DB_CHARSET') ) {
269
+ if ( method_exists( $wpdb, 'set_charset' ) )
270
+ $wpdb->set_charset( $wpdb->dbh, DB_CHARSET );
271
+ else
272
+ mysql_set_charset( DB_CHARSET, $wpdb->dbh );
273
}
274
275
$wpdb->query("insert into {$wpdb->prefix}" . YARPP_TABLES_KEYWORDS_TABLE . " (ID,body,title) values ($ID,'$body_terms ','$title_terms ') on duplicate key update date = now(), body = '$body_terms ', title = '$title_terms '");
readme.txt CHANGED
@@ -7,7 +7,7 @@ Donate link: http://tinyurl.com/donatetomitcho
7
Tags: related, posts, post, pages, page, RSS, feed, feeds
8
Requires at least: 3.0
9
Tested up to: 3.3
10
- Stable tag: 3.4.1
11
12
Display a list of related entries on your site and feeds based on a unique algorithm. Templating allows customization of the display.
13
@@ -173,8 +173,13 @@ If you are a bilingual speaker of English and another language and an avid user
173
174
== Changelog ==
175
176
= 3.4.2 =
177
* [Bugfix](http://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-not-working-version-341-and-custom-template): 3.4 and 3.4.1 assumed existence of `wp_posts` table.
178
179
= 3.4.1 =
180
* [Bugfix](http://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-34-images-problem-using-template): restore `global $post` access to custom templates
7
Tags: related, posts, post, pages, page, RSS, feed, feeds
8
Requires at least: 3.0
9
Tested up to: 3.3
10
+ Stable tag: 3.4.2
11
12
Display a list of related entries on your site and feeds based on a unique algorithm. Templating allows customization of the display.
13
173
174
== Changelog ==
175
176
+ = 3.4.3 =
177
+ * Bugfix: keywords were not getting cleared on post update, meaning new posts (which start blank) were not getting useful title + body keyword matches. This often resulted in "no related posts" for new posts.
178
+
179
= 3.4.2 =
180
* [Bugfix](http://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-not-working-version-341-and-custom-template): 3.4 and 3.4.1 assumed existence of `wp_posts` table.
181
+ * Fix typo in `yarpp-template-random.php` example template file
182
+ * Improve compatibility with DB Cache Reloaded plugin which doesn't properly implement `set_charset` method.
183
184
= 3.4.1 =
185
* [Bugfix](http://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-34-images-problem-using-template): restore `global $post` access to custom templates
yarpp.php CHANGED
@@ -3,13 +3,13 @@
3
Plugin Name: Yet Another Related Posts Plugin
4
Plugin URI: http://yarpp.org/
5
Description: Returns a list of related entries based on a unique algorithm for display on your blog and RSS feeds. A templating feature allows customization of the display.
6
- Version: 3.4.2b1
7
Author: mitcho (Michael Yoshitaka Erlewine)
8
Author URI: http://mitcho.com/
9
Donate link: http://tinyurl.com/donatetomitcho
10
*/
11
12
- define('YARPP_VERSION', '3.4.2b1');
13
define('YARPP_DIR', dirname(__FILE__));
14
define('YARPP_NO_RELATED', ':(');
15
define('YARPP_RELATED', ':)');
3
Plugin Name: Yet Another Related Posts Plugin
4
Plugin URI: http://yarpp.org/
5
Description: Returns a list of related entries based on a unique algorithm for display on your blog and RSS feeds. A templating feature allows customization of the display.
6
+ Version: 3.4.3b1
7
Author: mitcho (Michael Yoshitaka Erlewine)
8
Author URI: http://mitcho.com/
9
Donate link: http://tinyurl.com/donatetomitcho
10
*/
11
12
+ define('YARPP_VERSION', '3.4.3b1');
13
define('YARPP_DIR', dirname(__FILE__));
14
define('YARPP_NO_RELATED', ':(');
15
define('YARPP_RELATED', ':)');