PluginProbe
The WP Remote WordPress Plugin / trunk
The WP Remote WordPress Plugin vtrunk
6.72 6.69 6.65 6.62 6.48 6.47 4.87 4.97 5.05 5.09 5.16 5.22 5.24 5.25 5.38 5.41 5.42 5.45 5.47 5.53 5.56 5.65 5.68 5.72 5.73 All 53 releases
← All changes | protect/protect.php +23 -23 6.69trunk View file →
@@ -1,8 +1,8 @@
1 1 <?php
2 2 if (!defined('ABSPATH') && !defined('MCDATAPATH')) exit;
3 3
4 -if (!class_exists('WPRProtect_V669')) :
4 +if (!class_exists('WPRProtect_V672')) :
5 5 require_once dirname( __FILE__ ) . '/logger.php';
6 6 require_once dirname( __FILE__ ) . '/ipstore.php';
7 7 require_once dirname( __FILE__ ) . '/request.php';
8 8 require_once dirname( __FILE__ ) . '/wp_user.php';
@@ -10,9 +10,9 @@
10 10 require_once dirname( __FILE__ ) . '/fw.php';
11 11 require_once dirname( __FILE__ ) . '/lp.php';
12 12 require_once dirname( __FILE__ ) . '/../helper.php';
13 13
14 -class WPRProtect_V669 {
14 +class WPRProtect_V672 {
15 15 public static $settings;
16 16 public static $db;
17 17 public static $info;
18 18
@@ -25,15 +25,15 @@
25 25 if (defined('WP_CLI') && WP_CLI) {
26 26 return false;
27 27 }
28 28
29 - if ($mode == WPRProtect_V669::MODE_PREPEND) {
29 + if ($mode == WPRProtect_V672::MODE_PREPEND) {
30 30 $config_file = MCDATAPATH . MCCONFKEY . '-' . 'mc.conf';
31 - $config = WPRProtectUtils_V669::parseFile($config_file);
31 + $config = WPRProtectUtils_V672::parseFile($config_file);
32 32
33 33 if (empty($config['time']) || !($config['time'] > time() - (48*3600)) ||
34 34 !isset($config['mc_conf_version']) ||
35 - (WPRProtect_V669::CONF_VERSION !== $config['mc_conf_version'])) {
35 + (WPRProtect_V672::CONF_VERSION !== $config['mc_conf_version'])) {
36 36 return false;
37 37
38 38 }
39 39
@@ -39,17 +39,17 @@
39 39
40 40 $brand_name = array_key_exists('brandname', $config) ? $config['brandname'] : 'Protect';
41 41 $request_ip_header = array_key_exists('ipheader', $config) ? $config['ipheader'] : null;
42 42 $req_config = array_key_exists('reqconfig', $config) ? $config['reqconfig'] : array();
43 - $request = new WPRProtectRequest_V669($request_ip_header, $req_config);
43 + $request = new WPRProtectRequest_V672($request_ip_header, $req_config);
44 44 $fw_config = array_key_exists('fw', $config) ? $config['fw'] : array();
45 45
46 - WPRProtectFW_V669::getInstance($mode, $request, $fw_config, $brand_name)->init();
46 + WPRProtectFW_V672::getInstance($mode, $request, $fw_config, $brand_name)->init();
47 47 } else {
48 48 $plug_config = self::$settings->getOption(self::$info->services_option_name);
49 49 $config = array_key_exists('protect', $plug_config) ? $plug_config['protect'] : array();
50 50 if (!is_array($config) || !array_key_exists('mc_conf_version', $config) ||
51 - (WPRProtect_V669::CONF_VERSION !== $config['mc_conf_version'])) {
51 + (WPRProtect_V672::CONF_VERSION !== $config['mc_conf_version'])) {
52 52
53 53 return false;
54 54 }
55 55
@@ -55,14 +55,14 @@
55 55
56 56 $brand_name = self::$info->getBrandName();
57 57 $request_ip_header = array_key_exists('ipheader', $config) ? $config['ipheader'] : null;
58 58 $req_config = array_key_exists('reqconfig', $config) ? $config['reqconfig'] : array();
59 - $request = new WPRProtectRequest_V669($request_ip_header, $req_config);
59 + $request = new WPRProtectRequest_V672($request_ip_header, $req_config);
60 60 $fw_config = array_key_exists('fw', $config) ? $config['fw'] : array();
61 61 $lp_config = array_key_exists('lp', $config) ? $config['lp'] : array();
62 62
63 - WPRProtectFW_V669::getInstance($mode, $request, $fw_config, $brand_name)->init();
64 - WPRProtectLP_V669::getInstance($request, $lp_config, $brand_name)->init();
63 + WPRProtectFW_V672::getInstance($mode, $request, $fw_config, $brand_name)->init();
64 + WPRProtectLP_V672::getInstance($request, $lp_config, $brand_name)->init();
65 65 }
66 66 }
67 67
68 68 public static function uninstall() {
@@ -67,15 +67,15 @@
67 67
68 68 public static function uninstall() {
69 69 self::$settings->deleteOption('bvptconf');
70 70 self::$settings->deleteOption('bvptplug');
71 - WPRProtectIpstore_V669::uninstall();
72 - WPRProtectFW_V669::uninstall();
73 - WPRProtectLP_V669::uninstall();
71 + WPRProtectIpstore_V672::uninstall();
72 + WPRProtectFW_V672::uninstall();
73 + WPRProtectLP_V672::uninstall();
74 74
75 - WPRProtect_V669::removeWPPrepend();
76 - WPRProtect_V669::removePHPPrepend();
77 - WPRProtect_V669::removeMCData();
75 + WPRProtect_V672::removeWPPrepend();
76 + WPRProtect_V672::removePHPPrepend();
77 + WPRProtect_V672::removeMCData();
78 78
79 79 return true;
80 80 }
81 81
@@ -94,26 +94,26 @@
94 94 }
95 95
96 96 $pattern = "@include '" . rtrim(ABSPATH, DIRECTORY_SEPARATOR) . "/malcare-waf.php" . "';";
97 97
98 - WPRProtectUtils_V669::fileRemovePattern($fname, $pattern);
98 + WPRProtectUtils_V672::fileRemovePattern($fname, $pattern);
99 99 }
100 100
101 101 private static function removePHPPrepend() {
102 - WPRProtect_V669::removeHtaccessPrepend();
103 - WPRProtect_V669::removeUseriniPrepend();
102 + WPRProtect_V672::removeHtaccessPrepend();
103 + WPRProtect_V672::removeUseriniPrepend();
104 104 }
105 105
106 106 private static function removeHtaccessPrepend() {
107 107 $pattern = "/# MalCare WAF(.|\n)*# END MalCare WAF/i";
108 108
109 - WPRProtectUtils_V669::fileRemovePattern(rtrim(ABSPATH, DIRECTORY_SEPARATOR) . "/.htaccess", $pattern, true);
109 + WPRProtectUtils_V672::fileRemovePattern(rtrim(ABSPATH, DIRECTORY_SEPARATOR) . "/.htaccess", $pattern, true);
110 110 }
111 111
112 112 private static function removeUseriniPrepend() {
113 113 $pattern = "/; MalCare WAF(.|\n)*; END MalCare WAF/i";
114 114
115 - WPRProtectUtils_V669::fileRemovePattern(rtrim(ABSPATH, DIRECTORY_SEPARATOR) . "/.user.ini", $pattern, true);
115 + WPRProtectUtils_V672::fileRemovePattern(rtrim(ABSPATH, DIRECTORY_SEPARATOR) . "/.user.ini", $pattern, true);
116 116 }
117 117
118 118 private static function removeMCData() {
119 119 $content_dir = defined('WP_CONTENT_DIR') ? WP_CONTENT_DIR : rtrim(ABSPATH, DIRECTORY_SEPARATOR) . "/wp-content";
@@ -118,8 +118,8 @@
118 118 private static function removeMCData() {
119 119 $content_dir = defined('WP_CONTENT_DIR') ? WP_CONTENT_DIR : rtrim(ABSPATH, DIRECTORY_SEPARATOR) . "/wp-content";
120 120 $mc_data_dir = $content_dir . "/mc_data";
121 121
122 - WPRProtectUtils_V669::rrmdir($mc_data_dir);
122 + WPRProtectUtils_V672::rrmdir($mc_data_dir);
123 123 }
124 124 }
125 125 endif;