WP fail2ban - Version 4.2.5

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 Icon 128x128 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 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-06-23T20:07:39+00:00
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-06-23T20:07:39+00:00
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-06-23T20:07:39+00:00
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 org\lecklider\charles\wordpress\wp_fail2ban;
10
-
11
- if ( !defined( 'ABSPATH' ) ) {
12
- exit;
13
- }
14
- if ( defined( 'PHPUNIT_COMPOSER_INSTALL' ) ) {
15
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  }
17
- /**
18
- * Helper
19
- *
20
- * @since 4.0.0
21
- *
22
- * @param string $define
23
- * @param callable $cast
24
- * @param bool $unset
25
- * @param array $field
26
- */
27
- function _load(
28
- $define,
29
- $cast,
30
- $unset,
31
- array $field
32
- )
33
- {
34
- global $wp_fail2ban ;
35
- $wp_fail2ban['config'][$define] = [
36
- 'validate' => $cast,
37
- 'unset' => $unset,
38
- 'field' => $field,
39
- 'ndef' => !defined( $define ),
40
- ];
41
- if ( !defined( $define ) ) {
 
 
 
 
 
 
 
 
 
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
- * Validate IP list
56
- *
57
- * @since 4.0.0
58
- *
59
- * @param array|string $value
60
- *
61
- * @return string
62
- */
63
- function validate_ips( $value )
64
- {
65
- return $value;
66
- }
67
-
68
- // phpcs:disable Generic.Functions.FunctionCallArgumentSpacing
69
- _load(
70
- 'WP_FAIL2BAN_AUTH_LOG',
71
- 'intval',
72
- true,
73
- [ 'logging', 'authentication', 'facility' ]
74
- );
75
- _load(
76
- 'WP_FAIL2BAN_LOG_COMMENTS',
77
- 'boolval',
78
- true,
79
- [ 'logging', 'comments', 'enabled' ]
80
- );
81
- _load(
82
- 'WP_FAIL2BAN_LOG_COMMENTS_EXTRA',
83
- 'intval',
84
- true,
85
- [ 'logging', 'comments', 'extra' ]
86
- );
87
- _load(
88
- 'WP_FAIL2BAN_COMMENT_LOG',
89
- 'intval',
90
- false,
91
- [ 'logging', 'comments', 'facility' ]
92
- );
93
- _load(
94
- 'WP_FAIL2BAN_COMMENT_EXTRA_LOG',
95
- 'intval',
96
- false,
97
- [ 'logging', 'comments-extra', 'facility' ]
98
- );
99
- _load(
100
- 'WP_FAIL2BAN_LOG_PASSWORD_REQUEST',
101
- 'boolval',
102
- true,
103
- [ 'logging', 'password-request', 'enabled' ]
104
- );
105
- _load(
106
- 'WP_FAIL2BAN_PASSWORD_REQUEST_LOG',
107
- 'intval',
108
- false,
109
- [ 'logging', 'password-request', 'facility' ]
110
- );
111
- _load(
112
- 'WP_FAIL2BAN_LOG_PINGBACKS',
113
- 'boolval',
114
- true,
115
- [ 'logging', 'pingback', 'enabled' ]
116
- );
117
- _load(
118
- 'WP_FAIL2BAN_PINGBACK_LOG',
119
- 'intval',
120
- false,
121
- [ 'logging', 'pingback', 'facility' ]
122
- );
123
- _load(
124
- 'WP_FAIL2BAN_LOG_SPAM',
125
- 'boolval',
126
- true,
127
- [ 'logging', 'spam', 'enabled' ]
128
- );
129
- _load(
130
- 'WP_FAIL2BAN_SPAM_LOG',
131
- 'intval',
132
- false,
133
- [ 'logging', 'spam', 'facility' ]
134
- );
135
- _load(
136
- 'WP_FAIL2BAN_OPENLOG_OPTIONS',
137
- 'intval',
138
- true,
139
- [ 'syslog', 'connection' ]
140
- );
141
- _load(
142
- 'WP_FAIL2BAN_SYSLOG_SHORT_TAG',
143
- 'boolval',
144
- true,
145
- [ 'syslog', 'workaround', 'short_tag' ]
146
- );
147
- _load(
148
- 'WP_FAIL2BAN_HTTP_HOST',
149
- 'boolval',
150
- true,
151
- [ 'syslog', 'workaround', 'http_host' ]
152
- );
153
- _load(
154
- 'WP_FAIL2BAN_TRUNCATE_HOST',
155
- 'boolval',
156
- true,
157
- [ 'syslog', 'workaround', 'truncate_host' ]
158
- );
159
- _load(
160
- 'WP_FAIL2BAN_BLOCK_USER_ENUMERATION',
161
- 'boolval',
162
- true,
163
- [ 'block', 'user_enumeration' ]
164
- );
165
- _load(
166
- 'WP_FAIL2BAN_BLOCKED_USERS',
167
- 'strval',
168
- true,
169
- [ 'block', 'users' ]
170
- );
171
- _load(
172
- 'WP_FAIL2BAN_PROXIES',
173
- __NAMESPACE__ . '\\validate_ips',
174
- true,
175
- [ 'remote-ip', 'proxies' ]
176
- );
177
- _load(
178
- 'WP_FAIL2BAN_PLUGIN_LOG_AUTH',
179
- 'boolval',
180
- true,
181
- [
182
- 'logging',
183
- 'plugins',
184
- 'auth',
185
- 'enabled'
186
- ]
187
- );
188
- _load(
189
- 'WP_FAIL2BAN_PLUGIN_LOG_COMMENT',
190
- 'boolval',
191
- true,
192
- [
193
- 'logging',
194
- 'plugins',
195
- 'comment',
196
- 'enabled'
197
- ]
198
- );
199
- _load(
200
- 'WP_FAIL2BAN_PLUGIN_LOG_PASSWORD',
201
- 'boolval',
202
- true,
203
- [
204
- 'logging',
205
- 'plugins',
206
- 'password',
207
- 'enabled'
208
- ]
209
- );
210
- _load(
211
- 'WP_FAIL2BAN_PLUGIN_LOG_REST',
212
- 'boolval',
213
- true,
214
- [
215
- 'logging',
216
- 'plugins',
217
- 'rest',
218
- 'enabled'
219
- ]
220
- );
221
- _load(
222
- 'WP_FAIL2BAN_PLUGIN_LOG_SPAM',
223
- 'boolval',
224
- true,
225
- [
226
- 'logging',
227
- 'plugins',
228
- 'spam',
229
- 'enabled'
230
- ]
231
- );
232
- _load(
233
- 'WP_FAIL2BAN_PLUGIN_LOG_XMLRPC',
234
- 'boolval',
235
- true,
236
- [
237
- 'logging',
238
- 'plugins',
239
- 'xmlrpc',
240
- 'enabled'
241
- ]
242
- );
243
- _load(
244
- 'WP_FAIL2BAN_PLUGIN_AUTH_LOG',
245
- 'intval',
246
- false,
247
- [
248
- 'logging',
249
- 'plugins',
250
- 'auth',
251
- 'facility'
252
- ]
253
- );
254
- _load(
255
- 'WP_FAIL2BAN_PLUGIN_COMMENT_LOG',
256
- 'intval',
257
- false,
258
- [
259
- 'logging',
260
- 'plugins',
261
- 'comment',
262
- 'facility'
263
- ]
264
- );
265
- _load(
266
- 'WP_FAIL2BAN_PLUGIN_PASSWORD_LOG',
267
- 'intval',
268
- false,
269
- [
270
- 'logging',
271
- 'plugins',
272
- 'password',
273
- 'facility'
274
- ]
275
- );
276
- _load(
277
- 'WP_FAIL2BAN_PLUGIN_REST_LOG',
278
- 'intval',
279
- false,
280
- [
281
- 'logging',
282
- 'plugins',
283
- 'rest',
284
- 'facility'
285
- ]
286
- );
287
- _load(
288
- 'WP_FAIL2BAN_PLUGIN_SPAM_LOG',
289
- 'intval',
290
- false,
291
- [
292
- 'logging',
293
- 'plugins',
294
- 'spam',
295
- 'facility'
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.4
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
- if ( is_admin() ) {
86
- require 'admin/admin.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.4
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.4' );
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';