WordPress Related Posts - Version 3.3.1

Version Description

  • Added setting for admins to restrict the ability to edit automatically added Related posts to admins only
  • Getting ready to reorganize settings page
Download this release

Release Info

Developer zemanta-panco
Plugin Icon wp plugin WordPress Related Posts
Version 3.3.1
Comparing to
See all releases

Code changes from version 3.3 to 3.3.1

Files changed (4) hide show
  1. config.php +16 -0
  2. readme.txt +7 -2
  3. settings.php +7 -0
  4. wp_related_posts.php +3 -3
config.php CHANGED
@@ -206,6 +206,7 @@ function wp_rp_install() {
206
  'thumbnail_use_custom' => false,
207
  'thumbnail_custom_field' => false,
208
  'display_zemanta_linky' => false,
 
209
 
210
  'mobile' => array(
211
  'display_comment_count' => false,
@@ -242,6 +243,21 @@ function wp_rp_is_classic() {
242
  return false;
243
  }
244
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
  function wp_rp_migrate_3_2() {
246
  global $wpdb;
247
 
206
  'thumbnail_use_custom' => false,
207
  'thumbnail_custom_field' => false,
208
  'display_zemanta_linky' => false,
209
+ 'only_admins_can_edit_related_posts' => false,
210
 
211
  'mobile' => array(
212
  'display_comment_count' => false,
243
  return false;
244
  }
245
 
246
+ function wp_rp_migrate_3_3() {
247
+ global $wpdb;
248
+
249
+ $wp_rp_meta = get_option('wp_rp_meta');
250
+ $wp_rp_meta['version'] = '3.3.1';
251
+ $wp_rp_meta['new_user'] = false;
252
+ if (floatval($wp_rp_meta['first_version']) < 2.8 && strpos(get_bloginfo('language'), 'en') === 0) { // Enable widget to all "old" users out there (old = users that started with plugin version 2.7 or below), that have their interface in english.
253
+ $wp_rp_meta['classic_user'] = true;
254
+ }
255
+ $wp_rp_options = get_option('wp_rp_options');
256
+ $wp_rp_options['only_admins_can_edit_related_posts'] = false;
257
+ update_option('wp_rp_meta', $wp_rp_meta);
258
+ update_option('wp_rp_options', $wp_rp_options);
259
+ }
260
+
261
  function wp_rp_migrate_3_2() {
262
  global $wpdb;
263
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: zemanta
3
  Tags: related,posts,post,related posts,plugin
4
  License: GPLv2
5
  Requires at least: 3.3
6
- Tested up to: 3.6
7
- Stable tag: 3.3
8
 
9
  WordPress Related Posts generates a list of related posts with thumbnails and gives you click-through statistics.
10
 
@@ -30,6 +30,7 @@ WordPress Related Posts is constantly improved to bring you the highest rates of
30
 
31
  = Are there any settings? Plenty! =
32
 
 
33
  * thumbnail size, style
34
  * number of posts
35
  * display post excerpt, publish date, number of comments
@@ -81,6 +82,10 @@ Fix for security vulnerability. Upgrade immediately.
81
 
82
  == Changelog ==
83
 
 
 
 
 
84
  = 3.3 =
85
  * Fixed compatibility issues with Zemanta Editorial Assistant
86
  * Fixed transparency for images on settings page
3
  Tags: related,posts,post,related posts,plugin
4
  License: GPLv2
5
  Requires at least: 3.3
6
+ Tested up to: 3.8
7
+ Stable tag: 3.3.1
8
 
9
  WordPress Related Posts generates a list of related posts with thumbnails and gives you click-through statistics.
10
 
30
 
31
  = Are there any settings? Plenty! =
32
 
33
+ * responsive themes
34
  * thumbnail size, style
35
  * number of posts
36
  * display post excerpt, publish date, number of comments
82
 
83
  == Changelog ==
84
 
85
+ = 3.3.1 =
86
+ * Added setting for admins to restrict the ability to edit automatically added Related posts to admins only
87
+ * Getting ready to reorganize settings page
88
+
89
  = 3.3 =
90
  * Fixed compatibility issues with Zemanta Editorial Assistant
91
  * Fixed transparency for images on settings page
settings.php CHANGED
@@ -170,6 +170,7 @@ function wp_rp_settings_page() {
170
  'thumbnail_use_custom' => isset($postdata['wp_rp_thumbnail_use_custom']) && $postdata['wp_rp_thumbnail_use_custom'] === 'yes',
171
  'thumbnail_custom_field' => isset($postdata['wp_rp_thumbnail_custom_field']) ? trim($postdata['wp_rp_thumbnail_custom_field']) : '',
172
  'display_zemanta_linky' => $meta['show_zemanta_linky_option'] ? isset($postdata['wp_rp_display_zemanta_linky']) : true,
 
173
 
174
  'mobile' => array(
175
  'display_comment_count' => isset($postdata['wp_rp_mobile_display_comment_count']),
@@ -594,6 +595,12 @@ function wp_rp_settings_page() {
594
  <input name="wp_rp_display_zemanta_linky" type="checkbox" id="wp_rp_display_zemanta_linky" value="yes" <?php checked($options['display_zemanta_linky']); ?> />
595
  <?php _e("Support us (show our logo)",'wp_related_posts');?>
596
  </label><?php endif; ?>
 
 
 
 
 
 
597
  </td>
598
  </tr>
599
  </table>
170
  'thumbnail_use_custom' => isset($postdata['wp_rp_thumbnail_use_custom']) && $postdata['wp_rp_thumbnail_use_custom'] === 'yes',
171
  'thumbnail_custom_field' => isset($postdata['wp_rp_thumbnail_custom_field']) ? trim($postdata['wp_rp_thumbnail_custom_field']) : '',
172
  'display_zemanta_linky' => $meta['show_zemanta_linky_option'] ? isset($postdata['wp_rp_display_zemanta_linky']) : true,
173
+ 'only_admins_can_edit_related_posts' => !empty($postdata['wp_rp_only_admins_can_edit_related_posts']),
174
 
175
  'mobile' => array(
176
  'display_comment_count' => isset($postdata['wp_rp_mobile_display_comment_count']),
595
  <input name="wp_rp_display_zemanta_linky" type="checkbox" id="wp_rp_display_zemanta_linky" value="yes" <?php checked($options['display_zemanta_linky']); ?> />
596
  <?php _e("Support us (show our logo)",'wp_related_posts');?>
597
  </label><?php endif; ?>
598
+ <div>
599
+ <label>
600
+ <input type="checkbox" name="wp_rp_only_admins_can_edit_related_posts" id="wp_rp_only_admins_can_edit_related_posts" value="yes" <?php checked($options['only_admins_can_edit_related_posts']); ?> />
601
+ <?php _e("Only admins can edit Related Posts",'wp_related_posts');?>
602
+ </label>
603
+ </div>
604
  </td>
605
  </tr>
606
  </table>
wp_related_posts.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
  /*
3
  Plugin Name: WordPress Related Posts
4
- Version: 3.3
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.
8
  Author URI: http://www.zemanta.com
9
  */
10
 
11
- define('WP_RP_VERSION', '3.3');
12
 
13
  define('WP_RP_PLUGIN_FILE', plugin_basename(__FILE__));
14
 
@@ -514,7 +514,7 @@ function wp_rp_get_related_posts($before_title = '', $after_title = '') {
514
  }
515
 
516
  $posts_footer = '';
517
- if (current_user_can('edit_posts') && $statistics_enabled) {
518
  $posts_footer .= '<div class="wp_rp_footer"><a class="wp_rp_edit" href="#" id="wp_rp_edit_related_posts">Edit Related Posts</a></div>';
519
  }
520
  if ($options['display_zemanta_linky']) {
1
  <?php
2
  /*
3
  Plugin Name: WordPress Related Posts
4
+ Version: 3.3.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.
8
  Author URI: http://www.zemanta.com
9
  */
10
 
11
+ define('WP_RP_VERSION', '3.3.1');
12
 
13
  define('WP_RP_PLUGIN_FILE', plugin_basename(__FILE__));
14
 
514
  }
515
 
516
  $posts_footer = '';
517
+ if (current_user_can($options['only_admins_can_edit_related_posts'] ? 'manage_options' : 'edit_posts') && $statistics_enabled) {
518
  $posts_footer .= '<div class="wp_rp_footer"><a class="wp_rp_edit" href="#" id="wp_rp_edit_related_posts">Edit Related Posts</a></div>';
519
  }
520
  if ($options['display_zemanta_linky']) {