Version Description
- Properly fix PHP 5.3 support; tested on CentOS 6. Does not support any UI or Premium features.
- Fix potential issue with
WP_FAIL2BAN_BLOCK_USER_ENUMERATION
if calling REST API or XMLRPC from admin area.
Download this release
Release Info
Developer | invisnet |
Plugin | WP fail2ban |
Version | 4.2.5 |
Comparing to | |
See all releases |
Code changes from version 4.2.4 to 4.2.5
- admin/lib/about.php +11 -0
- filters.d/wordpress-extra.conf +1 -1
- filters.d/wordpress-hard.conf +1 -1
- filters.d/wordpress-soft.conf +1 -1
- lib/loader.php +314 -296
- readme.txt +9 -1
- vendor/freemius/wordpress-sdk/templates/pricing.php +1 -0
- wp-fail2ban-main.php +52 -21
- wp-fail2ban.php +9 -10
admin/lib/about.php
CHANGED
@@ -39,6 +39,17 @@ function about( $hide_title = false )
|
|
39 |
<div id="poststuff">
|
40 |
<div id="post-body" class="metabox-holder columns-2">
|
41 |
<div id="post-body-content">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
<div class="meta-box-sortables ui-sortable">
|
43 |
<div class="postbox">
|
44 |
<h2>Version 4.2.4</h2>
|
39 |
<div id="poststuff">
|
40 |
<div id="post-body" class="metabox-holder columns-2">
|
41 |
<div id="post-body-content">
|
42 |
+
<div class="meta-box-sortables ui-sortable">
|
43 |
+
<div class="postbox">
|
44 |
+
<h2>Version 4.2.5</h2>
|
45 |
+
<div class="inside">
|
46 |
+
<ul>
|
47 |
+
<li>Properly fix PHP 5.3 support; tested on CentOS 6. Does not support any UI or Premium features.</li>
|
48 |
+
<li>Fix potential issue with <tt>WP_FAIL2BAN_BLOCK_USER_ENUMERATION</tt> if calling REST API or XMLRPC from admin area.</li>
|
49 |
+
</ul>
|
50 |
+
</div>
|
51 |
+
</div>
|
52 |
+
</div>
|
53 |
<div class="meta-box-sortables ui-sortable">
|
54 |
<div class="postbox">
|
55 |
<h2>Version 4.2.4</h2>
|
filters.d/wordpress-extra.conf
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
# Fail2Ban filter for WordPress extra failures
|
2 |
-
# Auto-generated: 2019-
|
3 |
#
|
4 |
|
5 |
[INCLUDES]
|
1 |
# Fail2Ban filter for WordPress extra failures
|
2 |
+
# Auto-generated: 2019-07-15T18:00:14+00:00
|
3 |
#
|
4 |
|
5 |
[INCLUDES]
|
filters.d/wordpress-hard.conf
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
# Fail2Ban filter for WordPress hard failures
|
2 |
-
# Auto-generated: 2019-
|
3 |
#
|
4 |
|
5 |
[INCLUDES]
|
1 |
# Fail2Ban filter for WordPress hard failures
|
2 |
+
# Auto-generated: 2019-07-15T18:00:14+00:00
|
3 |
#
|
4 |
|
5 |
[INCLUDES]
|
filters.d/wordpress-soft.conf
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
# Fail2Ban filter for WordPress soft failures
|
2 |
-
# Auto-generated: 2019-
|
3 |
#
|
4 |
|
5 |
[INCLUDES]
|
1 |
# Fail2Ban filter for WordPress soft failures
|
2 |
+
# Auto-generated: 2019-07-15T18:00:14+00:00
|
3 |
#
|
4 |
|
5 |
[INCLUDES]
|
lib/loader.php
CHANGED
@@ -6,304 +6,322 @@
|
|
6 |
* @package wp-fail2ban
|
7 |
* @since 4.2.0
|
8 |
*/
|
9 |
-
namespace
|
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 |
-
if ( defined( "DEFAULT_{$define}" ) ) {
|
44 |
-
// we've got a default
|
45 |
-
define( $define, $cast( constant( "DEFAULT_{$define}" ) ) );
|
46 |
-
} else {
|
47 |
-
// bah
|
48 |
-
define( $define, $cast( false ) );
|
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 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
]
|
297 |
-
);
|
298 |
-
_load(
|
299 |
-
'WP_FAIL2BAN_PLUGIN_XMLRPC_LOG',
|
300 |
-
'intval',
|
301 |
-
false,
|
302 |
-
[
|
303 |
-
'logging',
|
304 |
-
'plugins',
|
305 |
-
'xmlrpc',
|
306 |
-
'facility'
|
307 |
-
]
|
308 |
-
);
|
309 |
-
// phpcs:enable
|
6 |
* @package wp-fail2ban
|
7 |
* @since 4.2.0
|
8 |
*/
|
9 |
+
namespace {
|
10 |
+
if ( !defined( 'ABSPATH' ) ) {
|
11 |
+
exit;
|
12 |
+
}
|
13 |
+
if ( defined( 'PHPUNIT_COMPOSER_INSTALL' ) ) {
|
14 |
+
return;
|
15 |
+
}
|
16 |
+
if ( !function_exists( 'boolval' ) ) {
|
17 |
+
/**
|
18 |
+
* PHP 5.3 helper
|
19 |
+
*
|
20 |
+
* @since 4.2.5
|
21 |
+
*
|
22 |
+
* @param mixed $val
|
23 |
+
*
|
24 |
+
* @return bool
|
25 |
+
*/
|
26 |
+
function boolval( $val )
|
27 |
+
{
|
28 |
+
return (bool) $val;
|
29 |
+
}
|
30 |
+
|
31 |
+
}
|
32 |
}
|
33 |
+
namespace org\lecklider\charles\wordpress\wp_fail2ban {
|
34 |
+
/**
|
35 |
+
* Helper
|
36 |
+
*
|
37 |
+
* @since 4.0.0
|
38 |
+
*
|
39 |
+
* @param string $define
|
40 |
+
* @param callable $cast
|
41 |
+
* @param bool $unset
|
42 |
+
* @param array $field
|
43 |
+
*/
|
44 |
+
function _load(
|
45 |
+
$define,
|
46 |
+
$cast,
|
47 |
+
$unset,
|
48 |
+
array $field
|
49 |
+
)
|
50 |
+
{
|
51 |
+
global $wp_fail2ban ;
|
52 |
+
$wp_fail2ban['config'][$define] = array(
|
53 |
+
'validate' => $cast,
|
54 |
+
'unset' => $unset,
|
55 |
+
'field' => $field,
|
56 |
+
'ndef' => !defined( $define ),
|
57 |
+
);
|
58 |
+
if ( !defined( $define ) ) {
|
59 |
+
|
60 |
+
if ( defined( "DEFAULT_{$define}" ) ) {
|
61 |
+
// we've got a default
|
62 |
+
define( $define, $cast( constant( "DEFAULT_{$define}" ) ) );
|
63 |
+
} else {
|
64 |
+
// bah
|
65 |
+
define( $define, $cast( false ) );
|
66 |
+
}
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
+
}
|
70 |
|
71 |
+
/**
|
72 |
+
* Validate IP list
|
73 |
+
*
|
74 |
+
* @since 4.0.0
|
75 |
+
*
|
76 |
+
* @param array|string $value
|
77 |
+
*
|
78 |
+
* @return string
|
79 |
+
*/
|
80 |
+
function validate_ips( $value )
|
81 |
+
{
|
82 |
+
return $value;
|
83 |
}
|
84 |
+
|
85 |
+
// phpcs:disable Generic.Functions.FunctionCallArgumentSpacing
|
86 |
+
_load(
|
87 |
+
'WP_FAIL2BAN_AUTH_LOG',
|
88 |
+
'intval',
|
89 |
+
true,
|
90 |
+
array( 'logging', 'authentication', 'facility' )
|
91 |
+
);
|
92 |
+
_load(
|
93 |
+
'WP_FAIL2BAN_LOG_COMMENTS',
|
94 |
+
'boolval',
|
95 |
+
true,
|
96 |
+
array( 'logging', 'comments', 'enabled' )
|
97 |
+
);
|
98 |
+
_load(
|
99 |
+
'WP_FAIL2BAN_LOG_COMMENTS_EXTRA',
|
100 |
+
'intval',
|
101 |
+
true,
|
102 |
+
array( 'logging', 'comments', 'extra' )
|
103 |
+
);
|
104 |
+
_load(
|
105 |
+
'WP_FAIL2BAN_COMMENT_LOG',
|
106 |
+
'intval',
|
107 |
+
false,
|
108 |
+
array( 'logging', 'comments', 'facility' )
|
109 |
+
);
|
110 |
+
_load(
|
111 |
+
'WP_FAIL2BAN_COMMENT_EXTRA_LOG',
|
112 |
+
'intval',
|
113 |
+
false,
|
114 |
+
array( 'logging', 'comments-extra', 'facility' )
|
115 |
+
);
|
116 |
+
_load(
|
117 |
+
'WP_FAIL2BAN_LOG_PASSWORD_REQUEST',
|
118 |
+
'boolval',
|
119 |
+
true,
|
120 |
+
array( 'logging', 'password-request', 'enabled' )
|
121 |
+
);
|
122 |
+
_load(
|
123 |
+
'WP_FAIL2BAN_PASSWORD_REQUEST_LOG',
|
124 |
+
'intval',
|
125 |
+
false,
|
126 |
+
array( 'logging', 'password-request', 'facility' )
|
127 |
+
);
|
128 |
+
_load(
|
129 |
+
'WP_FAIL2BAN_LOG_PINGBACKS',
|
130 |
+
'boolval',
|
131 |
+
true,
|
132 |
+
array( 'logging', 'pingback', 'enabled' )
|
133 |
+
);
|
134 |
+
_load(
|
135 |
+
'WP_FAIL2BAN_PINGBACK_LOG',
|
136 |
+
'intval',
|
137 |
+
false,
|
138 |
+
array( 'logging', 'pingback', 'facility' )
|
139 |
+
);
|
140 |
+
_load(
|
141 |
+
'WP_FAIL2BAN_LOG_SPAM',
|
142 |
+
'boolval',
|
143 |
+
true,
|
144 |
+
array( 'logging', 'spam', 'enabled' )
|
145 |
+
);
|
146 |
+
_load(
|
147 |
+
'WP_FAIL2BAN_SPAM_LOG',
|
148 |
+
'intval',
|
149 |
+
false,
|
150 |
+
array( 'logging', 'spam', 'facility' )
|
151 |
+
);
|
152 |
+
_load(
|
153 |
+
'WP_FAIL2BAN_OPENLOG_OPTIONS',
|
154 |
+
'intval',
|
155 |
+
true,
|
156 |
+
array( 'syslog', 'connection' )
|
157 |
+
);
|
158 |
+
_load(
|
159 |
+
'WP_FAIL2BAN_SYSLOG_SHORT_TAG',
|
160 |
+
'boolval',
|
161 |
+
true,
|
162 |
+
array( 'syslog', 'workaround', 'short_tag' )
|
163 |
+
);
|
164 |
+
_load(
|
165 |
+
'WP_FAIL2BAN_HTTP_HOST',
|
166 |
+
'boolval',
|
167 |
+
true,
|
168 |
+
array( 'syslog', 'workaround', 'http_host' )
|
169 |
+
);
|
170 |
+
_load(
|
171 |
+
'WP_FAIL2BAN_TRUNCATE_HOST',
|
172 |
+
'boolval',
|
173 |
+
true,
|
174 |
+
array( 'syslog', 'workaround', 'truncate_host' )
|
175 |
+
);
|
176 |
+
_load(
|
177 |
+
'WP_FAIL2BAN_BLOCK_USER_ENUMERATION',
|
178 |
+
'boolval',
|
179 |
+
true,
|
180 |
+
array( 'block', 'user_enumeration' )
|
181 |
+
);
|
182 |
+
_load(
|
183 |
+
'WP_FAIL2BAN_BLOCKED_USERS',
|
184 |
+
'strval',
|
185 |
+
true,
|
186 |
+
array( 'block', 'users' )
|
187 |
+
);
|
188 |
+
_load(
|
189 |
+
'WP_FAIL2BAN_PROXIES',
|
190 |
+
__NAMESPACE__ . '\\validate_ips',
|
191 |
+
true,
|
192 |
+
array( 'remote-ip', 'proxies' )
|
193 |
+
);
|
194 |
+
_load(
|
195 |
+
'WP_FAIL2BAN_PLUGIN_LOG_AUTH',
|
196 |
+
'boolval',
|
197 |
+
true,
|
198 |
+
array(
|
199 |
+
'logging',
|
200 |
+
'plugins',
|
201 |
+
'auth',
|
202 |
+
'enabled'
|
203 |
+
)
|
204 |
+
);
|
205 |
+
_load(
|
206 |
+
'WP_FAIL2BAN_PLUGIN_LOG_COMMENT',
|
207 |
+
'boolval',
|
208 |
+
true,
|
209 |
+
array(
|
210 |
+
'logging',
|
211 |
+
'plugins',
|
212 |
+
'comment',
|
213 |
+
'enabled'
|
214 |
+
)
|
215 |
+
);
|
216 |
+
_load(
|
217 |
+
'WP_FAIL2BAN_PLUGIN_LOG_PASSWORD',
|
218 |
+
'boolval',
|
219 |
+
true,
|
220 |
+
array(
|
221 |
+
'logging',
|
222 |
+
'plugins',
|
223 |
+
'password',
|
224 |
+
'enabled'
|
225 |
+
)
|
226 |
+
);
|
227 |
+
_load(
|
228 |
+
'WP_FAIL2BAN_PLUGIN_LOG_REST',
|
229 |
+
'boolval',
|
230 |
+
true,
|
231 |
+
array(
|
232 |
+
'logging',
|
233 |
+
'plugins',
|
234 |
+
'rest',
|
235 |
+
'enabled'
|
236 |
+
)
|
237 |
+
);
|
238 |
+
_load(
|
239 |
+
'WP_FAIL2BAN_PLUGIN_LOG_SPAM',
|
240 |
+
'boolval',
|
241 |
+
true,
|
242 |
+
array(
|
243 |
+
'logging',
|
244 |
+
'plugins',
|
245 |
+
'spam',
|
246 |
+
'enabled'
|
247 |
+
)
|
248 |
+
);
|
249 |
+
_load(
|
250 |
+
'WP_FAIL2BAN_PLUGIN_LOG_XMLRPC',
|
251 |
+
'boolval',
|
252 |
+
true,
|
253 |
+
array(
|
254 |
+
'logging',
|
255 |
+
'plugins',
|
256 |
+
'xmlrpc',
|
257 |
+
'enabled'
|
258 |
+
)
|
259 |
+
);
|
260 |
+
_load(
|
261 |
+
'WP_FAIL2BAN_PLUGIN_AUTH_LOG',
|
262 |
+
'intval',
|
263 |
+
false,
|
264 |
+
array(
|
265 |
+
'logging',
|
266 |
+
'plugins',
|
267 |
+
'auth',
|
268 |
+
'facility'
|
269 |
+
)
|
270 |
+
);
|
271 |
+
_load(
|
272 |
+
'WP_FAIL2BAN_PLUGIN_COMMENT_LOG',
|
273 |
+
'intval',
|
274 |
+
false,
|
275 |
+
array(
|
276 |
+
'logging',
|
277 |
+
'plugins',
|
278 |
+
'comment',
|
279 |
+
'facility'
|
280 |
+
)
|
281 |
+
);
|
282 |
+
_load(
|
283 |
+
'WP_FAIL2BAN_PLUGIN_PASSWORD_LOG',
|
284 |
+
'intval',
|
285 |
+
false,
|
286 |
+
array(
|
287 |
+
'logging',
|
288 |
+
'plugins',
|
289 |
+
'password',
|
290 |
+
'facility'
|
291 |
+
)
|
292 |
+
);
|
293 |
+
_load(
|
294 |
+
'WP_FAIL2BAN_PLUGIN_REST_LOG',
|
295 |
+
'intval',
|
296 |
+
false,
|
297 |
+
array(
|
298 |
+
'logging',
|
299 |
+
'plugins',
|
300 |
+
'rest',
|
301 |
+
'facility'
|
302 |
+
)
|
303 |
+
);
|
304 |
+
_load(
|
305 |
+
'WP_FAIL2BAN_PLUGIN_SPAM_LOG',
|
306 |
+
'intval',
|
307 |
+
false,
|
308 |
+
array(
|
309 |
+
'logging',
|
310 |
+
'plugins',
|
311 |
+
'spam',
|
312 |
+
'facility'
|
313 |
+
)
|
314 |
+
);
|
315 |
+
_load(
|
316 |
+
'WP_FAIL2BAN_PLUGIN_XMLRPC_LOG',
|
317 |
+
'intval',
|
318 |
+
false,
|
319 |
+
array(
|
320 |
+
'logging',
|
321 |
+
'plugins',
|
322 |
+
'xmlrpc',
|
323 |
+
'facility'
|
324 |
+
)
|
325 |
+
);
|
326 |
+
// phpcs:enable
|
327 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Plugin URI: https://wp-fail2ban.com/
|
|
6 |
Tags: fail2ban, login, security, syslog
|
7 |
Requires at least: 4.2
|
8 |
Tested up to: 5.2
|
9 |
-
Stable tag: 4.2.
|
10 |
Requires PHP: 5.3
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -30,6 +30,7 @@ Write a myriad of WordPress events to syslog for integration with fail2ban.
|
|
30 |
Version 4.2 introduces a simple API for authors to integrate their plugins with *WPf2b*, with 2 *experimental* add-ons:
|
31 |
* [Contact Form 7](https://wordpress.org/plugins/wp-fail2ban-addon-contact-form-7/)
|
32 |
* [Gravity Forms](https://wordpress.org/plugins/wp-fail2ban-addon-gravity-forms/)
|
|
|
33 |
|
34 |
* **CloudFlare and Proxy Servers**
|
35 |
*WPf2b* can be configured to work with CloudFlare and other proxy servers. For an overview see [`WP_FAIL2BAN_PROXIES`](https://docs.wp-fail2ban.com/en/4.2/defines.html#wp-fail2ban-proxies).
|
@@ -63,6 +64,10 @@ Write a myriad of WordPress events to syslog for integration with fail2ban.
|
|
63 |
|
64 |
== Changelog ==
|
65 |
|
|
|
|
|
|
|
|
|
66 |
= 4.2.4 =
|
67 |
* Add filter for login failed message.
|
68 |
* Fix logging spam comments from admin area.
|
@@ -202,6 +207,9 @@ Write a myriad of WordPress events to syslog for integration with fail2ban.
|
|
202 |
|
203 |
== Upgrade Notice ==
|
204 |
|
|
|
|
|
|
|
205 |
= 4.2.4 =
|
206 |
This is a minor release. You do not need to update your filters from 4.1.0.
|
207 |
|
6 |
Tags: fail2ban, login, security, syslog
|
7 |
Requires at least: 4.2
|
8 |
Tested up to: 5.2
|
9 |
+
Stable tag: 4.2.5
|
10 |
Requires PHP: 5.3
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
30 |
Version 4.2 introduces a simple API for authors to integrate their plugins with *WPf2b*, with 2 *experimental* add-ons:
|
31 |
* [Contact Form 7](https://wordpress.org/plugins/wp-fail2ban-addon-contact-form-7/)
|
32 |
* [Gravity Forms](https://wordpress.org/plugins/wp-fail2ban-addon-gravity-forms/)
|
33 |
+
**NB:** Requires PHP >= 5.6
|
34 |
|
35 |
* **CloudFlare and Proxy Servers**
|
36 |
*WPf2b* can be configured to work with CloudFlare and other proxy servers. For an overview see [`WP_FAIL2BAN_PROXIES`](https://docs.wp-fail2ban.com/en/4.2/defines.html#wp-fail2ban-proxies).
|
64 |
|
65 |
== Changelog ==
|
66 |
|
67 |
+
= 4.2.5 =
|
68 |
+
* Properly fix PHP 5.3 support; tested on CentOS 6. Does not support any UI or Premium features.
|
69 |
+
* Fix potential issue with `WP_FAIL2BAN_BLOCK_USER_ENUMERATION` if calling REST API or XMLRPC from admin area.
|
70 |
+
|
71 |
= 4.2.4 =
|
72 |
* Add filter for login failed message.
|
73 |
* Fix logging spam comments from admin area.
|
207 |
|
208 |
== Upgrade Notice ==
|
209 |
|
210 |
+
= 4.2.5 =
|
211 |
+
This is a minor release. You do not need to update your filters from 4.1.0.
|
212 |
+
|
213 |
= 4.2.4 =
|
214 |
This is a minor release. You do not need to update your filters from 4.1.0.
|
215 |
|
vendor/freemius/wordpress-sdk/templates/pricing.php
CHANGED
@@ -88,6 +88,7 @@
|
|
88 |
// Billing cycle.
|
89 |
'billing_cycle' => fs_request_get( 'billing_cycle', WP_FS__PERIOD_ANNUALLY ),
|
90 |
'is_network_admin' => fs_is_network_admin() ? 'true' : 'false',
|
|
|
91 |
) );
|
92 |
|
93 |
if ( ! $fs->is_registered() ) {
|
88 |
// Billing cycle.
|
89 |
'billing_cycle' => fs_request_get( 'billing_cycle', WP_FS__PERIOD_ANNUALLY ),
|
90 |
'is_network_admin' => fs_is_network_admin() ? 'true' : 'false',
|
91 |
+
'currency' => $fs->apply_filters( 'default_currency', 'usd' ),
|
92 |
) );
|
93 |
|
94 |
if ( ! $fs->is_registered() ) {
|
wp-fail2ban-main.php
CHANGED
@@ -80,11 +80,35 @@ __ERROR__;
|
|
80 |
|
81 |
}
|
82 |
} );
|
83 |
-
require __DIR__ . '/feature/plugins.php';
|
84 |
require __DIR__ . '/feature/lib.php';
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
}
|
|
|
88 |
/**
|
89 |
* @since 4.0.5
|
90 |
*/
|
@@ -167,6 +191,31 @@ if ( !function_exists( __NAMESPACE__ . '\\wp_login_failed' ) ) {
|
|
167 |
add_action( 'wp_login_failed', __NAMESPACE__ . '\\wp_login_failed' );
|
168 |
}
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
/**
|
171 |
* Comments
|
172 |
*
|
@@ -202,22 +251,4 @@ if ( defined( 'WP_FAIL2BAN_LOG_SPAM' ) && true === WP_FAIL2BAN_LOG_SPAM ) {
|
|
202 |
*/
|
203 |
if ( defined( 'WP_FAIL2BAN_BLOCKED_USERS' ) && '' < WP_FAIL2BAN_BLOCKED_USERS ) {
|
204 |
require_once __DIR__ . '/feature/user.php';
|
205 |
-
}
|
206 |
-
/**
|
207 |
-
* User enumeration
|
208 |
-
*
|
209 |
-
* @since 4.0.0 Refactored
|
210 |
-
* @since 2.1.0
|
211 |
-
*/
|
212 |
-
if ( defined( 'WP_FAIL2BAN_BLOCK_USER_ENUMERATION' ) && true === WP_FAIL2BAN_BLOCK_USER_ENUMERATION ) {
|
213 |
-
require_once __DIR__ . '/feature/user-enum.php';
|
214 |
-
}
|
215 |
-
/**
|
216 |
-
* XML-RPC
|
217 |
-
*
|
218 |
-
* @since 4.0.0 Refactored
|
219 |
-
* @since 3.0.0
|
220 |
-
*/
|
221 |
-
if ( defined( 'XMLRPC_REQUEST' ) && true === XMLRPC_REQUEST ) {
|
222 |
-
require_once __DIR__ . '/feature/xmlrpc.php';
|
223 |
}
|
80 |
|
81 |
}
|
82 |
} );
|
|
|
83 |
require __DIR__ . '/feature/lib.php';
|
84 |
+
/**
|
85 |
+
* @since 4.2.5
|
86 |
+
*/
|
87 |
+
|
88 |
+
if ( version_compare( PHP_VERSION, '5.6.0', '>=' ) ) {
|
89 |
+
/**
|
90 |
+
* @since 4.2.0
|
91 |
+
*/
|
92 |
+
global $wp_fail2ban ;
|
93 |
+
$wp_fail2ban['plugins'] = array();
|
94 |
+
require __DIR__ . '/feature/plugins.php';
|
95 |
+
if ( is_admin() ) {
|
96 |
+
require 'admin/admin.php';
|
97 |
+
}
|
98 |
+
} elseif ( is_admin() ) {
|
99 |
+
require __DIR__ . '/admin/lib/about.php';
|
100 |
+
add_action( 'admin_menu', function () {
|
101 |
+
add_menu_page(
|
102 |
+
'WP fail2ban',
|
103 |
+
'WP fail2ban',
|
104 |
+
'manage_options',
|
105 |
+
'wp-fail2ban',
|
106 |
+
__NAMESPACE__ . '\\about',
|
107 |
+
'dashicons-analytics'
|
108 |
+
);
|
109 |
+
} );
|
110 |
}
|
111 |
+
|
112 |
/**
|
113 |
* @since 4.0.5
|
114 |
*/
|
191 |
add_action( 'wp_login_failed', __NAMESPACE__ . '\\wp_login_failed' );
|
192 |
}
|
193 |
|
194 |
+
/**
|
195 |
+
* @since 4.2.5
|
196 |
+
*/
|
197 |
+
|
198 |
+
if ( !is_admin() ) {
|
199 |
+
/**
|
200 |
+
* User enumeration
|
201 |
+
*
|
202 |
+
* @since 4.0.0 Refactored
|
203 |
+
* @since 2.1.0
|
204 |
+
*/
|
205 |
+
if ( defined( 'WP_FAIL2BAN_BLOCK_USER_ENUMERATION' ) && true === WP_FAIL2BAN_BLOCK_USER_ENUMERATION ) {
|
206 |
+
require_once __DIR__ . '/feature/user-enum.php';
|
207 |
+
}
|
208 |
+
/**
|
209 |
+
* XML-RPC
|
210 |
+
*
|
211 |
+
* @since 4.0.0 Refactored
|
212 |
+
* @since 3.0.0
|
213 |
+
*/
|
214 |
+
if ( defined( 'XMLRPC_REQUEST' ) && true === XMLRPC_REQUEST ) {
|
215 |
+
require_once __DIR__ . '/feature/xmlrpc.php';
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
/**
|
220 |
* Comments
|
221 |
*
|
251 |
*/
|
252 |
if ( defined( 'WP_FAIL2BAN_BLOCKED_USERS' ) && '' < WP_FAIL2BAN_BLOCKED_USERS ) {
|
253 |
require_once __DIR__ . '/feature/user.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
}
|
wp-fail2ban.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Plugin URI: https://wp-fail2ban.com/
|
6 |
* Description: Write a myriad of WordPress events to syslog for integration with fail2ban.
|
7 |
* Text Domain: wp-fail2ban
|
8 |
-
* Version: 4.2.
|
9 |
* Author: Charles Lecklider
|
10 |
* Author URI: https://charles.lecklider.org/
|
11 |
* License: GPLv2
|
@@ -39,13 +39,8 @@ namespace org\lecklider\charles\wordpress\wp_fail2ban;
|
|
39 |
/**
|
40 |
* @since 4.0.5
|
41 |
*/
|
42 |
-
define( 'WP_FAIL2BAN_VER', '4.2.
|
43 |
define( 'WP_FAIL2BAN_FILE', __FILE__ );
|
44 |
-
/**
|
45 |
-
* @since 4.2.0
|
46 |
-
*/
|
47 |
-
global $wp_fail2ban ;
|
48 |
-
$wp_fail2ban['plugins'] = [];
|
49 |
/**
|
50 |
* Freemius integration
|
51 |
*
|
@@ -93,14 +88,18 @@ if ( function_exists( __NAMESPACE__ . '\\wf_fs' ) ) {
|
|
93 |
|
94 |
// Init Freemius.
|
95 |
wf_fs();
|
|
|
|
|
|
|
|
|
96 |
// Signal that SDK was initiated.
|
97 |
do_action( 'wf_fs_loaded' );
|
98 |
}
|
99 |
|
100 |
// @codeCoverageIgnoreEnd
|
101 |
/**
|
102 |
-
* Freemius insists on mangling the formatting of the main plugin file
|
103 |
-
*
|
104 |
-
* @since 4.0.0 Refactored
|
105 |
*/
|
106 |
require_once 'wp-fail2ban-main.php';
|
5 |
* Plugin URI: https://wp-fail2ban.com/
|
6 |
* Description: Write a myriad of WordPress events to syslog for integration with fail2ban.
|
7 |
* Text Domain: wp-fail2ban
|
8 |
+
* Version: 4.2.5
|
9 |
* Author: Charles Lecklider
|
10 |
* Author URI: https://charles.lecklider.org/
|
11 |
* License: GPLv2
|
39 |
/**
|
40 |
* @since 4.0.5
|
41 |
*/
|
42 |
+
define( 'WP_FAIL2BAN_VER', '4.2.5' );
|
43 |
define( 'WP_FAIL2BAN_FILE', __FILE__ );
|
|
|
|
|
|
|
|
|
|
|
44 |
/**
|
45 |
* Freemius integration
|
46 |
*
|
88 |
|
89 |
// Init Freemius.
|
90 |
wf_fs();
|
91 |
+
// Set currency to GBP
|
92 |
+
wf_fs()->add_filter( 'default_currency', function () {
|
93 |
+
return 'gbp';
|
94 |
+
} );
|
95 |
// Signal that SDK was initiated.
|
96 |
do_action( 'wf_fs_loaded' );
|
97 |
}
|
98 |
|
99 |
// @codeCoverageIgnoreEnd
|
100 |
/**
|
101 |
+
* Freemius insists on mangling the formatting of the main plugin file
|
102 |
+
*
|
103 |
+
* @since 4.0.0 Refactored
|
104 |
*/
|
105 |
require_once 'wp-fail2ban-main.php';
|