Skip to content

Commit f0503bc

Browse files
committed
Verified with WordPress 6.8
1 parent ca42aa0 commit f0503bc

File tree

6 files changed

+34
-27
lines changed

6 files changed

+34
-27
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Software License](https://img.shields.io/badge/License-GPL%20v2-green.svg?style=flat-square)](LICENSE) [![PHP 7.2\+](https://img.shields.io/badge/PHP-7.2-blue?style=flat-square)](https://php.net) [![PHP 7.4\+](https://img.shields.io/badge/PHP-7.4-blue?style=flat-square)](https://php.net) [![PHP 8.1](https://img.shields.io/badge/PHP-8.1-blue?style=flat-square)](https://php.net) [![WordPress 5](https://img.shields.io/badge/WordPress-5.8-orange?style=flat-square)](https://wordpress.org) [![WordPress 6](https://img.shields.io/badge/WordPress-6.7-orange?style=flat-square)](https://wordpress.org)
1+
[![Software License](https://img.shields.io/badge/License-GPL%20v2-green.svg?style=flat-square)](LICENSE) [![PHP 7.4\+](https://img.shields.io/badge/PHP-7.4-blue?style=flat-square)](https://php.net) [![PHP 8.1](https://img.shields.io/badge/PHP-8.1-blue?style=flat-square)](https://php.net) [![WordPress 5](https://img.shields.io/badge/WordPress-5.8-orange?style=flat-square)](https://wordpress.org) [![WordPress 6](https://img.shields.io/badge/WordPress-6.8-orange?style=flat-square)](https://wordpress.org)
22

33
# Fail2WP
44

@@ -34,7 +34,7 @@ The plugin also plays nicely with Fail2ban, which is an advanced way of blocking
3434

3535
* This plugin `may` work with earlier versions of WordPress
3636
* This plugin has been tested with `WordPress 5.5.x and 6.x` at the time of this writing
37-
* This plugin has been tested with `PHP 7.2, 7.4, and 8.1.x` at the time of this writing
37+
* This plugin has been tested with `PHP 7.4, and 8.1.x` at the time of this writing
3838
* This plugin optionally makes use of `mb_` PHP functions
3939
* This plugin may create entries in your PHP error log (if active)
4040
* This plugin contains no Javascript
@@ -69,6 +69,10 @@ This is a hard question to answer. There are no known incompatibilities.
6969

7070
## Changelog
7171

72+
### 1.2.4
73+
* Verified with WordPress 6.8
74+
* Removed PHP 7.2 compatibility (PHP 7.4 or above is now required)
75+
7276
### 1.2.3
7377
* Verified with WordPress 6.7
7478
* Verified with Plugin Check (PCP)
@@ -135,7 +139,7 @@ This is a hard question to answer. There are no known incompatibilities.
135139

136140
Please see [LICENSE](LICENSE) for a full copy of GPLv2
137141

138-
Copyright (C) 2020-2024 [Joaquim Homrighausen](https://github.com/joho1968); all rights reserved.
142+
Copyright (C) 2020-2025 [Joaquim Homrighausen](https://github.com/joho1968); all rights reserved.
139143

140144
This file is part of Fail2WP. Fail2WP is free software.
141145

fail2wp/fail2wp.php

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Plugin Name: Fail2WP
1212
* Plugin URI: https://code.webbplatsen.net/wordpress/fail2wp/
1313
* Description: Security plugin for WordPress with support for Fail2ban and Cloudflare
14-
* Version: 1.2.3
14+
* Version: 1.2.4
1515
* Author: WebbPlatsen, Joaquim Homrighausen <joho@webbplatsen.se>
1616
* Author URI: https://webbplatsen.se/
1717
* License: GPL-2.0+
@@ -20,7 +20,7 @@
2020
* Domain Path: /languages
2121
*
2222
* fail2wp.php
23-
* Copyright (C) 2020-2024 Joaquim Homrighausen; all rights reserved.
23+
* Copyright (C) 2020-2025 Joaquim Homrighausen; all rights reserved.
2424
* Development sponsored by WebbPlatsen i Sverige AB, www.webbplatsen.se
2525
*
2626
* This file is part of Fail2WP. Fail2WP is free software.
@@ -1042,10 +1042,10 @@ public function fail2wp_rest_pre_dispatch( $result, \WP_REST_Server $rest_server
10421042
* according to our settings.
10431043
*
10441044
* @since 1.1.0
1045-
* @param WP_Error $errors.
1045+
* @param \WP_Error $errors.
10461046
* @param string $sanitized_user_login.
10471047
* @param string $user_email.
1048-
* @return WP_Error With or without errors
1048+
* @return \WP_Error With or without errors
10491049
*/
10501050
public function fail2wp_admin_check_new_user( \WP_Error $errors, string $user_login, string $user_email ) {
10511051
// apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );
@@ -1249,6 +1249,8 @@ public function fail2wp_admin_alert_new_users_admin() {
12491249
* @since 1.1.0
12501250
*/
12511251
public function fail2wp_admin_alert_new_users_null() {
1252+
global $wp;
1253+
12521254
echo '<div class="notice notice-error"><br/>'.
12531255
'<span class="dashicons dashicons-shield" style="font-size:24x;"></span>&nbsp;' .
12541256
esc_html__( 'User registration is enabled, but no role has been configured', 'fail2wp' ) .
@@ -1940,18 +1942,18 @@ public function fail2wp_settings() {
19401942
*
19411943
* @since 1.0.0
19421944
*/
1943-
public function fail2wp_setting_sanitize_site_label( $input ) {
1945+
public function fail2wp_setting_sanitize_site_label( $input ) : string {
19441946
if ( ! is_admin( ) || ! is_user_logged_in() || ! current_user_can( 'administrator' ) ) {
1945-
return;
1947+
return( '' );
19461948
}
19471949
if ( $this->fail2wp_have_mbstring ) {
19481950
return( mb_substr( sanitize_text_field( $input ), 0, 200 ) );
19491951
}
19501952
return( substr( sanitize_text_field( $input ), 0, 200 ) );
19511953
}
1952-
public function fail2wp_setting_sanitize_roles( $input ) {
1954+
public function fail2wp_setting_sanitize_roles( $input ) : string {
19531955
if ( ! is_admin( ) || ! is_user_logged_in() || ! current_user_can( 'administrator' ) ) {
1954-
return;
1956+
return( '' );
19551957
}
19561958
$available_roles = $this->fail2wp_get_wp_roles();
19571959
$return_val = array();
@@ -1966,9 +1968,9 @@ public function fail2wp_setting_sanitize_roles( $input ) {
19661968
}
19671969
return( wp_json_encode( $return_val ) );
19681970
}
1969-
public function fail2wp_setting_sanitize_block_ns( $input ) {
1971+
public function fail2wp_setting_sanitize_block_ns( $input ) : string {
19701972
if ( ! is_admin( ) || ! is_user_logged_in() || ! current_user_can( 'administrator' ) ) {
1971-
return;
1973+
return( '' );
19721974
}
19731975
$namespaces = $this->fail2wp_get_rest_ns();
19741976
$return_val = array();
@@ -1982,9 +1984,9 @@ public function fail2wp_setting_sanitize_block_ns( $input ) {
19821984
}
19831985
return( wp_json_encode( $return_val ) );
19841986
}
1985-
public function fail2wp_setting_sanitize_block_routes( $input ) {
1987+
public function fail2wp_setting_sanitize_block_routes( $input ) : string {
19861988
if ( ! is_admin( ) || ! is_user_logged_in() || ! current_user_can( 'administrator' ) ) {
1987-
return;
1989+
return( '' );
19881990
}
19891991
$return_val = array();
19901992
if ( is_array( $input ) ) {
@@ -1997,18 +1999,18 @@ public function fail2wp_setting_sanitize_block_routes( $input ) {
19971999
}
19982000
return( wp_json_encode( $return_val ) );
19992001
}
2000-
public function fail2wp_setting_sanitize_advanced( $input ) {
2002+
public function fail2wp_setting_sanitize_advanced( $input ) : string {
20012003
if ( ! is_admin( ) || ! is_user_logged_in() || ! current_user_can( 'administrator' ) ) {
2002-
return;
2004+
return( '' );
20032005
}
20042006
if ( $this->fail2wp_have_mbstring ) {
20052007
return( mb_substr( sanitize_text_field( $input ), 0, 200 ) );
20062008
}
20072009
return( substr( sanitize_text_field( $input ), 0, 200 ) );
20082010
}
2009-
public function fail2wp_setting_sanitize_textarea_setting( $input ) {
2011+
public function fail2wp_setting_sanitize_textarea_setting( $input ) : string {
20102012
if ( ! is_admin( ) || ! is_user_logged_in() || ! current_user_can( 'administrator' ) ) {
2011-
return;
2013+
return( '' );
20122014
}
20132015
$output = array();
20142016
$original_input = sanitize_textarea_field( $input );
@@ -2048,9 +2050,9 @@ public function fail2wp_setting_sanitize_textarea_setting( $input ) {
20482050
$input = @ wp_json_encode( $output );
20492051
return( $input );
20502052
}
2051-
public function fail2wp_setting_sanitize_username_length( $input ) {
2053+
public function fail2wp_setting_sanitize_username_length( $input ) : string {
20522054
if ( ! is_admin( ) || ! is_user_logged_in() || ! current_user_can( 'administrator' ) ) {
2053-
return;
2055+
return( '' );
20542056
}
20552057
// We really should strip everything but numbers here, but ...
20562058
$input = (int) sanitize_text_field( $input );
@@ -2061,9 +2063,9 @@ public function fail2wp_setting_sanitize_username_length( $input ) {
20612063
}
20622064
return( $input );
20632065
}
2064-
public function fail2wp_setting_sanitize_dnscache( $input ) {
2066+
public function fail2wp_setting_sanitize_dnscache( $input ) : int {
20652067
if ( ! is_admin( ) || ! is_user_logged_in() || ! current_user_can( 'administrator' ) ) {
2066-
return;
2068+
return( 10080 );
20672069
}
20682070
// We really should strip everything but numbers here, but ...
20692071
$input = (int) sanitize_text_field( $input );
@@ -2500,7 +2502,6 @@ public function fail2wp_setting_also_log_php() {
25002502
echo '</div>';
25012503
}
25022504
public function fail2wp_setting_cloudflare_check() {
2503-
$option_val = $this->fail2wp_cloudflare_check;
25042505
echo '<div class="fail2wp-role-option">';
25052506
echo '<label for="fail2wp-cloudflare-check">';
25062507
echo '<input type="checkbox" name="fail2wp-cloudflare-check" id="fail2wp-cloudflare-check" value="1" ' . ( checked( $this->fail2wp_cloudflare_check, 1, false ) ) . '/>';

fail2wp/includes/class-fail2wp-syslog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @author Joaquim Homrighausen <joho@webbplatsen.se>
99
*
1010
* class-fail2wp-syslog.php
11-
* Copyright (C) 2021,2022,2023,2024 Joaquim Homrighausen; all rights reserved.
11+
* Copyright (C) 2021-2025 Joaquim Homrighausen; all rights reserved.
1212
* Development sponsored by WebbPlatsen i Sverige AB, www.webbplatsen.se
1313
*
1414
* This file is part of Fail2WP. Fail2WP is free software.

fail2wp/includes/fail2wp_misc.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @author Joaquim Homrighausen <joho@webbplatsen.se>
99
*
1010
* fail2wp_misc.inc.php
11-
* Copyright (C) 2021,2022,2023,2024 Joaquim Homrighausen; all rights reserved.
11+
* Copyright (C) 2021-2025 Joaquim Homrighausen; all rights reserved.
1212
* Development sponsored by WebbPlatsen i Sverige AB, www.webbplatsen.se
1313
*
1414
* This file is part of Fail2WP. Fail2WP is free software.

fail2wp/languages/fail2wp-sv_SE.po

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,9 @@ msgstr ""
451451
"Ett tillägg som integrerar WordPress med Mattermost, inklusive aviseringar "
452452
"och OAuth2-autentisering"
453453

454+
msgid ""
454455
"Plugin that provides uncomplicated 2FA protection"
456+
msgstr ""
455457
"Ett tillägg som tillhandahåller okomplicerat 2FA-skydd"
456458

457459
#: fail2wp.php:1678

fail2wp/uninstall.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @author Joaquim Homrighausen <joho@webbplatsen.se>
99
*
1010
* uninstall.php
11-
* Copyright (C) 2021,2022,2023,2024 Joaquim Homrighausen; all rights reserved.
11+
* Copyright (C) 2020-2025 Joaquim Homrighausen; all rights reserved.
1212
* Development sponsored by WebbPlatsen i Sverige AB, www.webbplatsen.se
1313
*
1414
* This file is part of Fail2WP. Fail2WP is free software.

0 commit comments

Comments
 (0)