Version Description
- Enhanced Post Types handle
- Enhanced Paginated request handle
- Fixed bug while displaying legacy 404
- Fixed PHP notice on preview mode
Download this release
Release Info
Developer | hwk-fr |
Plugin | WP 404 Auto Redirect to Similar Post |
Version | 0.7.1 |
Comparing to | |
See all releases |
Code changes from version 0.7 to 0.7.1
- readme.txt +8 -2
- wp-404-auto-redirect-similar-post.php +8 -8
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://hwk.fr/
|
|
4 |
Tags: 404, Redirect, 301, Similar Post, SEO, Broken Link, Webmaster Tools
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.8.2
|
7 |
-
Stable tag: 0.7
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -21,7 +21,7 @@ This plugin will automatically redirect all your 404 to a similar post based on
|
|
21 |
* Easy to Install / Uninstall.
|
22 |
* Automatically detect any 404
|
23 |
* Automatically search a similar post based on the Title, Post Type, Category & Taxonomy
|
24 |
-
* **NEW** Redirect to Homepage if no similar post is found
|
25 |
* **NEW** Choose the redirection HTTP header code: 301 or 302
|
26 |
* **NEW** Debug console for administrators
|
27 |
* **NEW** Preview URL directly from the admin panel
|
@@ -46,6 +46,12 @@ This plugin will automatically redirect all your 404 to a similar post based on
|
|
46 |
|
47 |
== Changelog ==
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
= 0.7 =
|
50 |
* Reworked code
|
51 |
* Added settings page
|
4 |
Tags: 404, Redirect, 301, Similar Post, SEO, Broken Link, Webmaster Tools
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.8.2
|
7 |
+
Stable tag: 0.7.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
21 |
* Easy to Install / Uninstall.
|
22 |
* Automatically detect any 404
|
23 |
* Automatically search a similar post based on the Title, Post Type, Category & Taxonomy
|
24 |
+
* **NEW** Choose to Redirect to Homepage if no similar post is found
|
25 |
* **NEW** Choose the redirection HTTP header code: 301 or 302
|
26 |
* **NEW** Debug console for administrators
|
27 |
* **NEW** Preview URL directly from the admin panel
|
46 |
|
47 |
== Changelog ==
|
48 |
|
49 |
+
= 0.7.1 =
|
50 |
+
* Enhanced Post Types handle
|
51 |
+
* Enhanced Paginated request handle
|
52 |
+
* Fixed bug while displaying legacy 404
|
53 |
+
* Fixed PHP notice on preview mode
|
54 |
+
|
55 |
= 0.7 =
|
56 |
* Reworked code
|
57 |
* Added settings page
|
wp-404-auto-redirect-similar-post.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WP 404 Auto Redirect to Similar Post
|
4 |
* Description: Automatically Redirect any 404 to a Similar Post based on the Title, Post Type, Category & Taxonomy using 301 Redirects!
|
5 |
* Author: hwk-fr
|
6 |
-
* Version: 0.7
|
7 |
* Author URI: http://hwk.fr
|
8 |
*/
|
9 |
|
@@ -222,12 +222,12 @@ function wp404arsp_setup($query){
|
|
222 |
$query['process']['request'] = $query['request']['full'];
|
223 |
|
224 |
global $wp_query;
|
225 |
-
$
|
226 |
|
227 |
-
if(isset($
|
228 |
|
229 |
-
$query['process']['post_type'] = $
|
230 |
-
$post_type = get_post_type_object($
|
231 |
if( stripos($query['request']['full'], $post_type->rewrite['slug']) !== false )
|
232 |
$query['process']['request'] = str_replace('//', '/', substr_replace($query['request']['full'], '', stripos($query['request']['full'], $post_type->rewrite['slug']), strlen($post_type->rewrite['slug'])));
|
233 |
|
@@ -312,16 +312,16 @@ function wp404arsp_redirect($args){
|
|
312 |
$method = (!$wp404arsp_settings['method']) ? 301 : $wp404arsp_settings['method'];
|
313 |
$home_url = (!$wp404arsp_settings['home']) ? home_url() : false;
|
314 |
|
315 |
-
if( is_user_logged_in() && current_user_can('manage_options') && ($wp404arsp_settings['debug'] || $args['preview']) )
|
316 |
return wp404arsp_debug($args);
|
317 |
|
318 |
if(isset($args['url']) && !empty($args['url']))
|
319 |
return wp_redirect($args['url'], $method);
|
320 |
-
|
321 |
if($home_url)
|
322 |
return wp_redirect($home_url, $method);
|
323 |
|
324 |
-
return
|
325 |
|
326 |
}
|
327 |
|
3 |
* Plugin Name: WP 404 Auto Redirect to Similar Post
|
4 |
* Description: Automatically Redirect any 404 to a Similar Post based on the Title, Post Type, Category & Taxonomy using 301 Redirects!
|
5 |
* Author: hwk-fr
|
6 |
+
* Version: 0.7.1
|
7 |
* Author URI: http://hwk.fr
|
8 |
*/
|
9 |
|
222 |
$query['process']['request'] = $query['request']['full'];
|
223 |
|
224 |
global $wp_query;
|
225 |
+
$the_query = $wp_query->query;
|
226 |
|
227 |
+
if(isset($the_query['post_type'])){
|
228 |
|
229 |
+
$query['process']['post_type'] = $the_query['post_type'];
|
230 |
+
$post_type = get_post_type_object($the_query['post_type']);
|
231 |
if( stripos($query['request']['full'], $post_type->rewrite['slug']) !== false )
|
232 |
$query['process']['request'] = str_replace('//', '/', substr_replace($query['request']['full'], '', stripos($query['request']['full'], $post_type->rewrite['slug']), strlen($post_type->rewrite['slug'])));
|
233 |
|
312 |
$method = (!$wp404arsp_settings['method']) ? 301 : $wp404arsp_settings['method'];
|
313 |
$home_url = (!$wp404arsp_settings['home']) ? home_url() : false;
|
314 |
|
315 |
+
if( is_user_logged_in() && current_user_can('manage_options') && ($wp404arsp_settings['debug'] || (isset($args['preview']) && $args['preview'])) )
|
316 |
return wp404arsp_debug($args);
|
317 |
|
318 |
if(isset($args['url']) && !empty($args['url']))
|
319 |
return wp_redirect($args['url'], $method);
|
320 |
+
|
321 |
if($home_url)
|
322 |
return wp_redirect($home_url, $method);
|
323 |
|
324 |
+
return;
|
325 |
|
326 |
}
|
327 |
|