-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextrachill-network.php
More file actions
82 lines (71 loc) · 2.68 KB
/
Copy pathextrachill-network.php
File metadata and controls
82 lines (71 loc) · 2.68 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
<?php
/**
* Plugin Name: Extra Chill Network
* Plugin URI: https://extrachill.com
* Description: Network administration foundation for the ExtraChill Platform. Provides network-wide Cloudflare Turnstile integration and consolidated network admin menu.
* Version: 2.9.0
* Author: Chris Huber
* Author URI: https://chubes.net
* Network: true
* Requires at least: 5.0
* Tested up to: 6.4
* Requires PHP: 8.3
* Text Domain: extrachill-network
* Domain Path: /languages
*
* @package ExtraChillNetwork
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'EXTRACHILL_NETWORK_VERSION', '2.9.0' );
define( 'EXTRACHILL_NETWORK_PLUGIN_FILE', __FILE__ );
define( 'EXTRACHILL_NETWORK_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'EXTRACHILL_NETWORK_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
if ( file_exists( EXTRACHILL_NETWORK_PLUGIN_DIR . 'vendor/autoload.php' ) ) {
require_once EXTRACHILL_NETWORK_PLUGIN_DIR . 'vendor/autoload.php';
}
// Breeze role-cookie hardening (extrachill-users#161). Loaded at top level —
// NOT inside extrachill_network_init() — because it registers a
// `plugins_loaded` @ 1 self-heal that must be hooked before the
// `do_action( 'plugins_loaded' )` this plugin's own init callback runs on.
require_once EXTRACHILL_NETWORK_PLUGIN_DIR . 'inc/cache/breeze-role-cookie.php';
require_once EXTRACHILL_NETWORK_PLUGIN_DIR . 'inc/Foundation/bootstrap.php';
require_once EXTRACHILL_NETWORK_PLUGIN_DIR . 'inc/FeatureProviders.php';
register_activation_hook( __FILE__, 'extrachill_network_activate' );
/**
* Prevent activation outside WordPress multisite.
*
* @return void
*/
function extrachill_network_activate() {
if ( is_multisite() ) {
return;
}
if ( ! function_exists( 'deactivate_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
deactivate_plugins( plugin_basename( __FILE__ ) );
// Only wp_die() in interactive admin contexts. Non-interactive callers
// (WP-CLI, WordPress Playground bootstrap, automated test runners) need
// the plugin file to load without terminating the PHP process — the
// runtime guards inside extrachill_network_init() prevent any actual
// multisite-only behavior from firing on single-site installs.
$is_interactive_admin = is_admin()
&& ! defined( 'WP_CLI' )
&& ! wp_doing_ajax();
if ( $is_interactive_admin ) {
wp_die( 'Extra Chill Network plugin requires a WordPress multisite installation.' );
}
}
add_action( 'plugins_loaded', 'extrachill_network_init' );
/**
* Load network-owned runtime integrations.
*
* @return void
*/
function extrachill_network_init() {
extrachill_network_boot_foundation();
extrachill_network_register_default_feature_providers();
extrachill_network_boot_feature_providers();
}