Broken Link Checker - Version 0.9.4.1

Version Description

Download this release

Release Info

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

Code changes from version 0.9.4 to 0.9.4.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.4
8
  Author: Janis Elsts
9
  Author URI: http://w-shadow.com/blog/
10
  Text Domain: broken-link-checker
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.4.1
8
  Author: Janis Elsts
9
  Author URI: http://w-shadow.com/blog/
10
  Text Domain: broken-link-checker
core.php CHANGED
@@ -840,7 +840,8 @@ EOZ;
840
  //TODO: More elegant handling of freshly enabled/disabled container types
841
  if ( !$old_setting && $this->conf->options['check_comment_links'] ){
842
  include $blc_directory . '/includes/containers/comment.php';
843
- $comment_manager = blcContainerRegistry::getInstance()->get_manager('comment');
 
844
  if ( $comment_manager ){
845
  $comment_manager->resynch();
846
  blc_got_unsynched_items();
@@ -858,7 +859,8 @@ EOZ;
858
  inefficient.
859
  */
860
  if ( ( count($diff1) > 0 ) || ( count($diff2) > 0 ) ){
861
- $manager = blcContainerRegistry::getInstance()->get_manager('custom_field');
 
862
  if ( !is_null($manager) ){
863
  $manager->resynch();
864
  blc_got_unsynched_items();
@@ -2459,11 +2461,13 @@ EOZ;
2459
 
2460
  //Only check links that have at least one valid instance (i.e. an instance exists and
2461
  //it corresponds to one of the currently loaded container/parser types).
2462
- $loaded_containers = array_keys(blcContainerRegistry::getInstance()->get_registered_containers());
 
2463
  $loaded_containers = array_map(array(&$wpdb, 'escape'), $loaded_containers);
2464
  $loaded_containers = "'" . implode("', '", $loaded_containers) . "'";
2465
 
2466
- $loaded_parsers = array_keys(blcParserRegistry::getInstance()->get_registered_parsers());
 
2467
  $loaded_parsers = array_map(array(&$wpdb, 'escape'), $loaded_parsers);
2468
  $loaded_parsers = "'" . implode("', '", $loaded_parsers) . "'";
2469
 
840
  //TODO: More elegant handling of freshly enabled/disabled container types
841
  if ( !$old_setting && $this->conf->options['check_comment_links'] ){
842
  include $blc_directory . '/includes/containers/comment.php';
843
+ $containerRegistry = blcContainerRegistry::getInstance();
844
+ $comment_manager = $containerRegistry->get_manager('comment');
845
  if ( $comment_manager ){
846
  $comment_manager->resynch();
847
  blc_got_unsynched_items();
859
  inefficient.
860
  */
861
  if ( ( count($diff1) > 0 ) || ( count($diff2) > 0 ) ){
862
+ $containerRegistry = blcContainerRegistry::getInstance();
863
+ $manager = $containerRegistry->get_manager('custom_field');
864
  if ( !is_null($manager) ){
865
  $manager->resynch();
866
  blc_got_unsynched_items();
2461
 
2462
  //Only check links that have at least one valid instance (i.e. an instance exists and
2463
  //it corresponds to one of the currently loaded container/parser types).
2464
+ $containerRegistry = blcContainerRegistry::getInstance();
2465
+ $loaded_containers = array_keys($containerRegistry->get_registered_containers());
2466
  $loaded_containers = array_map(array(&$wpdb, 'escape'), $loaded_containers);
2467
  $loaded_containers = "'" . implode("', '", $loaded_containers) . "'";
2468
 
2469
+ $parserRegistry = blcParserRegistry::getInstance();
2470
+ $loaded_parsers = array_keys($parserRegistry->get_registered_parsers());
2471
  $loaded_parsers = array_map(array(&$wpdb, 'escape'), $loaded_parsers);
2472
  $loaded_parsers = "'" . implode("', '", $loaded_parsers) . "'";
2473
 
includes/admin/search-form.php CHANGED
@@ -54,7 +54,8 @@
54
  $search_subfilter = $filter_id;
55
  }
56
 
57
- foreach (blcLinkQuery::getInstance()->native_filters as $filter => $data){
 
58
  $selected = ($search_subfilter == $filter)?' selected="selected"':'';
59
  printf('<option value="%s"%s>%s</option>', $filter, $selected, $data['name']);
60
  }
54
  $search_subfilter = $filter_id;
55
  }
56
 
57
+ $linkQuery = blcLinkQuery::getInstance();
58
+ foreach ($linkQuery->native_filters as $filter => $data){
59
  $selected = ($search_subfilter == $filter)?' selected="selected"':'';
60
  printf('<option value="%s"%s>%s</option>', $filter, $selected, $data['name']);
61
  }
includes/containers.php CHANGED
@@ -908,7 +908,8 @@ function blc_resynch_containers($forced = false){
908
  function blc_cleanup_containers(){
909
  global $wpdb;
910
 
911
- $loaded_containers = array_keys(blcContainerRegistry::getInstance()->get_registered_containers());
 
912
  $loaded_containers = array_map(array(&$wpdb, 'escape'), $loaded_containers);
913
  $loaded_containers = "'" . implode("', '", $loaded_containers) . "'";
914
 
908
  function blc_cleanup_containers(){
909
  global $wpdb;
910
 
911
+ $containerRegistry = blcContainerRegistry::getInstance();
912
+ $loaded_containers = array_keys($containerRegistry->get_registered_containers());
913
  $loaded_containers = array_map(array(&$wpdb, 'escape'), $loaded_containers);
914
  $loaded_containers = "'" . implode("', '", $loaded_containers) . "'";
915
 
includes/instances.php CHANGED
@@ -482,8 +482,10 @@ function blc_get_instances( $link_ids, $purpose = '', $load_containers = false,
482
 
483
  //Skip instances that reference containers or parsers that aren't currently loaded
484
  if ( !$include_invalid ){
485
- $loaded_containers = array_keys(blcContainerRegistry::getInstance()->get_registered_containers());
486
- $loaded_parsers = array_keys(blcParserRegistry::getInstance()->get_registered_parsers());
 
 
487
 
488
  $loaded_containers = array_map(array(&$wpdb, 'escape'), $loaded_containers);
489
  $loaded_parsers = array_map(array(&$wpdb, 'escape'), $loaded_parsers);
@@ -548,8 +550,10 @@ function blc_get_usable_instance_count(){
548
  $q = "SELECT COUNT(instance_id) FROM {$wpdb->prefix}blc_instances WHERE 1";
549
 
550
  //Skip instances that reference containers or parsers that aren't currently loaded
551
- $loaded_containers = array_keys(blcContainerRegistry::getInstance()->get_registered_containers());
552
- $loaded_parsers = array_keys(blcParserRegistry::getInstance()->get_registered_parsers());
 
 
553
 
554
  $loaded_containers = array_map(array(&$wpdb, 'escape'), $loaded_containers);
555
  $loaded_parsers = array_map(array(&$wpdb, 'escape'), $loaded_parsers);
@@ -577,11 +581,14 @@ function blc_cleanup_instances(){
577
  synch.container_id IS NULL";
578
  $rez = $wpdb->query($q);
579
 
580
- $loaded_containers = array_keys(blcContainerRegistry::getInstance()->get_registered_containers());
 
 
 
 
581
  $loaded_containers = array_map(array(&$wpdb, 'escape'), $loaded_containers);
582
  $loaded_containers = "'" . implode("', '", $loaded_containers) . "'";
583
 
584
- $loaded_parsers = array_keys(blcParserRegistry::getInstance()->get_registered_parsers());
585
  $loaded_parsers = array_map(array(&$wpdb, 'escape'), $loaded_parsers);
586
  $loaded_parsers = "'" . implode("', '", $loaded_parsers) . "'";
587
 
482
 
483
  //Skip instances that reference containers or parsers that aren't currently loaded
484
  if ( !$include_invalid ){
485
+ $containerRegistry = blcContainerRegistry::getInstance();
486
+ $loaded_containers = array_keys($containerRegistry->get_registered_containers());
487
+ $parserRegistry = blcParserRegistry::getInstance();
488
+ $loaded_parsers = array_keys($parserRegistry->get_registered_parsers());
489
 
490
  $loaded_containers = array_map(array(&$wpdb, 'escape'), $loaded_containers);
491
  $loaded_parsers = array_map(array(&$wpdb, 'escape'), $loaded_parsers);
550
  $q = "SELECT COUNT(instance_id) FROM {$wpdb->prefix}blc_instances WHERE 1";
551
 
552
  //Skip instances that reference containers or parsers that aren't currently loaded
553
+ $containerRegistry = blcContainerRegistry::getInstance();
554
+ $loaded_containers = array_keys($containerRegistry->get_registered_containers());
555
+ $parserRegistry = blcParserRegistry::getInstance();
556
+ $loaded_parsers = array_keys($parserRegistry->get_registered_parsers());
557
 
558
  $loaded_containers = array_map(array(&$wpdb, 'escape'), $loaded_containers);
559
  $loaded_parsers = array_map(array(&$wpdb, 'escape'), $loaded_parsers);
581
  synch.container_id IS NULL";
582
  $rez = $wpdb->query($q);
583
 
584
+ $containerRegistry = blcContainerRegistry::getInstance();
585
+ $loaded_containers = array_keys($containerRegistry->get_registered_containers());
586
+ $parserRegistry = blcParserRegistry::getInstance();
587
+ $loaded_parsers = array_keys($parserRegistry->get_registered_parsers());
588
+
589
  $loaded_containers = array_map(array(&$wpdb, 'escape'), $loaded_containers);
590
  $loaded_containers = "'" . implode("', '", $loaded_containers) . "'";
591
 
 
592
  $loaded_parsers = array_map(array(&$wpdb, 'escape'), $loaded_parsers);
593
  $loaded_parsers = "'" . implode("', '", $loaded_parsers) . "'";
594
 
includes/links.php CHANGED
@@ -1011,8 +1011,10 @@ class blcLinkQuery {
1011
  if ( empty($params['include_invalid']) ){
1012
  $join_instances = true;
1013
 
1014
- $loaded_containers = array_keys(blcContainerRegistry::getInstance()->get_registered_containers());
1015
- $loaded_parsers = array_keys(blcParserRegistry::getInstance()->get_registered_parsers());
 
 
1016
 
1017
  if ( empty($s_parser_type) ){
1018
  $s_parser_type = $loaded_parsers;
@@ -1079,7 +1081,7 @@ class blcLinkQuery {
1079
  }
1080
  }
1081
 
1082
- $pieces[] = 'link_id IN (' . implode(', ', $sanitized_link_ids) . ')';
1083
  }
1084
 
1085
  //Anchor text - use LIKE search
@@ -1377,7 +1379,8 @@ class blcLinkQuery {
1377
  * @return int|array Either an array of blcLink objects, or the number of results for the query.
1378
  */
1379
  function blc_get_links($params = null){
1380
- return blcLinkQuery::getInstance()->get_links($params, $purpose);
 
1381
  }
1382
 
1383
  /**
1011
  if ( empty($params['include_invalid']) ){
1012
  $join_instances = true;
1013
 
1014
+ $containerRegistry = blcContainerRegistry::getInstance();
1015
+ $loaded_containers = array_keys($containerRegistry->get_registered_containers());
1016
+ $parserRegistry = blcParserRegistry::getInstance();
1017
+ $loaded_parsers = array_keys($parserRegistry->get_registered_parsers());
1018
 
1019
  if ( empty($s_parser_type) ){
1020
  $s_parser_type = $loaded_parsers;
1081
  }
1082
  }
1083
 
1084
+ $pieces[] = 'links.link_id IN (' . implode(', ', $sanitized_link_ids) . ')';
1085
  }
1086
 
1087
  //Anchor text - use LIKE search
1379
  * @return int|array Either an array of blcLink objects, or the number of results for the query.
1380
  */
1381
  function blc_get_links($params = null){
1382
+ $instance = blcLinkQuery::getInstance();
1383
+ return $instance->get_links($params, $purpose);
1384
  }
1385
 
1386
  /**
includes/parsers.php CHANGED
@@ -343,7 +343,8 @@ class blcParser {
343
  * @return bool
344
  */
345
  function blc_register_parser( $parser_type, $class_name ) {
346
- return blcParserRegistry::getInstance()->register_parser($parser_type, $class_name);
 
347
  }
348
 
349
  /**
@@ -355,7 +356,8 @@ function blc_register_parser( $parser_type, $class_name ) {
355
  * @return blcParser|null
356
  */
357
  function blc_get_parser( $parser_type ){
358
- return blcParserRegistry::getInstance()->get_parser($parser_type);
 
359
  }
360
 
361
  /**
@@ -368,7 +370,8 @@ function blc_get_parser( $parser_type ){
368
  * @return array of blcParser
369
  */
370
  function blc_get_parsers( $format, $container_type ){
371
- return blcParserRegistry::getInstance()->get_parsers($format, $container_type);
 
372
  }
373
 
374
 
343
  * @return bool
344
  */
345
  function blc_register_parser( $parser_type, $class_name ) {
346
+ $instance = blcParserRegistry::getInstance();
347
+ return $instance->register_parser($parser_type, $class_name);
348
  }
349
 
350
  /**
356
  * @return blcParser|null
357
  */
358
  function blc_get_parser( $parser_type ){
359
+ $instance = blcParserRegistry::getInstance();
360
+ return $instance->get_parser($parser_type);
361
  }
362
 
363
  /**
370
  * @return array of blcParser
371
  */
372
  function blc_get_parsers( $format, $container_type ){
373
+ $instance = blcParserRegistry::getInstance();
374
+ return $instance->get_parsers($format, $container_type);
375
  }
376
 
377
 
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
6
- Stable tag: 0.9.4
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
 
@@ -52,7 +52,7 @@ There are several actions associated with each link. They show up when you move
52
  * Hindi - [Outshine Solutions](http://outshinesolutions.com/)
53
  * Italian - [Gianni Diurno](http://gidibao.net/index.php/portfolio/) and [Giacomo Ross](http://www.luxemozione.com/) (alternative)
54
  * Japanese - [ningendesu](http://ningendesu.com/)
55
- * Portuguese - Pedro Daniel Martinho
56
  * Russian - [Anna Ozeritskaya](http://hweia.ru/)
57
  * Spanish - [Neoshinji](http://blog.tuayudainformatica.com/traducciones-de-plugins-wordpress/)
58
  * Ukrainian - [Stas Mykhajlyuk](http://www.kosivart.com/)
3
  Tags: links, broken, maintenance, blogroll, custom fields, admin, comments, posts
4
  Requires at least: 2.9.0
5
  Tested up to: 3.0
6
+ Stable tag: 0.9.4.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
 
52
  * Hindi - [Outshine Solutions](http://outshinesolutions.com/)
53
  * Italian - [Gianni Diurno](http://gidibao.net/index.php/portfolio/) and [Giacomo Ross](http://www.luxemozione.com/) (alternative)
54
  * Japanese - [ningendesu](http://ningendesu.com/)
55
+ * Portuguese - PedroM
56
  * Russian - [Anna Ozeritskaya](http://hweia.ru/)
57
  * Spanish - [Neoshinji](http://blog.tuayudainformatica.com/traducciones-de-plugins-wordpress/)
58
  * Ukrainian - [Stas Mykhajlyuk](http://www.kosivart.com/)