PluginProbe
The WP Remote WordPress Plugin / 6.76
The WP Remote WordPress Plugin v6.76
6.76 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 All 54 releases
← All changes | protect/fw/rule/functions/wp.php +33 -32 5.536.76 View file →
@@ -1,9 +1,10 @@
1 1 <?php
2 +// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped
2 3 if (!defined('ABSPATH') && !defined('MCDATAPATH')) exit;
3 4
4 -if (!trait_exists('WPRProtectFWRuleWPFunc_V553')) :
5 -trait WPRProtectFWRuleWPFunc_V553 {
5 +if (!trait_exists('WPRProtectFWRuleWPFunc_V676')) :
6 +trait WPRProtectFWRuleWPFunc_V676 {
6 7 private function _rf_sanitizeUser() {
7 8 $args = $this->processRuleFunctionParams(
8 9 'sanitizeUser',
9 10 func_num_args(),
@@ -13,10 +14,10 @@
13 14 );
14 15 $username = $args[0];
15 16 $strict = $args[1];
16 17
17 - if (!function_exists('sanitize_user') || !WPRProtectUtils_V553::haveMupluginsLoaded()) {
18 - throw new WPRProtectRuleError_V553(
18 + if (!function_exists('sanitize_user') || !WPRProtectUtils_V676::haveMupluginsLoaded()) {
19 + throw new WPRProtectRuleError_V676(
19 20 $this->addExState("sanitizeUser: Func sanitize_user doesn't exist.")
20 21 );
21 22 }
22 23
@@ -31,10 +32,10 @@
31 32 1
32 33 );
33 34 $data = $args[0];
34 35
35 - if (!function_exists('maybe_serialize') || !WPRProtectUtils_V553::haveMupluginsLoaded()) {
36 - throw new WPRProtectRuleError_V553(
36 + if (!function_exists('maybe_serialize') || !WPRProtectUtils_V676::haveMupluginsLoaded()) {
37 + throw new WPRProtectRuleError_V676(
37 38 $this->addExState("maybeSerialize: Func maybe_serialize doesn't exist.")
38 39 );
39 40 }
40 41
@@ -47,10 +48,10 @@
47 48 func_num_args(),
48 49 func_get_args()
49 50 );
50 51
51 - if (!function_exists('is_user_logged_in') || !WPRProtectUtils_V553::havePluginsLoaded()) {
52 - throw new WPRProtectRuleError_V553(
52 + if (!function_exists('is_user_logged_in') || !WPRProtectUtils_V676::havePluginsLoaded()) {
53 + throw new WPRProtectRuleError_V676(
53 54 $this->addExState("isUserLoggedIn: Func is_user_logged_in doesn't exist.")
54 55 );
55 56 }
56 57
@@ -63,15 +64,15 @@
63 64 func_num_args(),
64 65 func_get_args()
65 66 );
66 67
67 - if (!function_exists('wp_get_current_user') || !WPRProtectUtils_V553::havePluginsLoaded()) {
68 - throw new WPRProtectRuleError_V553(
68 + if (!function_exists('wp_get_current_user') || !WPRProtectUtils_V676::havePluginsLoaded()) {
69 + throw new WPRProtectRuleError_V676(
69 70 $this->addExState("getCurrentWPUser: Func wp_get_current_user doesn't exist.")
70 71 );
71 72 }
72 73
73 - return WPRProtectFWRuleEngine_V553::toAllowedType(wp_get_current_user());
74 + return WPRProtectFWRuleEngine_V676::toAllowedType(wp_get_current_user());
74 75 }
75 76
76 77 private function _rf_currentUserCan() {
77 78 $args = $this->processRuleFunctionParams(
@@ -84,10 +85,10 @@
84 85 $capability = $args[0];
85 86 $arg1 = isset($args[1]) ? $args[1] : null;
86 87 $arg2 = isset($args[2]) ? $args[2] : null;
87 88
88 - if (!function_exists('current_user_can') || !WPRProtectUtils_V553::havePluginsLoaded()) {
89 - throw new WPRProtectRuleError_V553(
89 + if (!function_exists('current_user_can') || !WPRProtectUtils_V676::havePluginsLoaded()) {
90 + throw new WPRProtectRuleError_V676(
90 91 $this->addExState("currentUserCan: Required funcs doesn't exist.")
91 92 );
92 93 }
93 94
@@ -112,10 +113,10 @@
112 113 );
113 114 $field = $args[0];
114 115 $value = $args[1];
115 116
116 - if (!function_exists('get_user_by') || !WPRProtectUtils_V553::havePluginsLoaded()) {
117 - throw new WPRProtectRuleError_V553(
117 + if (!function_exists('get_user_by') || !WPRProtectUtils_V676::havePluginsLoaded()) {
118 + throw new WPRProtectRuleError_V676(
118 119 $this->addExState("getUserBy: Func get_user_by doesn't exist")
119 120 );
120 121 }
121 122
@@ -120,14 +121,14 @@
120 121 }
121 122
122 123 if ($field === 'ID' || $field === 'id') {
123 124 if (!is_string($value) && !is_int($value)) {
124 - throw new WPRProtectRuleError_V553(
125 + throw new WPRProtectRuleError_V676(
125 126 $this->addExState("getUserBy: Value must be a valid string or an integer")
126 127 );
127 128 }
128 129 } elseif (!is_string($value)) {
129 - throw new WPRProtectRuleError_V553(
130 + throw new WPRProtectRuleError_V676(
130 131 $this->addExState("getUserBy: Value must be a valid string")
131 132 );
132 133 }
133 134
@@ -135,9 +136,9 @@
135 136 if (false === $user) {
136 137 return null;
137 138 }
138 139
139 - return WPRProtectFWRuleEngine_V553::toAllowedType($user);
140 + return WPRProtectFWRuleEngine_V676::toAllowedType($user);
140 141 }
141 142
142 143 private function _rf_getCurrentWPUserCapabilities() {
143 144 $args = $this->processRuleFunctionParams(
@@ -148,14 +149,14 @@
148 149
149 150 $user = $this->_rf_getCurrentWPUser();
150 151
151 152 if (!array_key_exists("allcaps", $user)) {
152 - throw new WPRProtectRuleError_V553(
153 + throw new WPRProtectRuleError_V676(
153 154 $this->addExState("getCurrentWPUserCapabilities: allcaps doesn't exist in user.")
154 155 );
155 156 }
156 157
157 - return WPRProtectFWRuleEngine_V553::toAllowedType($user["allcaps"]);
158 + return WPRProtectFWRuleEngine_V676::toAllowedType($user["allcaps"]);
158 159 }
159 160
160 161 private function _rf_getUserCapabilities() {
161 162 $args = $this->processRuleFunctionParams(
@@ -171,14 +172,14 @@
171 172 return array();
172 173 }
173 174
174 175 if (!array_key_exists("allcaps", $user)) {
175 - throw new WPRProtectRuleError_V553(
176 + throw new WPRProtectRuleError_V676(
176 177 $this->addExState("getUserCapabilities: allcaps doesn't exist in user.")
177 178 );
178 179 }
179 180
180 - return WPRProtectFWRuleEngine_V553::toAllowedType($user["allcaps"]);
181 + return WPRProtectFWRuleEngine_V676::toAllowedType($user["allcaps"]);
181 182 }
182 183
183 184 private function _rf_getDefaultUserRole() {
184 185 $args = $this->processRuleFunctionParams(
@@ -200,15 +201,15 @@
200 201 );
201 202 $option = $args[0];
202 203 $default_value = isset($args[1]) ? $args[1] : false;
203 204
204 - if (!function_exists('get_option') || !WPRProtectUtils_V553::haveMupluginsLoaded()) {
205 - throw new WPRProtectRuleError_V553(
205 + if (!function_exists('get_option') || !WPRProtectUtils_V676::haveMupluginsLoaded()) {
206 + throw new WPRProtectRuleError_V676(
206 207 $this->addExState("getOption: Func get_option doesn't exist.")
207 208 );
208 209 }
209 210
210 - return WPRProtectFWRuleEngine_V553::toAllowedType(get_option($option, $default_value));
211 + return WPRProtectFWRuleEngine_V676::toAllowedType(get_option($option, $default_value));
211 212 }
212 213
213 214 private function _rf_checkPasswordResetKey() {
214 215 $args = $this->processRuleFunctionParams(
@@ -220,10 +221,10 @@
220 221 );
221 222 $key = $args[0];
222 223 $login = $args[1];
223 224
224 - if (!function_exists('check_password_reset_key') || !WPRProtectUtils_V553::havePluginsLoaded()) {
225 - throw new WPRProtectRuleError_V553(
225 + if (!function_exists('check_password_reset_key') || !WPRProtectUtils_V676::havePluginsLoaded()) {
226 + throw new WPRProtectRuleError_V676(
226 227 $this->addExState("checkPasswordResetKey: Func check_password_reset_key doesn't exist.")
227 228 );
228 229 }
229 230
@@ -229,9 +230,9 @@
229 230
230 231 $user = check_password_reset_key($key, $login);
231 232
232 233 if (is_a($user, "WP_User")) {
233 - return WPRProtectFWRuleEngine_V553::toAllowedType($user);
234 + return WPRProtectFWRuleEngine_V676::toAllowedType($user);
234 235 }
235 236
236 237 return null;
237 238 }
@@ -284,16 +285,16 @@
284 285 1
285 286 );
286 287 $value = $args[0];
287 288
288 - if (!function_exists('wp_unslash') || !WPRProtectUtils_V553::haveMuPluginsLoaded()) {
289 - throw new WPRProtectRuleError_V553(
289 + if (!function_exists('wp_unslash') || !WPRProtectUtils_V676::haveMuPluginsLoaded()) {
290 + throw new WPRProtectRuleError_V676(
290 291 $this->addExState("wpUnslash: Func wp_unslash doesn't exist.")
291 292 );
292 293 }
293 294
294 295 if (!is_string($value) && !is_array($value)) {
295 - throw new WPRProtectRuleError_V553(
296 + throw new WPRProtectRuleError_V676(
296 297 $this->addExState("wpUnslash: Value must be a valid string or an array")
297 298 );
298 299 }
299 300
@@ -307,9 +308,9 @@
307 308 func_get_args()
308 309 );
309 310
310 311 if (!defined('COOKIEHASH')) {
311 - throw new WPRProtectRuleError_V553(
312 + throw new WPRProtectRuleError_V676(
312 313 $this->addExState("parseResetPassCookie: COOKIEHASH is not defined.")
313 314 );
314 315 }
315 316