Passed
Push — master ( c3a81b...790d30 )
by Benjamin
01:43
created

WP_Site_Monitor::init_settings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 20
ccs 0
cts 14
cp 0
rs 9.4285
cc 1
eloc 15
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * The core plugin class.
4
 *
5
 * This is used to define internationalization, admin-specific hooks, and
6
 * public-facing site hooks.
7
 *
8
 * Also maintains the unique identifier of this plugin as well as the current
9
 * version of the plugin.
10
 *
11
 * @package WPSiteMonitor
12
 * @link https://github.com/BWibrew/WP-Site-Monitor/
13
 * @author Benjamin Wibrew <[email protected]>
14
 * @since 1.0.0
15
 */
16
17
namespace WPSiteMonitor;
18
19
require_once WPSM_PATH . 'src/class-hook-loader.php';
20
require_once WPSM_PATH . 'src/class-settings-menu.php';
21
22
/**
23
 * Class WP_Site_Monitor
24
 *
25
 * @package WPSiteMonitor
26
 */
27
class WP_Site_Monitor {
28
29
	/**
30
	 * The loader that's responsible for registering all hooks and filters.
31
	 *
32
	 * @var Hook_Loader $loader Maintains and registers all hooks for the plugin.
33
	 * @since 1.0.0
34
	 */
35
	protected $loader;
36
37
	/**
38
	 * Define the core functionality of the plugin.
39
	 *
40
	 * @since 1.0.0
41
	 */
42
	public function __construct() {
43
		$this->loader = new Hook_Loader();
44
45
		$this->init();
46
	}
47
48
	/**
49
	 * Initialise plugin files.
50
	 *
51
	 * @since 1.0.0
52
	 */
53
	public function init() {
54
		if ( is_admin() ) {
55
			new Settings_Menu();
56
		}
57
58
		$this->loader->run();
59
	}
60
61
	/**
62
	 * Fired during plugin activation.
63
	 *
64
	 * @since 1.0.0
65
	 */
66
	public static function activate() {
67
	}
68
69
	/**
70
	 * Fired during plugin deactivation,
71
	 *
72
	 * @since 1.0.0
73
	 */
74
	public static function deactivate() {
75
	}
76
77
	/**
78
	 * Fired during plugin deletion.
79
	 *
80
	 * @since 1.0.0
81
	 */
82
	public static function uninstall() {
83
	}
84
}
85