Link Juice Keeper - Version 1.2

Version Description

  • Fix: does not redirect Google Bot doing page verification for Google Webmasters Tools
Download this release

Release Info

Developer sirzooro
Plugin Icon 128x128 Link Juice Keeper
Version 1.2
Comparing to
See all releases

Code changes from version 1.1.1 to 1.2

Files changed (3) hide show
  1. link-juice-keeper.php +17 -5
  2. readme.html +22 -2
  3. readme.txt +10 -8
link-juice-keeper.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Link Juice Keeper
4
  Plugin URI: http://www.poradnik-webmastera.com/projekty/link_juice_keeper/
5
  Description: This plugin helps you to keep the link juice by redirecting all non-existing URLs which normally return a 404 error to the front blog page using 301 redirect.
6
  Author: Daniel Frużyński
7
- Version: 1.1.1
8
  Author URI: http://www.poradnik-webmastera.com/
9
  */
10
 
@@ -45,11 +45,23 @@ if ( !class_exists( 'LinkJuiceKeeper' ) ) {
45
 
46
  function status_header( $status_header, $header ) {
47
  if ( $header == 404 ) {
48
- wp_redirect( get_bloginfo( 'siteurl' ) , 301 );
49
- exit();
50
- } else {
51
- return $status_header;
 
 
 
 
 
 
 
 
 
 
52
  }
 
 
53
  }
54
  }
55
 
4
  Plugin URI: http://www.poradnik-webmastera.com/projekty/link_juice_keeper/
5
  Description: This plugin helps you to keep the link juice by redirecting all non-existing URLs which normally return a 404 error to the front blog page using 301 redirect.
6
  Author: Daniel Frużyński
7
+ Version: 1.2
8
  Author URI: http://www.poradnik-webmastera.com/
9
  */
10
 
45
 
46
  function status_header( $status_header, $header ) {
47
  if ( $header == 404 ) {
48
+ // Extract root dir from blog url
49
+ $root = '/';
50
+ if ( preg_match( '#^http://[^/]+(/.+)$#', get_option( 'siteurl' ), $matches ) ) {
51
+ $root = $matches[1];
52
+ }
53
+ // Make sure it ends with slash
54
+ if ( $root[ strlen($root) - 1 ] != '/' ) {
55
+ $root .= '/';
56
+ }
57
+ // Check if request is not for GWT verification file
58
+ if ( strpos( $_SERVER['REQUEST_URI'], $root.'noexist_' ) !== 0 ) {
59
+ wp_redirect( get_bloginfo( 'siteurl' ) , 301 );
60
+ exit();
61
+ }
62
  }
63
+
64
+ return $status_header;
65
  }
66
  }
67
 
readme.html CHANGED
@@ -2,10 +2,10 @@
2
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
  <head>
4
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
5
- <title>Link Juice Keeper 1.1.1 Readme</title>
6
  </head>
7
  <body>
8
- <h1>Link Juice Keeper 1.1.1 Readme</h1>
9
  <p>This plugin helps you to keep the link juice by redirecting all non-existing URLs which normally return a 404 error to the blog front page using 301 redirect.</p>
10
  <p><b>Plugin Homepage:</b> <a href="http://www.poradnik-webmastera.com/projekty/link_juice_keeper/">Link Juice Keeper</a></p>
11
  <p><b>Plugin Homepage on WordPress.org:</b> <a href="http://wordpress.org/extend/plugins/link-juice-keeper/">Link Juice Keeper</a></p>
@@ -21,6 +21,7 @@
21
  <li>someone may simply put wrong (broken) link somewhere.</li>
22
  </ul>
23
  <p>All of the above leads to link juice waste. You can avoid this by using this plugin. It redirects all non-existing URLs which normally return a 404 error to the blog front page using 301 (permanent) redirect. This way everyone who comes to your blog via broken link (both people and robots) will be redirected to the front page.</p>
 
24
 
25
  <h2>Installation</h2>
26
  <ol>
@@ -30,6 +31,10 @@
30
  </ol>
31
 
32
  <h2>Changelog</h2>
 
 
 
 
33
  <p>1.1.1</p>
34
  <ul>
35
  <li>Make plugin compatible with WordPress 2.8</li>
@@ -42,5 +47,20 @@
42
  <ul>
43
  <li>Initial version</li>
44
  </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  </body>
46
  </html>
2
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
  <head>
4
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
5
+ <title>Link Juice Keeper 1.2 Readme</title>
6
  </head>
7
  <body>
8
+ <h1>Link Juice Keeper 1.2 Readme</h1>
9
  <p>This plugin helps you to keep the link juice by redirecting all non-existing URLs which normally return a 404 error to the blog front page using 301 redirect.</p>
10
  <p><b>Plugin Homepage:</b> <a href="http://www.poradnik-webmastera.com/projekty/link_juice_keeper/">Link Juice Keeper</a></p>
11
  <p><b>Plugin Homepage on WordPress.org:</b> <a href="http://wordpress.org/extend/plugins/link-juice-keeper/">Link Juice Keeper</a></p>
21
  <li>someone may simply put wrong (broken) link somewhere.</li>
22
  </ul>
23
  <p>All of the above leads to link juice waste. You can avoid this by using this plugin. It redirects all non-existing URLs which normally return a 404 error to the blog front page using 301 (permanent) redirect. This way everyone who comes to your blog via broken link (both people and robots) will be redirected to the front page.</p>
24
+ <p>The only one exception are files in root blog directory with names starting with `noexist_`. They are used by Google to verify page in Google Webmasters Tools, so Link Juice Keeper does not redirect them.</p>
25
 
26
  <h2>Installation</h2>
27
  <ol>
31
  </ol>
32
 
33
  <h2>Changelog</h2>
34
+ <p>1.2</p>
35
+ <ul>
36
+ <li>Fix: does not redirect Google Bot doing page verification for Google Webmasters Tools</li>
37
+ </ul>
38
  <p>1.1.1</p>
39
  <ul>
40
  <li>Make plugin compatible with WordPress 2.8</li>
47
  <ul>
48
  <li>Initial version</li>
49
  </ul>
50
+
51
+ <h2>Licence</h2>
52
+ <p>Copyright 2009 Daniel Frużyński (email : daniel [A-T] poradnik-webmastera.com)</p>
53
+ <p>This program is free software; you can redistribute it and/or modify
54
+ it under the terms of the GNU General Public License as published by
55
+ the Free Software Foundation; either version 2 of the License, or
56
+ (at your option) any later version.</p>
57
+ <p>This program is distributed in the hope that it will be useful,
58
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
59
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
60
+ GNU General Public License for more details.</p>
61
+ <p>You should have received a copy of the GNU General Public License
62
+ along with this program; if not, write to the Free Software
63
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA</p>
64
+
65
  </body>
66
  </html>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: sirzooro
3
  Tags: google, link, links, redirect, seo
4
  Requires at least: 2.2
5
  Tested up to: 2.8
6
- Stable tag: 1.1.1
7
 
8
  This plugin helps you to keep the link juice by redirecting all non-existing URLs (they return error 404) to the blog front page using 301 redirect.
9
 
@@ -18,7 +18,9 @@ As you probably know, incoming links play important role in ranking well in Goog
18
 
19
  All of the above leads to link juice waste. You can avoid this by using this plugin. It redirects all non-existing URLs which normally return a 404 error to the blog front page using 301 (permanent) redirect. This way everyone who comes to your blog via broken link (both people and robots) will be redirected to the front page.
20
 
21
- [Changelog](http://wordpress.org/extend/plugins/link-juice-keeper/other_notes/)
 
 
22
 
23
  == Installation ==
24
 
@@ -28,14 +30,14 @@ All of the above leads to link juice waste. You can avoid this by using this plu
28
 
29
  == Changelog ==
30
 
31
- 1.1.1
 
32
 
 
33
  * Make plugin compatible with WordPress 2.8
34
 
35
- 1.1
36
-
37
  * Decreased filter priority, so now it will run after ones with default priority
38
 
39
- 1.0
40
-
41
- * Initial version
3
  Tags: google, link, links, redirect, seo
4
  Requires at least: 2.2
5
  Tested up to: 2.8
6
+ Stable tag: 1.2
7
 
8
  This plugin helps you to keep the link juice by redirecting all non-existing URLs (they return error 404) to the blog front page using 301 redirect.
9
 
18
 
19
  All of the above leads to link juice waste. You can avoid this by using this plugin. It redirects all non-existing URLs which normally return a 404 error to the blog front page using 301 (permanent) redirect. This way everyone who comes to your blog via broken link (both people and robots) will be redirected to the front page.
20
 
21
+ The only one exception are files in root blog directory with names starting with `noexist_`. They are used by Google to verify page in Google Webmasters Tools, so Link Juice Keeper does not redirect them.
22
+
23
+ [Changelog](http://wordpress.org/extend/plugins/link-juice-keeper/changelog/)
24
 
25
  == Installation ==
26
 
30
 
31
  == Changelog ==
32
 
33
+ = 1.2 =
34
+ * Fix: does not redirect Google Bot doing page verification for Google Webmasters Tools
35
 
36
+ = 1.1.1 =
37
  * Make plugin compatible with WordPress 2.8
38
 
39
+ = 1.1 =
 
40
  * Decreased filter priority, so now it will run after ones with default priority
41
 
42
+ = 1.0 =
43
+ * Initial version