From cf8e39898b40c7e06fd6df4ad0b016cf584210ea Mon Sep 17 00:00:00 2001 From: merlinfuchs Date: Tue, 4 Jun 2024 12:06:10 +0200 Subject: [PATCH] prepare 1.14.2 --- friendly-captcha/friendly-captcha.php | 4 +- .../modules/forminator/forminator.php | 43 ++++++++++--------- friendly-captcha/readme.txt | 6 ++- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/friendly-captcha/friendly-captcha.php b/friendly-captcha/friendly-captcha.php index efff420..f9bd97a 100644 --- a/friendly-captcha/friendly-captcha.php +++ b/friendly-captcha/friendly-captcha.php @@ -3,7 +3,7 @@ /** * Plugin Name: Friendly Captcha for WordPress * Description: Protect WordPress website forms from spam and abuse with Friendly Captcha, a privacy-first anti-bot solution. - * Version: 1.14.1 + * Version: 1.14.2 * Requires at least: 5.0 * Requires PHP: 7.3 * Author: Friendly Captcha GmbH @@ -19,7 +19,7 @@ die; } -define('FRIENDLY_CAPTCHA_VERSION', '1.14.1'); +define('FRIENDLY_CAPTCHA_VERSION', '1.14.2'); define('FRIENDLY_CAPTCHA_FRIENDLY_CHALLENGE_VERSION', '0.9.12'); define('FRIENDLY_CAPTCHA_FRIENDLY_CAPTCHA_SDK_VERSION', '0.1.7'); define('FRIENDLY_CAPTCHA_SUPPORTED_LANGUAGES', [ diff --git a/friendly-captcha/modules/forminator/forminator.php b/friendly-captcha/modules/forminator/forminator.php index 62d4a27..e18e0e6 100644 --- a/friendly-captcha/modules/forminator/forminator.php +++ b/friendly-captcha/modules/forminator/forminator.php @@ -1,38 +1,41 @@ is_configured() or !$plugin->get_forminator_active()) { - return; - } +add_action('forminator_render_button_markup', 'frcaptcha_forminator_add_captcha', 10, 2); +add_action('forminator_render_form_submit_markup', 'frcaptcha_forminator_add_captcha', 10, 2); +add_filter('forminator_cform_form_is_submittable', 'frcaptcha_forminator_verify', 10, 3); + +function frcaptcha_forminator_add_captcha($html, $button) +{ + $plugin = FriendlyCaptcha_Plugin::$instance; + if (!$plugin->is_configured() or !$plugin->get_forminator_active()) { + return; + } - frcaptcha_enqueue_widget_scripts(); + frcaptcha_enqueue_widget_scripts(); $elements = frcaptcha_generate_widget_tag_from_plugin($plugin); - return str_replace( '