-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathops-health-dashboard.php
More file actions
85 lines (78 loc) · 1.88 KB
/
ops-health-dashboard.php
File metadata and controls
85 lines (78 loc) · 1.88 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
/**
* Plugin Name: Ops Health Dashboard
* Plugin URI: https://github.com/mab056/ops-health-dashboard
* Description: Production-grade WordPress health monitoring with automated checks and configurable alerts.
* Version: 0.6.2
* Requires at least: 5.8
* Requires PHP: 7.4
* Author: Mattia Bondrano
* Author URI: https://www.mattiabondrano.dev
* License: GPL-3.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: ops-health-dashboard
* Domain Path: /languages
*
* @package OpsHealthDashboard
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'OPS_HEALTH_DASHBOARD_VERSION', '0.6.2' );
define( 'OPS_HEALTH_DASHBOARD_FILE', __FILE__ );
define( 'OPS_HEALTH_DASHBOARD_PATH', plugin_dir_path( __FILE__ ) );
define( 'OPS_HEALTH_DASHBOARD_URL', plugin_dir_url( __FILE__ ) );
// Load the Composer autoloader.
if ( ! file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
add_action(
'admin_notices',
function () {
$msg = __(
'Ops Health Dashboard: autoloader missing. Please run "composer install".',
'ops-health-dashboard'
);
printf(
'<div class="notice notice-error"><p>%s</p></div>',
esc_html( $msg )
);
}
);
return;
}
require_once __DIR__ . '/vendor/autoload.php';
// Load the bootstrap configuration.
require_once __DIR__ . '/config/bootstrap.php';
/**
* Activation hook.
*/
register_activation_hook(
__FILE__,
function () {
$activator = new \OpsHealthDashboard\Core\Activator();
$activator->activate();
}
);
/**
* Deactivation hook.
*/
register_deactivation_hook(
__FILE__,
function () {
$activator = new \OpsHealthDashboard\Core\Activator();
$activator->deactivate();
}
);
/**
* Initialize the plugin.
*
* Bootstrap creates the container, configures bindings, returns the plugin
* instance.
*/
add_action(
'plugins_loaded',
function () {
$plugin = \OpsHealthDashboard\bootstrap();
$plugin->init();
},
10
);