Skip to content

Commit 86bb14f

Browse files
committed
Fix Fluent Forms after update.
1 parent ed1b3d0 commit 86bb14f

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ Instructions for popular native integrations are below:
760760
== Changelog ==
761761

762762
= 4.21.0 =
763+
* Fixed FluentForms integrations after the latest FluentForms update.
763764

764765
= 4.20.0 =
765766
* Added Divi 5 support.

src/php/FluentForm/Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ private function remove_ff_hcaptcha(): void {
550550

551551
$src = $script->src;
552552

553-
if ( false === strpos( $src, 'fluentform' ) ) {
553+
if ( false === strpos( $src, 'api.js' ) ) {
554554
return;
555555
}
556556

src/php/Main.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ private function activate_hcaptcha(): bool {
284284
* Do not load hCaptcha functionality:
285285
* - if a user is logged in and the option 'off_when_logged_in' is set;
286286
* - for allowlisted IPs;
287-
* - when the site key or the secret key is empty (after first plugin activation).
287+
* - when the site key or the secret key is empty (after the first plugin activation).
288288
*/
289289
$deactivate = (
290290
( is_user_logged_in() && $settings->is_on( 'off_when_logged_in' ) ) ||
@@ -823,7 +823,7 @@ public function print_footer_scripts(): void {
823823
* Filters delay time for the hCaptcha API script.
824824
*
825825
* Any negative value will prevent the API script from loading
826-
* until user interaction: mouseenter, click, scroll or touch.
826+
* until user interaction: mouseenter, click, scroll, or touch.
827827
* This significantly improves Google Pagespeed Insights score.
828828
*
829829
* @param int $delay Number of milliseconds to delay hCaptcha API script.

tests/php/integration/FluentForm/FormTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ public function test_print_hcaptcha_scripts(): void {
479479
wp_dequeue_script( 'hcaptcha' );
480480
wp_deregister_script( 'hcaptcha' );
481481

482-
wp_register_script( 'hcaptcha', 'https://test.test/wp-content/plugins/fluentform/some-assets/hcaptcha.js', [], '1.0.0', true );
482+
wp_register_script( 'hcaptcha', 'https://js.hcaptcha.com/1/api.js?onload=hCaptchaOnLoad&render=explicit', [], '1.0.0', true );
483483
wp_enqueue_script( 'hcaptcha' );
484484

485485
$subject = new Form();

0 commit comments

Comments
 (0)