Completed
Push — master ( e0f537...a07172 )
by Benjamin
14:42
created

activate_wp_site_monitor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * Plugin Name:  WP Site Monitor
4
 * Plugin URI:   https://github.com/BWibrew/WP-Site-Monitor/
5
 * Description:  Provides extra WP REST API endpoints to help manage sites remotely.
6
 * Version:      0.1.0
7
 * Author:       Benjamin Wibrew
8
 * Author URI:   https://github.com/BWibrew/
9
 * License:      MIT License
10
 * License URI:  http://opensource.org/licenses/MIT
11
 * Text Domain:  wp-site-monitor
12
 * Domain Path:  /languages
13
 *
14
 * @wordpress-plugin
15
 * @package WPSiteMonitor\Bootstrap
16
 * @link https://github.com/BWibrew/WP-Site-Monitor/
17
 * @since 1.0.0
18
 */
19
20
// If this file is called directly, abort.
21
if ( ! defined( 'WPINC' ) ) {
22
	die;
23
}
24
25
if ( ! defined( 'WPSM_FILE' ) ) {
26
	define( 'WPSM_FILE', __FILE__ );
27
}
28
29
/**
30
 * Activate WP Site Monitor plugin
31
 */
32
function activate_wp_site_monitor() {
33
	require_once plugin_dir_path( WPSM_FILE ) . 'src/class-activator.php';
0 ignored issues
show
Bug introduced by
The function plugin_dir_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
	require_once /** @scrutinizer ignore-call */ plugin_dir_path( WPSM_FILE ) . 'src/class-activator.php';
Loading history...
34
	\WPSiteMonitor\Activator::activate();
35
}
36
37
/**
38
 * Deactivate WP Site Monitor plugin
39
 */
40
function deactivate_wp_site_monitor() {
41
	require_once plugin_dir_path( WPSM_FILE ) . 'src/class-deactivator.php';
0 ignored issues
show
Bug introduced by
The function plugin_dir_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

41
	require_once /** @scrutinizer ignore-call */ plugin_dir_path( WPSM_FILE ) . 'src/class-deactivator.php';
Loading history...
42
	\WPSiteMonitor\Deactivator::deactivate();
43
}
44
45
register_activation_hook( WPSM_FILE, 'activate_wp_site_monitor' );
0 ignored issues
show
Bug introduced by
The function register_activation_hook was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

45
/** @scrutinizer ignore-call */ 
46
register_activation_hook( WPSM_FILE, 'activate_wp_site_monitor' );
Loading history...
46
register_deactivation_hook( WPSM_FILE, 'deactivate_wp_site_monitor' );
0 ignored issues
show
Bug introduced by
The function register_deactivation_hook was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

46
/** @scrutinizer ignore-call */ 
47
register_deactivation_hook( WPSM_FILE, 'deactivate_wp_site_monitor' );
Loading history...
47
48
require plugin_dir_path( WPSM_FILE ) . 'src/class-wp-site-monitor.php';
0 ignored issues
show
Bug introduced by
The function plugin_dir_path was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

48
require /** @scrutinizer ignore-call */ plugin_dir_path( WPSM_FILE ) . 'src/class-wp-site-monitor.php';
Loading history...
49