Skip to content

Commit 70fcc6c

Browse files
author
hCaptcha GHA
committed
release v4.22.0
1 parent ea504aa commit 70fcc6c

File tree

144 files changed

+1145
-908
lines changed

Some content is hidden

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

144 files changed

+1145
-908
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

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,35 +49,35 @@
4949
"@wordpress/hooks": "^4.33.0"
5050
},
5151
"devDependencies": {
52-
"@babel/core": "^7.28.5",
53-
"@babel/preset-env": "^7.28.5",
54-
"@inrupt/jest-jsdom-polyfills": "^4.0.5",
55-
"@wordpress/eslint-plugin": "^22.19.0",
52+
"@babel/core": "^7.28.6",
53+
"@babel/preset-env": "^7.28.6",
54+
"@inrupt/jest-jsdom-polyfills": "^4.0.8",
55+
"@wordpress/eslint-plugin": "^24.0.0",
5656
"babel-loader": "^10.0.0",
5757
"coveralls": "^3.1.1",
5858
"css-loader": "^7.1.2",
59-
"css-minimizer-webpack-plugin": "^7.0.2",
59+
"css-minimizer-webpack-plugin": "^7.0.4",
6060
"eslint": "^8.57.1",
6161
"glob": "^13.0.0",
6262
"jest": "^30.2.0",
6363
"jest-environment-jsdom": "^30.2.0",
6464
"jest-fetch-mock": "^3.0.3",
6565
"jquery": "^3.7.1",
66-
"mini-css-extract-plugin": "^2.9.4",
67-
"prettier": "^3.6.2",
66+
"mini-css-extract-plugin": "^2.10.0",
67+
"prettier": "^3.8.0",
6868
"qs": "^6.14.1",
69-
"terser-webpack-plugin": "^5.3.14",
69+
"terser-webpack-plugin": "^5.3.16",
7070
"typescript": "^5.9.3",
71-
"webpack": "^5.102.1",
71+
"webpack": "^5.104.1",
7272
"webpack-cli": "^6.0.1",
7373
"webpack-remove-empty-scripts": "^1.1.1"
7474
},
7575
"overrides": {
7676
"cross-spawn": "^7.0.6",
77-
"form-data": "^2.5.4",
77+
"form-data": "^2.5.5",
7878
"js-yaml": "^4.1.1",
7979
"micromatch": "^4.0.8",
80-
"tar": "^7.5.2",
81-
"undici": "^7.8.0"
80+
"tar": "^7.5.3",
81+
"undici": "^7.18.2"
8282
}
8383
}

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.

0 commit comments

Comments
 (0)