Skip to content

Commit

Permalink
prepare 1.14.2
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinfuchs committed Jun 4, 2024
1 parent 22f3390 commit cf8e398
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
4 changes: 2 additions & 2 deletions friendly-captcha/friendly-captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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', [
Expand Down
43 changes: 23 additions & 20 deletions friendly-captcha/modules/forminator/forminator.php
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
<?php

add_action( 'forminator_render_button_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;
}
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( '<button ', $elements . '<button ', $html );
return str_replace('<button ', $elements . '<button ', $html);
}

function frcaptcha_forminator_verify( $can_show, $id, $form_settings ) {
$plugin = FriendlyCaptcha_Plugin::$instance;
if (!$plugin->is_configured() or !$plugin->get_forminator_active()) {
return $can_show;
}
function frcaptcha_forminator_verify($can_show, $id, $form_settings)
{
$plugin = FriendlyCaptcha_Plugin::$instance;
if (!$plugin->is_configured() or !$plugin->get_forminator_active()) {
return $can_show;
}

$solution = frcaptcha_get_sanitized_frcaptcha_solution_from_post();
if ( empty( $solution ) ) {
return [
$solution = frcaptcha_get_sanitized_frcaptcha_solution_from_post();
if (empty($solution)) {
return [
'can_submit' => false,
'error' => FriendlyCaptcha_Plugin::default_error_user_message() . __(" (captcha missing)", "frcaptcha"),
];
}

$verification = frcaptcha_verify_captcha_solution($solution, $plugin->get_sitekey(), $plugin->get_api_key());
if (!$verification["success"]) {
return [
return [
'can_submit' => false,
'error' => FriendlyCaptcha_Plugin::default_error_user_message(),
];
Expand Down
6 changes: 5 additions & 1 deletion friendly-captcha/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: captcha, antispam, spam, contact form, recaptcha, friendly-captcha, block
Requires at least: 5.0
Tested up to: 6.5
Requires PHP: 7.3
Stable tag: 1.14.1
Stable tag: 1.14.2
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -96,6 +96,10 @@ However, you may wish to email the authors of plugins you'd like to support Frie

== Changelog ==

= 1.14.2 =

* Add support for multistep form in FluenForm

= 1.14.1 =

* Fix fatal error caused by composer not being installed
Expand Down

0 comments on commit cf8e398

Please sign in to comment.