-
Notifications
You must be signed in to change notification settings - Fork 55
/
health-check.php
88 lines (74 loc) · 3.2 KB
/
health-check.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
/**
* Plugins primary file, in charge of including all other dependencies.
*
* @package Health Check
*
* @wordpress-plugin
* Plugin Name: Health Check & Troubleshooting
* Plugin URI: https://wordpress.org/plugins/health-check/
* Description: Checks the health of your WordPress install.
* Author: The WordPress.org community
* Author URI: https://wordpress.org/plugins/health-check/
* Version: 1.7.1
* Requires PHP: 5.6
* License: GPLv2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: health-check
*/
namespace HealthCheck;
// Check that the file is not accessed directly.
use Health_Check;
if ( ! defined( 'ABSPATH' ) ) {
die( 'We\'re sorry, but you can not directly access this file.' );
}
// Set the plugin file.
define( 'HEALTH_CHECK_PLUGIN_FILE', __FILE__ );
// Set the absolute path for the plugin.
define( 'HEALTH_CHECK_PLUGIN_DIRECTORY', plugin_dir_path( __FILE__ ) );
// Set the plugin URL root.
define( 'HEALTH_CHECK_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
// Always include our compatibility file first.
require_once( dirname( __FILE__ ) . '/compat.php' );
// Backwards compatible pull in of extra resources
if ( ! class_exists( 'WP_Debug_Data' ) ) {
$original_paths = array(
'class-wp-site-health.php' => ABSPATH . '/wp-admin/includes/class-wp-site-health.php',
'class-wp-debug-data.php' => ABSPATH . '/wp-admin/includes/class-wp-debug-data.php',
);
foreach ( $original_paths as $filename => $original_path ) {
if ( file_exists( $original_path ) ) {
require_once $original_path;
} else {
require_once __DIR__ . '/HealthCheck/BackCompat/' . $filename;
if ( ! defined( 'HEALTH_CHECK_BACKCOMPAT_LOADED' ) ) {
define( 'HEALTH_CHECK_BACKCOMPAT_LOADED', true );
}
}
}
}
add_action(
'plugins_loaded',
function() {
// Include class-files used by our plugin.
require_once( dirname( __FILE__ ) . '/HealthCheck/class-health-check.php' );
require_once( dirname( __FILE__ ) . '/HealthCheck/class-health-check-loopback.php' );
require_once( dirname( __FILE__ ) . '/HealthCheck/class-health-check-screenshots.php' );
require_once( dirname( __FILE__ ) . '/HealthCheck/class-health-check-troubleshoot.php' );
// Tools section.
require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-tool.php' );
require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-files-integrity.php' );
require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-mail-check.php' );
require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-debug-log-viewer.php' );
require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-plugin-compatibility.php' );
require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-phpinfo.php' );
require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-htaccess.php' );
require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-robotstxt.php' );
require_once( dirname( __FILE__ ) . '/HealthCheck/Tools/class-health-check-beta-features.php' );
// Initialize our plugin.
new Health_Check();
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once( dirname( __FILE__ ) . '/HealthCheck/class-cli.php' );
}
}
);