Yet Another Related Posts Plugin (YARPP) - Version 3.1.1

Version Description

  • Possible fix for the "no related posts" issue by vkovalcik
  • Bugfix: slight optimization to keyword function by vkovalcik
  • Bugfix: regex issue with br-stripping
Download this release

Release Info

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

Code changes from version 3.1 to 3.1.1

Files changed (5) hide show
  1. keywords.php +4 -3
  2. magic.php +3 -1
  3. readme.txt +6 -2
  4. template-builtin.php +2 -2
  5. yarpp.php +2 -2
keywords.php CHANGED
@@ -84,10 +84,11 @@ function yarpp_cache_keywords($ID) {
84
function yarpp_get_cached_keywords($ID,$type='body') {
85
global $wpdb;
86
$out = $wpdb->get_var("select $type from {$wpdb->prefix}yarpp_keyword_cache where ID = $ID");
87
- if ($out === false or $out == '')
88
yarpp_cache_keywords($ID);
89
- $out = $wpdb->get_var("select $type from {$wpdb->prefix}yarpp_keyword_cache where ID = $ID");
90
- if ($out === false or $out == '') {
91
//echo "<!--YARPP ERROR: couldn't select/create yarpp $type keywords for $ID-->";
92
return false;
93
} else {
84
function yarpp_get_cached_keywords($ID,$type='body') {
85
global $wpdb;
86
$out = $wpdb->get_var("select $type from {$wpdb->prefix}yarpp_keyword_cache where ID = $ID");
87
+ if ($out === false or $out == '') { // if empty, try caching them first.
88
yarpp_cache_keywords($ID);
89
+ $out = $wpdb->get_var("select $type from {$wpdb->prefix}yarpp_keyword_cache where ID = $ID");
90
+ }
91
+ if ($out === false or $out == '') { // if still empty... return false
92
//echo "<!--YARPP ERROR: couldn't select/create yarpp $type keywords for $ID-->";
93
return false;
94
} else {
magic.php CHANGED
@@ -206,7 +206,9 @@ function yarpp_sql($type,$args,$giveresults = true,$reference_ID=false,$domain='
206
// GROUP BY
207
$newsql .= "\n group by id \n";
208
// HAVING
209
- $safethreshold = max($threshold/2,0.1); // this is so the new calibration system works.
210
$newsql .= " having score >= $safethreshold";
211
if ($usedisterms)
212
$newsql .= " and count(blockterm.term_id) = 0";
206
// GROUP BY
207
$newsql .= "\n group by id \n";
208
// HAVING
209
+ // safethreshold is so the new calibration system works.
210
+ // number_format fix suggested by vkovalcik! :)
211
+ $safethreshold = number_format(max($threshold/2,0.1), 2, '.', '');
212
$newsql .= " having score >= $safethreshold";
213
if ($usedisterms)
214
$newsql .= " and count(blockterm.term_id) = 0";
readme.txt CHANGED
@@ -7,7 +7,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=66G4D
7
Tags: related, posts, post, pages, page, RSS, feed, feeds
8
Requires at least: 2.8
9
Tested up to: 2.9
10
- Stable tag: 3.1
11
12
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.
13
@@ -28,7 +28,7 @@ This plugin requires that your database run on MySQL 4.1 or greater.
28
29
= Testimonials =
30
31
- "One of my favorite [plugin]s I just activated on my blog is called Yet Another Related Posts Plugin... I've been blogging seven or eight years now so I have a lot of archives, and it actually surprises me sometimes when I blog about something and I visit the permalink to see I've written about it before... and it also increases the traffic on your blog because when they come in just to one entry, they'll see this other stuff going on." - Matt Mullenwegg, WordPress creator
32
33
"As most [sports betting](http://www.betus.com/) fans use our portal, [BetUS.com Sportsbook](http://www.betus.com/sportsbook/) works hard to maintain a high level of quality on their site. Mitcho and his amazing plugins help keep us moving our technology forward. Thank you Mitcho, and the [Wordpress](http://wordpress.org) team for your service and creativity!" - [BetUS.com](http://BetUS.com/)
34
@@ -148,6 +148,10 @@ If you are a bilingual speaker of English and another language and an avid user
148
149
== Changelog ==
150
151
= 3.1 =
152
* New snazzy options screen
153
* Smarter, less confusing caching
7
Tags: related, posts, post, pages, page, RSS, feed, feeds
8
Requires at least: 2.8
9
Tested up to: 2.9
10
+ Stable tag: 3.1.1
11
12
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.
13
28
29
= Testimonials =
30
31
+ "One of my favorite [plugin]s I just activated on my blog is called Yet Another Related Posts Plugin... I've been blogging seven or eight years now so I have a lot of archives, and it actually surprises me sometimes when I blog about something and I visit the permalink to see I've written about it before... and it also increases the traffic on your blog because when they come in just to one entry, they'll see this other stuff going on." - Matt Mullenweg, WordPress creator
32
33
"As most [sports betting](http://www.betus.com/) fans use our portal, [BetUS.com Sportsbook](http://www.betus.com/sportsbook/) works hard to maintain a high level of quality on their site. Mitcho and his amazing plugins help keep us moving our technology forward. Thank you Mitcho, and the [Wordpress](http://wordpress.org) team for your service and creativity!" - [BetUS.com](http://BetUS.com/)
34
148
149
== Changelog ==
150
151
+ = 3.1.1 =
152
+ * [Possible fix for the "no related posts" issue](http://wordpress.org/support/topic/284209/page/2) by [vkovalcik](http://wordpress.org/support/profile/5032111)
153
+ * Bugfix: [slight optimization to keyword function](http://wordpress.org/support/topic/284209/page/2) by [vkovalcik](http://wordpress.org/support/profile/5032111)
154
+ * Bugfix: [regex issue with br-stripping](http://wordpress.org/support/topic/323823)
155
= 3.1 =
156
* New snazzy options screen
157
* Smarter, less confusing caching
template-builtin.php CHANGED
@@ -30,7 +30,7 @@ if ($related_query->have_posts()) {
30
while ($related_query->have_posts()) {
31
$related_query->the_post();
32
33
- $output .= "$before_title<a href='".get_permalink()."' rel='bookmark' title='Permanent Link: ".preg_replace('/\s*<br[ /]*>\s*/i', ' ', get_the_title())."'>".get_the_title()."";
34
if ($userdata->user_level >= 8 and $domain != 'rss')
35
$output .= ' <abbr title="'.sprintf(__('%f is the YARPP match score between the current entry and this related entry. You are seeing this value because you are logged in to WordPress as an administrator. It is not shown to regular visitors.','yarpp'),round(get_the_score(),3)).'">('.round(get_the_score(),3).')</abbr>';
36
$output .= '</a>';
@@ -39,7 +39,7 @@ if ($related_query->have_posts()) {
39
yarpp_excerpt(get_the_excerpt(),$excerpt_length)
40
. $after_post;
41
}
42
- $output .= $after_title;
43
44
}
45
$output = stripslashes(stripslashes($before_related)).$output.stripslashes(stripslashes($after_related));
30
while ($related_query->have_posts()) {
31
$related_query->the_post();
32
33
+ $output .= "$before_title<a href='".get_permalink()."' rel='bookmark' title='Permanent Link: ".preg_replace('/\s*<br[ \/]*>\s*/i', ' ', get_the_title())."'>".get_the_title()."";
34
if ($userdata->user_level >= 8 and $domain != 'rss')
35
$output .= ' <abbr title="'.sprintf(__('%f is the YARPP match score between the current entry and this related entry. You are seeing this value because you are logged in to WordPress as an administrator. It is not shown to regular visitors.','yarpp'),round(get_the_score(),3)).'">('.round(get_the_score(),3).')</abbr>';
36
$output .= '</a>';
39
yarpp_excerpt(get_the_excerpt(),$excerpt_length)
40
. $after_post;
41
}
42
+ $output .= $after_title."\n";
43
44
}
45
$output = stripslashes(stripslashes($before_related)).$output.stripslashes(stripslashes($after_related));
yarpp.php CHANGED
@@ -3,13 +3,13 @@
3
Plugin Name: Yet Another Related Posts Plugin
4
Plugin URI: http://mitcho.com/code/yarpp/
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.1
7
Author: mitcho (Michael Yoshitaka Erlewine)
8
Author URI: http://mitcho.com/
9
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=66G4DATK4999L&item_name=mitcho%2ecom%2fcode%3a%20donate%20to%20Michael%20Yoshitaka%20Erlewine&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&charset=UTF%2d8
10
*/
11
12
- define('YARPP_VERSION','3.1');
13
14
require_once('includes.php');
15
require_once('related-functions.php');
3
Plugin Name: Yet Another Related Posts Plugin
4
Plugin URI: http://mitcho.com/code/yarpp/
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.1.1
7
Author: mitcho (Michael Yoshitaka Erlewine)
8
Author URI: http://mitcho.com/
9
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=66G4DATK4999L&item_name=mitcho%2ecom%2fcode%3a%20donate%20to%20Michael%20Yoshitaka%20Erlewine&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&charset=UTF%2d8
10
*/
11
12
+ define('YARPP_VERSION','3.1.1');
13
14
require_once('includes.php');
15
require_once('related-functions.php');