PluginProbe
Patchstack – WordPress & Plugins Security / 2.3.4
Patchstack – WordPress & Plugins Security v2.3.4
2.3.7 trunk 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.2 2.1.20 2.1.21 2.1.22 2.1.23 2.1.24 2.1.25 2.1.3 2.1.4 2.1.5 2.1.6 All 49 releases
patchstack / includes / mu-plugin.php

mu-plugin.php in Patchstack – WordPress & Plugins Security 2.3.4, at includes/mu-plugin.php

53 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Do not allow the file to be called directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 // Do not run if already executed.
9 if ( defined( 'PS_FW_MU_RAN' ) ) {
10 return;
11 }
12
13 // Do not run if we're not supposed to.
14 if ( get_option( 'patchstack_license_activated', 0 ) == 0 || get_option( 'patchstack_basic_firewall', 0 ) != 1 || get_option( 'patchstack_license_free', 0 ) == 1 ) {
15 return;
16 }
17
18 // Load essential WP core file.
19 require_once ABSPATH . 'wp-admin/includes/plugin.php';
20
21 // Determine if the Patchstack plugin folder exists.
22 $pluginDir = WP_PLUGIN_DIR . '/patchstack';
23 if ( ! is_dir( $pluginDir ) || ! is_plugin_active( 'patchstack/patchstack.php' ) ) {
24 return;
25 }
26
27 // Determine if the core file exists.
28 if ( ! file_exists( $pluginDir . '/includes/core.php' ) || ! file_exists( $pluginDir . '/includes/firewall.php' ) ) {
29 return;
30 }
31
32 // Make sure to load essential files.
33 if ( ! class_exists( 'P_Firewall' ) || ! class_exists( 'P_Core' ) ) {
34 // Require the core and firewall files.
35 require_once $pluginDir . '/includes/core.php';
36 require_once $pluginDir . '/includes/firewall.php';
37
38 // For rare situations where it did not load properly.
39 if ( ! class_exists( 'P_Firewall' ) || ! class_exists( 'P_Core' ) ) {
40 return;
41 }
42 }
43
44 // Initialize and launch.
45 try {
46 $core = new P_Core( null );
47 new P_Firewall( true, $core, false, true );
48 } catch (\Exception $e) {
49 //
50 }
51
52 define( 'PS_FW_MU_RAN', true );
53