Related Posts for WordPress - Version 1.3.1

Version Description

Download this release

Release Info

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

Code changes from version 1.3.0 to 1.3.1

classes/class-constants.php CHANGED
@@ -21,8 +21,8 @@ abstract class RP4WP_Constants {
21
  const OPTION_DO_INSTALL = 'rp4wp_do_install';
22
 
23
  // Nag options
24
- const OPTION_INSTALL_DATE = 'rp4wp-install-date';
25
- const OPTION_ADMIN_NOTICE_KEY = 'rp4wp-hide-nag';
26
 
27
 
28
  }
21
  const OPTION_DO_INSTALL = 'rp4wp_do_install';
22
 
23
  // Nag options
24
+ const OPTION_INSTALL_DATE = 'rp4wp_install_date';
25
+ const OPTION_ADMIN_NOTICE_KEY = 'rp4wp_hide_nag';
26
 
27
 
28
  }
classes/class-settings.php CHANGED
@@ -35,7 +35,7 @@ class RP4WP_Settings {
35
  self::PREFIX . 'automatic_linking' => array(
36
  'id' => 'automatic_linking',
37
  'label' => __( 'Automatic post linking', 'related-posts-for-wp' ),
38
- 'description' => __( 'This section contains automatic post link related settings.', 'related-posts-for-wp' ),
39
  'fields' => array(
40
  array(
41
  'id' => 'automatic_linking',
@@ -53,38 +53,51 @@ class RP4WP_Settings {
53
  )
54
  ) ),
55
  self::PREFIX . 'css' => array(
56
- 'id' => 'css',
57
- 'label' => __( 'Frontend Settings', 'related-posts-for-wp' ),
58
- 'description' => __( 'This section contains frontend related settings.', 'related-posts-for-wp' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  'fields' => array(
60
  array(
61
- 'id' => 'heading_text',
62
- 'label' => __( 'Heading text', 'related-posts-for-wp' ),
63
- 'description' => __( 'The text that is displayed above the related posts. To disable, leave field empty.', 'related-posts-for-wp' ),
64
- 'type' => 'text',
65
- 'default' => 'Related Posts',
66
- ),
67
- array(
68
- 'id' => 'excerpt_length',
69
- 'label' => __( 'Excerpt length', 'related-posts-for-wp' ),
70
- 'description' => __( 'The amount of words to be displayed below the title on website. To disable, set value to 0.', 'related-posts-for-wp' ),
71
- 'type' => 'text',
72
- 'default' => '15',
73
- ),
74
- array(
75
- 'id' => 'display_image',
76
- 'label' => __( 'Display Image', 'related-posts-for-wp' ),
77
- 'description' => __( 'Checking this will enable displaying featured images of related posts.', 'related-posts-for-wp' ),
78
  'type' => 'checkbox',
79
  'default' => 0,
80
  ),
81
- array(
82
- 'id' => 'css',
83
- 'label' => __( 'CSS', 'related-posts-for-wp' ),
84
- 'description' => __( 'Warning! This is an advanced feature! An error here will break frontend display. To disable, leave field empty.', 'related-posts-for-wp' ),
85
- 'type' => 'textarea',
86
- 'default' => implode(PHP_EOL, $css_default_lines),
87
- )
88
  ) )
89
  );
90
 
35
  self::PREFIX . 'automatic_linking' => array(
36
  'id' => 'automatic_linking',
37
  'label' => __( 'Automatic post linking', 'related-posts-for-wp' ),
38
+ 'description' => __( 'The following options affect how related posts are automatically linked.', 'related-posts-for-wp' ),
39
  'fields' => array(
40
  array(
41
  'id' => 'automatic_linking',
53
  )
54
  ) ),
55
  self::PREFIX . 'css' => array(
56
+ 'id' => 'css',
57
+ 'label' => __( 'Frontend Settings', 'related-posts-for-wp' ),
58
+ 'description' => __( 'The following options affect how related posts are displayed on the frontend.', 'related-posts-for-wp' ),
59
+ 'fields' => array(
60
+ array(
61
+ 'id' => 'heading_text',
62
+ 'label' => __( 'Heading text', 'related-posts-for-wp' ),
63
+ 'description' => __( 'The text that is displayed above the related posts. To disable, leave field empty.', 'related-posts-for-wp' ),
64
+ 'type' => 'text',
65
+ 'default' => 'Related Posts',
66
+ ),
67
+ array(
68
+ 'id' => 'excerpt_length',
69
+ 'label' => __( 'Excerpt length', 'related-posts-for-wp' ),
70
+ 'description' => __( 'The amount of words to be displayed below the title on website. To disable, set value to 0.', 'related-posts-for-wp' ),
71
+ 'type' => 'text',
72
+ 'default' => '15',
73
+ ),
74
+ array(
75
+ 'id' => 'display_image',
76
+ 'label' => __( 'Display Image', 'related-posts-for-wp' ),
77
+ 'description' => __( 'Checking this will enable displaying featured images of related posts.', 'related-posts-for-wp' ),
78
+ 'type' => 'checkbox',
79
+ 'default' => 0,
80
+ ),
81
+ array(
82
+ 'id' => 'css',
83
+ 'label' => __( 'CSS', 'related-posts-for-wp' ),
84
+ 'description' => __( 'Warning! This is an advanced feature! An error here will break frontend display. To disable, leave field empty.', 'related-posts-for-wp' ),
85
+ 'type' => 'textarea',
86
+ 'default' => implode(PHP_EOL, $css_default_lines),
87
+ )
88
+ ) ),
89
+ self::PREFIX . 'misc' => array(
90
+ 'id' => 'misc',
91
+ 'label' => __( 'Miscellaneous Settings', 'related-posts-for-wp' ),
92
+ 'description' => __( "A shelter for options that just don't fit in.", 'related-posts-for-wp' ),
93
  'fields' => array(
94
  array(
95
+ 'id' => 'clean_on_uninstall',
96
+ 'label' => __( 'Remove Data on Uninstall?', 'related-posts-for-wp' ),
97
+ 'description' => __( 'Check this box if you would like to completely remove all of its data when the plugin is deleted.', 'related-posts-for-wp' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  'type' => 'checkbox',
99
  'default' => 0,
100
  ),
 
 
 
 
 
 
 
101
  ) )
102
  );
103
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: barrykooij
3
  Donate link: http://www.barrykooij.com/
4
  Tags: related posts for wordpress, related posts for wp, simple related posts, easy related posts, related posts, related, relations, internal links, seo
5
  Requires at least: 3.6
6
- Tested up to: 3.9.2
7
- Stable tag: 1.3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -76,6 +76,10 @@ There is one custom table created for the post cache, this table will however no
76
 
77
  == Changelog ==
78
 
 
 
 
 
79
  = 1.3.0 : August 18, 2014 =
80
  * Added 'rp4wp_children' template function.
81
  * Added shortcode [rp4wp]
3
  Donate link: http://www.barrykooij.com/
4
  Tags: related posts for wordpress, related posts for wp, simple related posts, easy related posts, related posts, related, relations, internal links, seo
5
  Requires at least: 3.6
6
+ Tested up to: 4.0
7
+ Stable tag: 1.3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
76
 
77
  == Changelog ==
78
 
79
+ = 1.3.1: August 21, 2014 =
80
+ * Added an uninstall procedure, see settings panel.
81
+ * Added plugin icons (yay).
82
+
83
  = 1.3.0 : August 18, 2014 =
84
  * Added 'rp4wp_children' template function.
85
  * Added shortcode [rp4wp]
related-posts-for-wp.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Related Posts for WordPress
4
  Plugin URI: http://www.barrykooij.com/
5
  Description: Related Posts for WordPress, related posts that perform!
6
- Version: 1.3.0
7
  Author: Barry Kooij
8
  Author URI: http://www.barrykooij.com/
9
  License: GPL v3
@@ -26,7 +26,7 @@ class RP4WP {
26
 
27
  private static $instance = null;
28
 
29
- const VERSION = '1.3.0';
30
 
31
  /**
32
  * @var RP4WP_Settings
3
  Plugin Name: Related Posts for WordPress
4
  Plugin URI: http://www.barrykooij.com/
5
  Description: Related Posts for WordPress, related posts that perform!
6
+ Version: 1.3.1
7
  Author: Barry Kooij
8
  Author URI: http://www.barrykooij.com/
9
  License: GPL v3
26
 
27
  private static $instance = null;
28
 
29
+ const VERSION = '1.3.1';
30
 
31
  /**
32
  * @var RP4WP_Settings
uninstall.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // What is happening?
4
+ if ( !defined( 'ABSPATH' ) || !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
5
+ exit();
6
+ }
7
+
8
+ // Should we clean?
9
+ $options = get_option( 'rp4wp', array() );
10
+ if ( isset( $options['clean_on_uninstall'] ) && 1 == $options['clean_on_uninstall'] ) {
11
+
12
+ global $wpdb;
13
+
14
+ /**
15
+ * Once upon a time I was relating posts
16
+ * But now I'm only cleaning them up
17
+ * There's nothing I can do
18
+ * A total eclipse of the heart
19
+ */
20
+
21
+ // Get ID's of post links
22
+ $link_ids = get_posts(
23
+ array(
24
+ 'post_type' => 'rp4wp_link',
25
+ 'fields' => 'ids',
26
+ 'posts_per_page' => - 1
27
+ )
28
+ );
29
+
30
+ // Delete all link posts
31
+ $wpdb->query( "DELETE FROM $wpdb->posts WHERE `ID` IN (" . implode( ",", $link_ids ) . ");" );
32
+
33
+ // Delete all link post meta
34
+ $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE `post_id` IN (" . implode( ",", $link_ids ) . ");" );
35
+
36
+
37
+ // Delete the options
38
+ delete_option( 'rp4wp' );
39
+ delete_option( 'rp4wp_do_install' );
40
+ delete_option( 'rp4wp_install_date' );
41
+ delete_option( 'rp4wp_hide_nag' );
42
+
43
+ // Remove the post meta we attached to posts
44
+ $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE `meta_key` = 'rp4wp_auto_linked' OR `meta_key` = 'rp4wp_cached' " );
45
+
46
+ }