Repository navigation
Expand file tree
/
Copy pathwp-security.php
More file actions
70 lines (61 loc) · 1.92 KB
/
Copy pathwp-security.php
File metadata and controls
70 lines (61 loc) · 1.92 KB
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
<?php
/**
* Plugin Name: WP Security
* Plugin URI: https://github.com/dgaitan/wp-security
* Description: An all-in-one auditing suite that inspects a WordPress installation across nine domains and surfaces prioritized, actionable findings through a powered dashboard.
* Version: 0.1.0
* Author: David Gaitan
* Author URI: https://profiles.wordpress.org/david-gaitan/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: wp-security
* Domain Path: /languages
* Requires at least: 6.4
* Requires PHP: 8.1
* Tested up to: 6.9
*/
declare( strict_types=1 );
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Plugin constants.
define( 'WP_SECURITY_VERSION', '0.1.0' );
define( 'WP_SECURITY_DIR', plugin_dir_path( __FILE__ ) );
define( 'WP_SECURITY_URL', plugin_dir_url( __FILE__ ) );
define( 'WP_SECURITY_BASENAME', plugin_basename( __FILE__ ) );
// Composer autoloader.
if ( file_exists( WP_SECURITY_DIR . 'vendor/autoload.php' ) ) {
require_once WP_SECURITY_DIR . 'vendor/autoload.php';
}
// Action Scheduler.
if ( file_exists( WP_SECURITY_DIR . 'vendor/woocommerce/action-scheduler/action-scheduler.php' ) ) {
require_once WP_SECURITY_DIR . 'vendor/woocommerce/action-scheduler/action-scheduler.php';
}
// Activation / deactivation hooks must be registered at the top level.
register_activation_hook(
__FILE__,
static function (): void {
if ( class_exists( \WPSecurity\Plugin::class ) ) {
\WPSecurity\Plugin::activate();
}
}
);
register_deactivation_hook(
__FILE__,
static function (): void {
if ( class_exists( \WPSecurity\Plugin::class ) ) {
\WPSecurity\Plugin::deactivate();
}
}
);
// Boot the plugin after all plugins are loaded so service providers can depend on other plugins.
add_action(
'plugins_loaded',
static function (): void {
if ( ! class_exists( \WPSecurity\Plugin::class ) ) {
return;
}
\WPSecurity\Plugin::instance()->boot();
},
10
);