Version Description
Download this release
Release Info
Developer | barrykooij |
Plugin | Related Posts for WordPress |
Version | 1.6.3 |
Comparing to | |
See all releases |
Code changes from version 1.6.2 to 1.6.3
- classes/class-installer.php +0 -32
- classes/class-rp4wp.php +1 -17
- includes/installer-functions.php +17 -0
- readme.txt +4 -1
- related-posts-for-wp.php +10 -3
classes/class-installer.php
DELETED
@@ -1,32 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
} // Exit if accessed directly
|
6 |
-
|
7 |
-
class RP4WP_Installer {
|
8 |
-
|
9 |
-
/**
|
10 |
-
* Create the related cache database table
|
11 |
-
*/
|
12 |
-
public function create_db_table_related() {
|
13 |
-
global $wpdb;
|
14 |
-
|
15 |
-
$sql = "CREATE TABLE IF NOT EXISTS `" . RP4WP_Related_Word_Manager::get_database_table() . "` (
|
16 |
-
`post_id` bigint(20) unsigned NOT NULL,
|
17 |
-
`word` varchar(255) CHARACTER SET utf8 NOT NULL,
|
18 |
-
`weight` float unsigned NOT NULL,
|
19 |
-
`post_type` varchar(20) CHARACTER SET utf8 NOT NULL,
|
20 |
-
PRIMARY KEY (`post_id`,`word`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
21 |
-
|
22 |
-
$wpdb->query( $sql );
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Install method, do all the install work
|
27 |
-
*/
|
28 |
-
public function install() {
|
29 |
-
$this->create_db_table_related();
|
30 |
-
}
|
31 |
-
|
32 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
classes/class-rp4wp.php
CHANGED
@@ -8,7 +8,7 @@ class RP4WP {
|
|
8 |
|
9 |
private static $instance = null;
|
10 |
|
11 |
-
const VERSION = '1.6.
|
12 |
|
13 |
/**
|
14 |
* @var RP4WP_Settings
|
@@ -51,22 +51,6 @@ class RP4WP {
|
|
51 |
spl_autoload_register( array( $autoloader, 'load' ) );
|
52 |
}
|
53 |
|
54 |
-
/**
|
55 |
-
* This method runs on plugin activation
|
56 |
-
*/
|
57 |
-
public static function activation() {
|
58 |
-
|
59 |
-
// Setup autoloader
|
60 |
-
self::setup_autoloader();
|
61 |
-
|
62 |
-
// Run the installer
|
63 |
-
$installer = new RP4WP_Installer();
|
64 |
-
$installer->install();
|
65 |
-
|
66 |
-
// Redirect to installation wizard
|
67 |
-
add_site_option( RP4WP_Constants::OPTION_DO_INSTALL, true );
|
68 |
-
}
|
69 |
-
|
70 |
/**
|
71 |
* The constructor
|
72 |
*/
|
8 |
|
9 |
private static $instance = null;
|
10 |
|
11 |
+
const VERSION = '1.6.3';
|
12 |
|
13 |
/**
|
14 |
* @var RP4WP_Settings
|
51 |
spl_autoload_register( array( $autoloader, 'load' ) );
|
52 |
}
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
/**
|
55 |
* The constructor
|
56 |
*/
|
includes/installer-functions.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function rp4wp_activate_plugin() {
|
4 |
+
global $wpdb;
|
5 |
+
|
6 |
+
$sql = "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "rp4wp_cache` (
|
7 |
+
`post_id` bigint(20) unsigned NOT NULL,
|
8 |
+
`word` varchar(255) CHARACTER SET utf8 NOT NULL,
|
9 |
+
`weight` float unsigned NOT NULL,
|
10 |
+
`post_type` varchar(20) CHARACTER SET utf8 NOT NULL,
|
11 |
+
PRIMARY KEY (`post_id`,`word`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
|
12 |
+
|
13 |
+
$wpdb->query( $sql );
|
14 |
+
|
15 |
+
// Redirect to installation wizard
|
16 |
+
add_site_option( 'rp4wp_do_install', true );
|
17 |
+
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.relatedpostsforwp.com/
|
|
4 |
Tags: related posts for wordpress, related posts for wp, simple related posts, easy related posts, related posts, related, relations, internal links, seo, bounce rate
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 4.0
|
7 |
-
Stable tag: 1.6.
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -88,6 +88,9 @@ There is one custom table created for the post cache, this table will however no
|
|
88 |
|
89 |
== Changelog ==
|
90 |
|
|
|
|
|
|
|
91 |
= 1.6.2: September 17, 2014 =
|
92 |
* Fixed a WSOD caused by wp_created_nonce being called before init hook.
|
93 |
* Changed the way the plugin is bootstrapped.
|
4 |
Tags: related posts for wordpress, related posts for wp, simple related posts, easy related posts, related posts, related, relations, internal links, seo, bounce rate
|
5 |
Requires at least: 3.6
|
6 |
Tested up to: 4.0
|
7 |
+
Stable tag: 1.6.3
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
88 |
|
89 |
== Changelog ==
|
90 |
|
91 |
+
= 1.6.3: September 18, 2014 =
|
92 |
+
* Fixed an install bug.
|
93 |
+
|
94 |
= 1.6.2: September 17, 2014 =
|
95 |
* Fixed a WSOD caused by wp_created_nonce being called before init hook.
|
96 |
* Changed the way the plugin is bootstrapped.
|
related-posts-for-wp.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Related Posts for WordPress
|
4 |
Plugin URI: http://www.relatedpostsforwp.com/
|
5 |
Description: Related Posts for WordPress, the best way to display related posts in WordPress.
|
6 |
-
Version: 1.6.
|
7 |
Author: Barry Kooij
|
8 |
Author URI: http://www.barrykooij.com/
|
9 |
License: GPL v3
|
@@ -45,5 +45,12 @@ function rp4wp_load_plugin() {
|
|
45 |
// Create object - Plugin init
|
46 |
add_action( 'plugins_loaded', 'rp4wp_load_plugin', 20 );
|
47 |
|
48 |
-
//
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
Plugin Name: Related Posts for WordPress
|
4 |
Plugin URI: http://www.relatedpostsforwp.com/
|
5 |
Description: Related Posts for WordPress, the best way to display related posts in WordPress.
|
6 |
+
Version: 1.6.3
|
7 |
Author: Barry Kooij
|
8 |
Author URI: http://www.barrykooij.com/
|
9 |
License: GPL v3
|
45 |
// Create object - Plugin init
|
46 |
add_action( 'plugins_loaded', 'rp4wp_load_plugin', 20 );
|
47 |
|
48 |
+
//
|
49 |
+
if( is_admin() && ( false === defined( 'DOING_AJAX' ) || false === DOING_AJAX ) ) {
|
50 |
+
|
51 |
+
// Load installer functions
|
52 |
+
require_once plugin_dir_path( __FILE__ ) . 'includes/installer-functions.php';
|
53 |
+
|
54 |
+
// Activation hook
|
55 |
+
register_activation_hook( __FILE__, 'rp4wp_activate_plugin' );
|
56 |
+
}
|