Broken Link Checker - Version 0.3.3

Version Description

Download this release

Release Info

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

Code changes from version 0.3.2 to 0.3.3

Files changed (3) hide show
  1. broken-link-checker.php +3 -3
  2. readme.txt +1 -1
  3. wsblc_ajax.php +9 -7
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.3.2
7
  Author: Janis Elsts
8
  Author URI: http://w-shadow.com/blog/
9
  */
@@ -20,7 +20,7 @@ class ws_broken_link_checker {
20
  var $options_name='wsblc_options';
21
  var $postdata_name;
22
  var $linkdata_name;
23
- var $version='0.3.2';
24
  var $myfile='';
25
  var $myfolder='';
26
  var $mybasename='';
@@ -50,7 +50,7 @@ class ws_broken_link_checker {
50
  add_action('admin_print_scripts', array(&$this,'admin_print_scripts'));
51
  add_action('activity_box_end', array(&$this,'activity_box'));
52
 
53
- if ($this->options['mark_broken_links']){
54
  add_filter('the_content', array(&$this,'the_content'));
55
  if (!empty($this->options['broken_link_css'])){
56
  add_action('wp_head', array(&$this,'header_css'));
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.3.3
7
  Author: Janis Elsts
8
  Author URI: http://w-shadow.com/blog/
9
  */
20
  var $options_name='wsblc_options';
21
  var $postdata_name;
22
  var $linkdata_name;
23
+ var $version='0.3.3';
24
  var $myfile='';
25
  var $myfolder='';
26
  var $mybasename='';
50
  add_action('admin_print_scripts', array(&$this,'admin_print_scripts'));
51
  add_action('activity_box_end', array(&$this,'activity_box'));
52
 
53
+ if (!empty($this->options['mark_broken_links'])){
54
  add_filter('the_content', array(&$this,'the_content'));
55
  if (!empty($this->options['broken_link_css'])){
56
  add_action('wp_head', array(&$this,'header_css'));
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: whiteshadow
3
  Tags: links, broken, maintenance
4
  Requires at least: 2.0.2
5
  Tested up to: 2.3.3
6
- Stable tag: 0.3.2
7
 
8
  This plugin will check your posts for broken links and missing images in background and notify you on the dashboard if any are found.
9
 
3
  Tags: links, broken, maintenance
4
  Requires at least: 2.0.2
5
  Tested up to: 2.3.3
6
+ Stable tag: 0.3.3
7
 
8
  This plugin will check your posts for broken links and missing images in background and notify you on the dashboard if any are found.
9
 
wsblc_ajax.php CHANGED
@@ -238,6 +238,7 @@
238
  }
239
 
240
  function page_exists_simple($url){
 
241
  $parts=parse_url($url);
242
  if(!$parts) return false;
243
 
@@ -246,24 +247,25 @@
246
  $ch = curl_init();
247
  curl_setopt($ch, CURLOPT_URL, $url);
248
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
 
249
  curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
250
 
251
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
252
  curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
253
 
254
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 25);
255
- curl_setopt($ch, CURLOPT_TIMEOUT, 35);
256
 
257
  curl_setopt($ch, CURLOPT_FAILONERROR, false);
258
 
259
  $nobody=false;
260
  if($parts['scheme']=='https'){
261
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
262
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
263
  } else {
264
  $nobody=true;
265
- //curl_setopt($ch, CURLOPT_NOBODY, true);
266
- curl_setopt($ch, CURLOPT_RANGE, '0-1023');
267
  }
268
  curl_setopt($ch, CURLOPT_HEADER, true);
269
 
@@ -275,7 +277,7 @@
275
  if ( (($code<200) || ($code>=400)) && $nobody) {
276
  curl_setopt($ch, CURLOPT_NOBODY, false);
277
  curl_setopt($ch, CURLOPT_HTTPGET, true);
278
- curl_setopt($ch, CURLOPT_RANGE, '0-4095');
279
  $response = curl_exec($ch);
280
  //echo 'Response 2 : <pre>',$response,'</pre>';
281
  $code=intval(curl_getinfo($ch, CURLINFO_HTTP_CODE));
238
  }
239
 
240
  function page_exists_simple($url){
241
+ //echo "Checking $url...<br/>";
242
  $parts=parse_url($url);
243
  if(!$parts) return false;
244
 
247
  $ch = curl_init();
248
  curl_setopt($ch, CURLOPT_URL, $url);
249
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
250
+ //curl_setopt($ch, CURLOPT_USERAGENT, 'WordPress/Broken Link Checker (bot)');
251
  curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
252
 
253
+ @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
254
  curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
255
 
256
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
257
+ curl_setopt($ch, CURLOPT_TIMEOUT, 30);
258
 
259
  curl_setopt($ch, CURLOPT_FAILONERROR, false);
260
 
261
  $nobody=false;
262
  if($parts['scheme']=='https'){
263
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
264
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
265
  } else {
266
  $nobody=true;
267
+ curl_setopt($ch, CURLOPT_NOBODY, true);
268
+ //curl_setopt($ch, CURLOPT_RANGE, '0-1023');
269
  }
270
  curl_setopt($ch, CURLOPT_HEADER, true);
271
 
277
  if ( (($code<200) || ($code>=400)) && $nobody) {
278
  curl_setopt($ch, CURLOPT_NOBODY, false);
279
  curl_setopt($ch, CURLOPT_HTTPGET, true);
280
+ curl_setopt($ch, CURLOPT_RANGE, '0-2047');
281
  $response = curl_exec($ch);
282
  //echo 'Response 2 : <pre>',$response,'</pre>';
283
  $code=intval(curl_getinfo($ch, CURLINFO_HTTP_CODE));