-
Notifications
You must be signed in to change notification settings - Fork 1
/
vip-governance.php
78 lines (61 loc) · 2.37 KB
/
vip-governance.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
<?php
/**
* Plugin Name: WordPress VIP Block Governance
* Plugin URI: https://github.com/Automattic/vip-governance-plugin
* Description: Add additional governance capabilities to the block editor.
* Author: WordPress VIP
* Text Domain: vip-governance
* Version: 1.0.11
* Requires at least: 6.0
* Tested up to: 6.7
* Requires PHP: 8.0
* License: GPL-3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*
* @package vip-governance
*/
namespace WPCOMVIP\Governance;
if ( ! defined( 'VIP_GOVERNANCE_LOADED' ) ) {
define( 'VIP_GOVERNANCE_LOADED', true );
// ToDo: When 6.4 is our min version, switch to wp_admin_notice.
global $wp_version;
if ( version_compare( phpversion(), '8.0', '<' ) || version_compare( $wp_version, '6.0', '<' ) ) {
add_action( 'admin_notices', function () {
?>
<div class="notice notice-error">
<p><?php esc_html_e( 'WordPress VIP Block Governance requires PHP 8.0+ and WordPress 6.0+.', 'vip-governance' ); ?></p>
</div>
<?php
}, 10, 0 );
return;
}
define( 'WPCOMVIP__GOVERNANCE__PLUGIN_VERSION', '1.0.11' );
define( 'WPCOMVIP__GOVERNANCE__RULES_SCHEMA_VERSION', '1.0.0' );
if ( ! defined( 'WPCOMVIP_GOVERNANCE_ROOT_PLUGIN_FILE' ) ) {
define( 'WPCOMVIP_GOVERNANCE_ROOT_PLUGIN_FILE', __FILE__ );
}
if ( ! defined( 'WPCOMVIP_GOVERNANCE_ROOT_PLUGIN_DIR' ) ) {
define( 'WPCOMVIP_GOVERNANCE_ROOT_PLUGIN_DIR', __DIR__ );
}
define( 'WPCOMVIP_GOVERNANCE_RULES_FILENAME', 'governance-rules.json' );
define( 'WPCOMVIP__GOVERNANCE__RULES_REST_ROUTE', 'vip-governance/v1' );
define( 'WPCOMVIP__GOVERNANCE__STAT_NAME___USAGE', 'vip-governance-usage' );
define( 'WPCOMVIP__GOVERNANCE__STAT_NAME___ERROR', 'vip-governance-usage-error' );
// Composer Dependencies.
require_once __DIR__ . '/vendor/autoload.php';
// Analytics.
require_once __DIR__ . '/governance/analytics.php';
// Block Locking.
require_once __DIR__ . '/governance/block-locking.php';
// Utilities.
require_once __DIR__ . '/governance/governance-utilities.php';
// Initialize Governance.
require_once __DIR__ . '/governance/init-governance.php';
require_once __DIR__ . '/governance/nested-governance-processing.php';
// Rules Parser and Validator.
require_once __DIR__ . '/governance/rules-parser.php';
// Settings Panel.
require_once __DIR__ . '/governance/settings/settings.php';
// /wp-json/ API.
require_once __DIR__ . '/governance/rest/rest-api.php';
}