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broken-link-checker / broken-link-checker.php
broken-link-checker Last commit date
images 17 years ago languages 16 years ago JSON.php 17 years ago broken-link-checker.php 16 years ago config-manager.php 16 years ago core.php 16 years ago highlighter-class.php 16 years ago instance-classes.php 16 years ago link-classes.php 16 years ago readme.txt 16 years ago uninstall.php 16 years ago utility-class.php 16 years ago
broken-link-checker.php
100 lines
1 <?php
2
3 /*
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 posts for broken links and missing images and notifies you on the dashboard if any are found.
7 Version: 0.6.1
8 Author: Janis Elsts
9 Author URI: http://w-shadow.com/blog/
10 */
11
12 /*
13 Created by Janis Elsts (email : whiteshadow@w-shadow.com)
14 MySQL 4.0 compatibility by Jeroen (www.yukka.eu)
15 */
16
17 define('BLC_DEBUG', false);
18
19 /*
20 //FirePHP for debugging
21 if ( !class_exists('FB') ) {
22 require_once 'FirePHPCore/fb.php4';
23 }
24 //FB::setEnabled(false);
25
26 //to comment out all calls : (^[^\/]*)(FB::) -> $1\/\/$2
27 //to uncomment : \/\/(\s*FB::) -> $1
28 //*/
29
30 //Make sure some useful constants are defined
31 if ( ! defined( 'WP_CONTENT_URL' ) )
32 define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
33 if ( ! defined( 'WP_CONTENT_DIR' ) )
34 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
35 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 //The HTTP code of a link record can be set to one of these in some special circumstances
41 if ( ! defined('BLC_CHECKING') )
42 define('BLC_CHECKING', 1); //The link is currently being checked. If this state persists, suspect a glitch.
43 if ( ! defined('BLC_TIMEOUT') )
44 define('BLC_TIMEOUT', 0); //The code used for links that timed out and didn't return an actual response.
45
46 //Load and initialize the plugin's configuration
47 $blc_directory = dirname(__FILE__);
48 require $blc_directory . '/config-manager.php';
49 $blc_config_manager = new blcConfigurationManager(
50 //Save the plugin's configuration into this DB option
51 'wsblc_options',
52 //Initialize default settings
53 array(
54 'max_execution_time' => 5*60, //How long the worker instance may run, at most.
55 'check_threshold' => 72, //Check each link every 72 hours.
56 'mark_broken_links' => true, //Whether to add the broken_link class to broken links in posts.
57 'broken_link_css' => ".broken_link, a.broken_link {\n\ttext-decoration: line-through;\n}",
58 'exclusion_list' => array(), //Links that contain a substring listed in this array won't be checked.
59 'recheck_count' => 3, //[Internal] How many times a broken link should be re-checked (slightly buggy)
60
61 //These three are currently ignored. Everything is checked by default.
62 'check_posts' => true,
63 'check_custom_fields' => true,
64 'check_blogroll' => true,
65
66 'custom_fields' => array(), //List of custom fields that can contain URLs and should be checked.
67
68 'autoexpand_widget' => true, //Autoexpand the Dashboard widget if broken links are detected
69
70 'need_resynch' => false, //[Internal flag]
71 'current_db_version' => 0, //The current version of the plugin's tables
72
73 'custom_tmp_dir' => '', //The lockfile will be stored in this directory.
74 //If this option is not set, the plugin's own directory or the
75 //system-wide /tmp directory will be used instead.
76
77 'timeout' => 30, //Links that take longer than this to respond will be treated as broken.
78 )
79 );
80
81
82 if ( !is_admin() ){
83 //This is user-side request, so the only thing we may need to do is run the broken link highlighter.
84 if ( $blc_config_manager->options['mark_broken_links'] ){
85 //Load some utilities (used by the higlighter) and the highlighter itself
86 require $blc_directory . '/utility-class.php';
87 require $blc_directory . '/highlighter-class.php';
88 $blc_link_highlighter = new blcLinkHighlighter( $blc_config_manager->options['broken_link_css'] );
89 }
90 } else {
91 //Load everything
92 require $blc_directory . '/utility-class.php';
93 require $blc_directory . '/instance-classes.php';
94 require $blc_directory . '/link-classes.php';
95 require $blc_directory . '/core.php';
96
97 $ws_link_checker = new wsBrokenLinkChecker( __FILE__ , $blc_config_manager );
98 }
99
100 ?>