Skip to content

Commit 050ea8d

Browse files
author
hCaptcha GHA
committed
release v4.22.0
1 parent ea504aa commit 050ea8d

File tree

142 files changed

+433
-480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+433
-480
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [ ubuntu-latest ]
18-
php-version: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
18+
php-version: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
1919

2020
env:
2121
wp-directory: wordpress

changelog.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
= 4.22.0 =
2+
* The minimum required PHP version is now 7.4.
3+
* The minimum required WordPress version is now 6.0.
4+
* Added support of 1Password on the General page.
5+
* Fixed an issue where third-party plugins calling WordPress core functions incorrectly could break What's New admin scripts and styles.
6+
* Fixed LearDash Login form.
7+
18
= 4.21.1 =
29
* Fixed hCaptcha not loading on Contact Form 7.
310

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@
3737
"require-dev": {
3838
"ext-fileinfo": "*",
3939
"roave/security-advisories": "dev-latest",
40-
"10up/wp_mock": "0.4.2 - 1.1.0",
40+
"10up/wp_mock": "^1.1.0",
4141
"antecedent/patchwork": "^2.2.3",
4242
"behat/gherkin": "<=v4.12.0",
43-
"codeception/codeception": "4.2.2",
44-
"codeception/module-db": "1.2.0 - 3.2.2",
45-
"codeception/module-webdriver": "1.4.1 - 4.0.3",
43+
"codeception/codeception": "^4.2.2",
44+
"codeception/module-db": "^1.2.0",
45+
"codeception/module-webdriver": "^1.4.1",
4646
"lucatume/function-mocker": "^2.0.0",
47-
"lucatume/wp-browser": "3.7.15 - 4.5.7",
47+
"lucatume/wp-browser": "3.7.16 - 4.5.10",
4848
"squizlabs/php_codesniffer": "^3.13.5",
4949
"phpcompatibility/php-compatibility": "^9.3.5",
5050
"phpcompatibility/phpcompatibility-wp": "^2.1.8",

hcaptcha.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
* Plugin URI: https://www.hcaptcha.com/
1212
* Description: hCaptcha keeps out bots and spam while putting privacy first. It is a drop-in replacement for reCAPTCHA.
1313
* Version: 4.21.1
14-
* Requires at least: 5.3
15-
* Requires PHP: 7.2
14+
* Requires at least: 6.0
15+
* Requires PHP: 7.4
1616
* Author: hCaptcha
1717
* Author URI: https://www.hcaptcha.com/
1818
* License: GPL v2 or later

phpcs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<arg name="parallel" value="12"/><!-- Enables parallel processing when available for faster results. -->
2727

2828
<config name="installed_paths" value="vendor/phpcompatibility/php-compatibility,vendor/phpcompatibility/phpcompatibility-paragonie,vendor/phpcompatibility/phpcompatibility-wp,vendor/phpcsstandards/phpcsextra,vendor/phpcsstandards/phpcsutils,vendor/wp-coding-standards/wpcs"/>
29-
<config name="testVersion" value="7.2-"/>
29+
<config name="testVersion" value="7.4-"/>
3030
<config name="text_domain" value="hcaptcha-for-forms-and-more"/>
3131

3232
<!-- Rules: Check PHP version compatibility -->

readme.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
=== hCaptcha for WP ===
22
Contributors: hcaptcha, kaggdesign
33
Tags: captcha, hcaptcha, antispam, abuse, protect
4-
Requires at least: 5.3
4+
Requires at least: 6.0
55
Tested up to: 6.9
6-
Requires PHP: 7.2
6+
Requires PHP: 7.4
77
Stable tag: 4.21.1
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -852,6 +852,13 @@ Instructions for popular native integrations are below:
852852

853853
== Changelog ==
854854

855+
= 4.22.0 =
856+
* The minimum required PHP version is now 7.4.
857+
* The minimum required WordPress version is now 6.0.
858+
* Added support of 1Password on the General page.
859+
* Fixed an issue where third-party plugins calling WordPress core functions incorrectly could break What's New admin scripts and styles.
860+
* Fixed LearDash Login form.
861+
855862
= 4.21.1 =
856863
* Fixed hCaptcha not loading on Contact Form 7.
857864

src/php/ACFE/Form.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* 'Form' class file.
3+
* The Form class file.
44
*
55
* @package hcaptcha-wp
66
*/
@@ -41,14 +41,14 @@ class Form {
4141
*
4242
* @var int
4343
*/
44-
protected $form_id = 0;
44+
protected int $form_id = 0;
4545

4646
/**
4747
* Captcha added.
4848
*
4949
* @var bool
5050
*/
51-
private $captcha_added = false;
51+
private bool $captcha_added = false;
5252

5353
/**
5454
* Form constructor.

src/php/Abilities/Abilities.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
use HCaptcha\Admin\Events\Events;
1111
use HCaptcha\Helpers\HCaptcha;
12+
use HCaptcha\Helpers\Utils;
13+
use JsonException;
1214
use WP_Error;
1315

1416
/**
@@ -553,8 +555,7 @@ private function get_threat_details( array $rows ): array {
553555
$offender_totals = [];
554556

555557
foreach ( $rows as $row ) {
556-
$decoded_errors = json_decode( $row->error_codes, true );
557-
$error_codes = is_array( $decoded_errors ) ? array_filter( $decoded_errors ) : [];
558+
$error_codes = Utils::json_decode_arr( $row->error_codes );
558559

559560
foreach ( $error_codes as $code ) {
560561
$code = (string) $code;

src/php/Abstracts/CommentBase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ abstract class CommentBase {
2727
*
2828
* @var bool
2929
*/
30-
protected $hcaptcha_shown = false;
30+
protected bool $hcaptcha_shown = false;
3131

3232
/**
3333
* Verification result.
@@ -41,7 +41,7 @@ abstract class CommentBase {
4141
*
4242
* @var int
4343
*/
44-
protected $form_id = 0;
44+
protected int $form_id = 0;
4545

4646
/**
4747
* Init hooks.

src/php/Abstracts/LoginBase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ abstract class LoginBase {
5151
*
5252
* @var bool
5353
*/
54-
protected $hcaptcha_shown = false;
54+
protected bool $hcaptcha_shown = false;
5555

5656
/**
5757
* Login form shown.
5858
*
5959
* @var bool
6060
*/
61-
private $login_form_shown = false;
61+
private bool $login_form_shown = false;
6262

6363
/**
6464
* Constructor.

0 commit comments

Comments
 (0)