Version Description
Download this release
Release Info
Developer | whiteshadow |
Plugin | Broken Link Checker |
Version | 0.5.8 |
Comparing to | |
See all releases |
Code changes from version 0.5.7 to 0.5.8
- broken-link-checker.php +9 -3
- link-classes.php +3 -3
- readme.txt +1 -1
broken-link-checker.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Broken Link Checker
|
4 |
Plugin URI: http://w-shadow.com/blog/2007/08/05/broken-link-checker-for-wordpress/
|
5 |
Description: Checks your posts for broken links and missing images and notifies you on the dashboard if any are found.
|
6 |
-
Version: 0.5.
|
7 |
Author: Janis Elsts
|
8 |
Author URI: http://w-shadow.com/blog/
|
9 |
*/
|
@@ -36,6 +36,9 @@ if ( ! defined( 'WP_PLUGIN_URL' ) )
|
|
36 |
define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
|
37 |
if ( ! defined( 'WP_PLUGIN_DIR' ) )
|
38 |
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
|
|
|
|
|
|
|
39 |
|
40 |
/*
|
41 |
//FirePHP for debugging
|
@@ -688,7 +691,7 @@ class ws_broken_link_checker {
|
|
688 |
//Available filters by link type + the appropriate WHERE expressions
|
689 |
$filters = array(
|
690 |
'broken' => array(
|
691 |
-
'where_expr' => '( http_code < 200 OR http_code >= 400 OR timeout = 1 ) AND ( check_count > 0 )',
|
692 |
'name' => 'Broken',
|
693 |
'heading' => 'Broken Links',
|
694 |
'heading_zero' => 'No broken links found'
|
@@ -1398,6 +1401,9 @@ jQuery(function($){
|
|
1398 |
function parse_post($content, $post_id){
|
1399 |
//remove all <code></code> blocks first
|
1400 |
$content = preg_replace('/<code>.+?<\/code>/i', ' ', $content);
|
|
|
|
|
|
|
1401 |
$permalink = get_permalink( $post_id );
|
1402 |
|
1403 |
//Find links
|
@@ -1836,7 +1842,7 @@ jQuery(function($){
|
|
1836 |
$known_instances = $wpdb->get_var($q);
|
1837 |
|
1838 |
$q = "SELECT count(*) FROM {$wpdb->prefix}blc_links
|
1839 |
-
WHERE check_count > 0 AND ( http_code < 200 OR http_code >= 400 OR timeout = 1 )";
|
1840 |
$broken_links = $wpdb->get_var($q);
|
1841 |
|
1842 |
$q = "SELECT count(*) FROM {$wpdb->prefix}blc_links
|
3 |
Plugin Name: Broken Link Checker
|
4 |
Plugin URI: http://w-shadow.com/blog/2007/08/05/broken-link-checker-for-wordpress/
|
5 |
Description: Checks your posts for broken links and missing images and notifies you on the dashboard if any are found.
|
6 |
+
Version: 0.5.8
|
7 |
Author: Janis Elsts
|
8 |
Author URI: http://w-shadow.com/blog/
|
9 |
*/
|
36 |
define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
|
37 |
if ( ! defined( 'WP_PLUGIN_DIR' ) )
|
38 |
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
|
39 |
+
|
40 |
+
define('BLC_CHECKING', 1);
|
41 |
+
define('BLC_TIMEOUT', 1);
|
42 |
|
43 |
/*
|
44 |
//FirePHP for debugging
|
691 |
//Available filters by link type + the appropriate WHERE expressions
|
692 |
$filters = array(
|
693 |
'broken' => array(
|
694 |
+
'where_expr' => '( http_code < 200 OR http_code >= 400 OR timeout = 1 ) AND ( check_count > 0 ) AND ( http_code <> ' . BLC_CHECKING . ')',
|
695 |
'name' => 'Broken',
|
696 |
'heading' => 'Broken Links',
|
697 |
'heading_zero' => 'No broken links found'
|
1401 |
function parse_post($content, $post_id){
|
1402 |
//remove all <code></code> blocks first
|
1403 |
$content = preg_replace('/<code>.+?<\/code>/i', ' ', $content);
|
1404 |
+
//remove all <pre></pre> blocks as well
|
1405 |
+
$content = preg_replace('/<pre>.+?<\/pre>/i', ' ', $content);
|
1406 |
+
//Get the post permalink - it's used to resolve relative URLs
|
1407 |
$permalink = get_permalink( $post_id );
|
1408 |
|
1409 |
//Find links
|
1842 |
$known_instances = $wpdb->get_var($q);
|
1843 |
|
1844 |
$q = "SELECT count(*) FROM {$wpdb->prefix}blc_links
|
1845 |
+
WHERE check_count > 0 AND ( http_code < 200 OR http_code >= 400 OR timeout = 1 ) AND ( http_code <> ".BLC_CHECKING." )";
|
1846 |
$broken_links = $wpdb->get_var($q);
|
1847 |
|
1848 |
$q = "SELECT count(*) FROM {$wpdb->prefix}blc_links
|
link-classes.php
CHANGED
@@ -117,7 +117,7 @@ class blcLink {
|
|
117 |
$this->last_check = date('Y-m-d H:i:s');
|
118 |
$this->log = '';
|
119 |
$this->final_url = '';
|
120 |
-
$this->http_code =
|
121 |
$this->request_duration = 0;
|
122 |
$this->timeout = false;
|
123 |
$this->redirect_count = 0;
|
@@ -227,7 +227,7 @@ class blcLink {
|
|
227 |
|
228 |
$this->http_code = $snoopy->status; //HTTP status code (note : Snoopy returns -100 on timeout)
|
229 |
if ( $this->http_code == -100 ){
|
230 |
-
$this->http_code =
|
231 |
$this->timeout = true;
|
232 |
}
|
233 |
|
@@ -259,7 +259,7 @@ class blcLink {
|
|
259 |
return true;
|
260 |
} else {
|
261 |
$this->log .= "Link is broken.";
|
262 |
-
if ( $this->http_code ==
|
263 |
//This is probably a timeout
|
264 |
$this->timeout = true;
|
265 |
$this->log .= "\r\n(Most likely the connection timed out)";
|
117 |
$this->last_check = date('Y-m-d H:i:s');
|
118 |
$this->log = '';
|
119 |
$this->final_url = '';
|
120 |
+
$this->http_code = BLC_CHECKING;
|
121 |
$this->request_duration = 0;
|
122 |
$this->timeout = false;
|
123 |
$this->redirect_count = 0;
|
227 |
|
228 |
$this->http_code = $snoopy->status; //HTTP status code (note : Snoopy returns -100 on timeout)
|
229 |
if ( $this->http_code == -100 ){
|
230 |
+
$this->http_code = BLC_TIMEOUT;
|
231 |
$this->timeout = true;
|
232 |
}
|
233 |
|
259 |
return true;
|
260 |
} else {
|
261 |
$this->log .= "Link is broken.";
|
262 |
+
if ( $this->http_code == BLC_TIMEOUT ){
|
263 |
//This is probably a timeout
|
264 |
$this->timeout = true;
|
265 |
$this->log .= "\r\n(Most likely the connection timed out)";
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: whiteshadow
|
|
3 |
Tags: links, broken, maintenance, blogroll, custom fields, admin
|
4 |
Requires at least: 2.7.0
|
5 |
Tested up to: 2.9
|
6 |
-
Stable tag: 0.5.
|
7 |
|
8 |
This plugin will check your posts, custom fields and the blogroll for broken links and missing images and notify you on the dashboard if any are found.
|
9 |
|
3 |
Tags: links, broken, maintenance, blogroll, custom fields, admin
|
4 |
Requires at least: 2.7.0
|
5 |
Tested up to: 2.9
|
6 |
+
Stable tag: 0.5.8
|
7 |
|
8 |
This plugin will check your posts, custom fields and the blogroll for broken links and missing images and notify you on the dashboard if any are found.
|
9 |
|