-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatchbox-fire-protection.php
101 lines (82 loc) · 2.94 KB
/
matchbox-fire-protection.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
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
/**
* Plugin Name: Matchbox Fire Protection
* Plugin URI: https://github.com/matchboxdesigngroup/matchbox-fire-protection
* Description: The Matchbox Fire Protection plugin configures WordPress to better protect our clients' sites.
* Version: 1.0.0
* Author: Matchbox
* Author URI: https://matchboxdesigngroup.com
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: matchbox
* Domain Path: /languages/
* Update URI: https://github.com/matchboxdesigngroup/matchbox-fire-protection
*
* @package matchbox-fire-protection
*/
namespace MatchboxFireProtection;
use Puc_v4_Factory;
define( 'MATCHBOX_FIRE_PROTECTION_VERSION', '1.0.0' );
define( 'MATCHBOX_FIRE_PROTECTION_DIR', __DIR__ );
define( 'MATCHBOX_FIRE_PROTECTION_FILE', __FILE__ );
require_once __DIR__ . '/vendor/yahnis-elsts/plugin-update-checker/plugin-update-checker.php';
require_once __DIR__ . '/includes/utils.php';
spl_autoload_register(
function( $class_name ) {
$path_parts = explode( '\\', $class_name );
if ( ! empty( $path_parts ) ) {
$package = $path_parts[0];
unset( $path_parts[0] );
if ( 'MatchboxFireProtection' === $package ) {
require_once __DIR__ . '/includes/classes/' . implode( '/', $path_parts ) . '.php';
} elseif ( 'ZxcvbnPhp' === $package ) {
require_once __DIR__ . '/vendor/bjeavons/zxcvbn-php/src/' . implode( '/', $path_parts ) . '.php';
}
}
}
);
$matchbox_plugin_updater = Puc_v4_Factory::buildUpdateChecker(
'https://github.com/matchboxdesigngroup/matchbox-fire-protection/',
__FILE__,
'matchbox-fire-protection'
);
if ( defined( 'MATCHBOX_FIRE_PROTECTION_GITHUB_KEY' ) ) {
$matchbox_plugin_updater->setAuthentication( MATCHBOX_FIRE_PROTECTION_GITHUB_KEY );
}
$matchbox_plugin_updater->addResultFilter(
function( $plugin_info, $http_response = null ) {
$plugin_info->icons = array(
'svg' => plugins_url( '/assets/img/matchbox.svg', __FILE__ ),
);
return $plugin_info;
}
);
// Define a constant if we're network activated to allow plugin to respond accordingly.
$network_activated = Utils\is_network_activated( plugin_basename( __FILE__ ) );
define( 'MATCHBOX_FIRE_PROTECTION_IS_NETWORK', (bool) $network_activated );
if ( ! defined( 'MATCHBOX_DISABLE_BRANDING' ) || ! MATCHBOX_DISABLE_BRANDING ) {
AdminCustomizations\Customizations::instance();
}
API\API::instance();
Authentication\Usernames::instance();
Authors\Authors::instance();
Gutenberg\Gutenberg::instance();
Headers\Headers::instance();
Plugins\Plugins::instance();
PostPasswords\PostPasswords::instance();
Notifications\Welcome::instance();
/**
* We load this later to make sure there are no conflicts with other plugins.
*/
add_action(
'plugins_loaded',
function() {
Authentication\Passwords::instance();
}
);
/**
* Disable plugin/theme editor
*/
if ( ! defined( 'DISALLOW_FILE_EDIT' ) ) {
define( 'DISALLOW_FILE_EDIT', true );
}