WordPress Related Posts - Version 3.5.2

Version Description

  • Fixed excerpt bug
Download this release

Release Info

Developer ddksr
Plugin Icon wp plugin WordPress Related Posts
Version 3.5.2
Comparing to
See all releases

Code changes from version 3.5.1 to 3.5.2

Files changed (4) hide show
  1. config.php +7 -0
  2. init.php +16 -2
  3. readme.txt +4 -1
  4. wp_related_posts.php +1 -1
config.php CHANGED
@@ -252,6 +252,13 @@ function wp_rp_is_classic() {
252
  return false;
253
  }
254
 
 
 
 
 
 
 
 
255
  function wp_rp_migrate_3_5() {
256
  $meta = get_option('wp_rp_meta');
257
  $meta['version'] = '3.5.1';
252
  return false;
253
  }
254
 
255
+ function wp_rp_migrate_3_5_1() {
256
+ $meta = get_option('wp_rp_meta');
257
+ $meta['version'] = '3.5.2';
258
+ $meta['new_user'] = false;
259
+ update_option('wp_rp_meta', $meta);
260
+ }
261
+
262
  function wp_rp_migrate_3_5() {
263
  $meta = get_option('wp_rp_meta');
264
  $meta['version'] = '3.5.1';
init.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- define('WP_RP_VERSION', '3.5.1');
3
 
4
  define('WP_RP_PLUGIN_FILE', plugin_basename(__FILE__));
5
 
@@ -118,6 +118,8 @@ function wp_rp_get_platform_options() {
118
  function wp_rp_ajax_load_articles_callback() {
119
  global $post;
120
 
 
 
121
  $getdata = stripslashes_deep($_GET);
122
  if (!isset($getdata['post_id'])) {
123
  die('error');
@@ -161,11 +163,23 @@ function wp_rp_ajax_load_articles_callback() {
161
  $response_list = array();
162
 
163
  foreach (array_slice($related_posts, $from) as $related_post) {
 
 
 
 
 
 
 
 
 
 
 
 
164
  array_push($response_list, array(
165
  'id' => $related_post->ID,
166
  'url' => get_permalink($related_post->ID),
167
  'title' => $related_post->post_title,
168
- 'excerpt' => $related_post->post_excerpt,
169
  'date' => $related_post->post_date,
170
  'comments' => $related_post->comment_count,
171
  'img' => wp_rp_get_post_thumbnail_img($related_post, $image_size)
1
  <?php
2
+ define('WP_RP_VERSION', '3.5.2');
3
 
4
  define('WP_RP_PLUGIN_FILE', plugin_basename(__FILE__));
5
 
118
  function wp_rp_ajax_load_articles_callback() {
119
  global $post;
120
 
121
+ $platform_options = wp_rp_get_platform_options();
122
+
123
  $getdata = stripslashes_deep($_GET);
124
  if (!isset($getdata['post_id'])) {
125
  die('error');
163
  $response_list = array();
164
 
165
  foreach (array_slice($related_posts, $from) as $related_post) {
166
+ $excerpt_max_length = $platform_options["excerpt_max_length"];
167
+
168
+ $excerpt = $related_post->post_excerpt;
169
+ if (!$excerpt) {
170
+ $excerpt = strip_shortcodes(strip_tags($related_post->post_content));
171
+ }
172
+ if ($excerpt) {
173
+ if (strlen($excerpt) > $excerpt_max_length) {
174
+ $excerpt = wp_rp_text_shorten($excerpt, $excerpt_max_length);
175
+ }
176
+ }
177
+
178
  array_push($response_list, array(
179
  'id' => $related_post->ID,
180
  'url' => get_permalink($related_post->ID),
181
  'title' => $related_post->post_title,
182
+ 'excerpt' => $excerpt,
183
  'date' => $related_post->post_date,
184
  'comments' => $related_post->comment_count,
185
  'img' => wp_rp_get_post_thumbnail_img($related_post, $image_size)
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: related,posts,post,related posts,plugin,seo
4
  License: GPLv2
5
  Requires at least: 3.6
6
  Tested up to: 4.0
7
- Stable tag: 3.5.1
8
 
9
  WordPress Related Posts - the plugin for related posts with thumbnails. Caching included.
10
 
@@ -93,6 +93,9 @@ Fix for security vulnerability. Upgrade immediately.
93
 
94
  == Changelog ==
95
 
 
 
 
96
  = 3.5.1 =
97
  * The subscription API forwards blog URLs
98
  * Responsive themes bugfix
4
  License: GPLv2
5
  Requires at least: 3.6
6
  Tested up to: 4.0
7
+ Stable tag: 3.5.2
8
 
9
  WordPress Related Posts - the plugin for related posts with thumbnails. Caching included.
10
 
93
 
94
  == Changelog ==
95
 
96
+ = 3.5.2 =
97
+ * Fixed excerpt bug
98
+
99
  = 3.5.1 =
100
  * The subscription API forwards blog URLs
101
  * Responsive themes bugfix
wp_related_posts.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: WordPress Related Posts
4
- Version: 3.5.1
5
  Plugin URI: http://wordpress.org/extend/plugins/wordpress-23-related-posts-plugin/
6
  Description: Quickly increase your readers' engagement with your posts by adding Related Posts in the footer of your content. Click on <a href="admin.php?page=wordpress-related-posts">Related Posts tab</a> to configure your settings.
7
  Author: Zemanta Ltd.
1
  <?php
2
  /*
3
  Plugin Name: WordPress Related Posts
4
+ Version: 3.5.2
5
  Plugin URI: http://wordpress.org/extend/plugins/wordpress-23-related-posts-plugin/
6
  Description: Quickly increase your readers' engagement with your posts by adding Related Posts in the footer of your content. Click on <a href="admin.php?page=wordpress-related-posts">Related Posts tab</a> to configure your settings.
7
  Author: Zemanta Ltd.