Broken Link Checker - Version 0.9.1

Version Description

Download this release

Release Info

Developer whiteshadow
Plugin Icon 128x128 Broken Link Checker
Version 0.9.1
Comparing to
See all releases

Code changes from version 0.9 to 0.9.1

Files changed (4) hide show
  1. broken-link-checker.php +2 -2
  2. core.php +1 -1
  3. includes/checkers/http.php +10 -6
  4. readme.txt +1 -1
broken-link-checker.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Broken Link Checker
5
  Plugin URI: http://w-shadow.com/blog/2007/08/05/broken-link-checker-for-wordpress/
6
  Description: Checks your blog for broken links and missing images and notifies you on the dashboard if any are found.
7
- Version: 0.9
8
  Author: Janis Elsts
9
  Author URI: http://w-shadow.com/blog/
10
  Text Domain: broken-link-checker
@@ -89,7 +89,7 @@ $blc_config_manager = new blcConfigurationManager(
89
  'notification_schedule' => 'daily', //How often (at most) notifications will be sent. Possible values : 'daily', 'weekly'
90
  'last_notification_sent' => 0, //When the last email notification was send (Unix timestamp)
91
 
92
- 'server_load_limit' => 2, //Stop parsing stuff & checking links if the 1-minute load average
93
  //goes over this value. Only works on Linux servers. 0 = no limit.
94
  'enable_load_limit' => true, //Enable/disable load monitoring.
95
 
4
  Plugin Name: Broken Link Checker
5
  Plugin URI: http://w-shadow.com/blog/2007/08/05/broken-link-checker-for-wordpress/
6
  Description: Checks your blog for broken links and missing images and notifies you on the dashboard if any are found.
7
+ Version: 0.9.1
8
  Author: Janis Elsts
9
  Author URI: http://w-shadow.com/blog/
10
  Text Domain: broken-link-checker
89
  'notification_schedule' => 'daily', //How often (at most) notifications will be sent. Possible values : 'daily', 'weekly'
90
  'last_notification_sent' => 0, //When the last email notification was send (Unix timestamp)
91
 
92
+ 'server_load_limit' => 4, //Stop parsing stuff & checking links if the 1-minute load average
93
  //goes over this value. Only works on Linux servers. 0 = no limit.
94
  'enable_load_limit' => true, //Enable/disable load monitoring.
95
 
core.php CHANGED
@@ -939,7 +939,7 @@ EOZ;
939
 
940
  })(jQuery);
941
  </script>
942
- <?
943
 
944
  echo '<br/><span class="description">';
945
  printf(
939
 
940
  })(jQuery);
941
  </script>
942
+ <?php
943
 
944
  echo '<br/><span class="description">';
945
  printf(
includes/checkers/http.php CHANGED
@@ -158,10 +158,17 @@ class blcCurlHttp extends blcHttpChecker {
158
  $result['request_duration'] = $info['total_time'];
159
  $result['redirect_count'] = $info['redirect_count'];
160
 
161
- if ( $nobody && ($result['http_code'] == 405) ){
162
- //405 = Method not allowed. The site in question is probably expecting
163
- //GET instead of HEAD. So lets retry the request using the GET verb.
 
 
 
164
  return $this->check($url, true);
 
 
 
 
165
  }
166
 
167
  //When safe_mode or open_basedir is enabled CURL will be forbidden from following redirects,
@@ -172,9 +179,6 @@ class blcCurlHttp extends blcHttpChecker {
172
  $result['redirect_count'] = 1;
173
  }
174
 
175
- //Determine if the link counts as "broken"
176
- $result['broken'] = $this->is_error_code($result['http_code']) || $result['timeout'];
177
-
178
  //Build the log from HTTP code and headers.
179
  //TODO: Put some kind of a color-coded error explanation at the top of the log, not a cryptic HTTP code.
180
  $log .= '=== ';
158
  $result['request_duration'] = $info['total_time'];
159
  $result['redirect_count'] = $info['redirect_count'];
160
 
161
+ //Determine if the link counts as "broken"
162
+ $result['broken'] = $this->is_error_code($result['http_code']) || $result['timeout'];
163
+
164
+ if ( $nobody && $result['broken'] ){
165
+ //The site in question might be expecting GET instead of HEAD, so lets retry the request
166
+ //using the GET verb.
167
  return $this->check($url, true);
168
+
169
+ //Note : normally a server that doesn't allow HEAD requests on a specific resource *should*
170
+ //return "405 Method Not Allowed". Unfortunately, there are sites that return 404 or
171
+ //another, even more general, error code instead. So just checking for 405 wouldn't be enough.
172
  }
173
 
174
  //When safe_mode or open_basedir is enabled CURL will be forbidden from following redirects,
179
  $result['redirect_count'] = 1;
180
  }
181
 
 
 
 
182
  //Build the log from HTTP code and headers.
183
  //TODO: Put some kind of a color-coded error explanation at the top of the log, not a cryptic HTTP code.
184
  $log .= '=== ';
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: whiteshadow
3
  Tags: links, broken, maintenance, blogroll, custom fields, admin, comments, posts
4
  Requires at least: 2.9.0
5
  Tested up to: 3.0-beta1
6
- Stable tag: 0.9
7
 
8
  This plugin will check your posts, comments and other places for broken links and missing images and notify you if any are found.
9
 
3
  Tags: links, broken, maintenance, blogroll, custom fields, admin, comments, posts
4
  Requires at least: 2.9.0
5
  Tested up to: 3.0-beta1
6
+ Stable tag: 0.9.1
7
 
8
  This plugin will check your posts, comments and other places for broken links and missing images and notify you if any are found.
9