Skip to content

Commit

Permalink
Updates to 2.8.14
Browse files Browse the repository at this point in the history
  • Loading branch information
Gravity Forms committed Jul 11, 2024
1 parent 3ca2bee commit 82e86f6
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 19 deletions.
2 changes: 1 addition & 1 deletion assets/css/dist/assets.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('hash_map' => array('admin-components.min.css' => array('version' => 'f78e5368d8b599a78b9709de2178cf97', 'file' => 'admin-components.min.css'), 'admin-css-utilities.min.css' => array('version' => '047c723392c56ed67effb778811f50ea', 'file' => 'admin-css-utilities.min.css'), 'admin-icons.min.css' => array('version' => '520e7dcc452befec5f1c95e51400ec2d', 'file' => 'admin-icons.min.css'), 'admin-ie11.min.css' => array('version' => 'b1f15b2772b378a5549ac45eefe2fcb7', 'file' => 'admin-ie11.min.css'), 'admin-theme.min.css' => array('version' => '181487c53e25a62e81e1db77d7c504e3', 'file' => 'admin-theme.min.css'), 'admin.min.css' => array('version' => 'ad4bd4031a7381623aa492f221204300', 'file' => 'admin.min.css'), 'basic.min.css' => array('version' => '4bedfdb9cf94d64f854157dffba8b66f', 'file' => 'basic.min.css'), 'blocks.min.css' => array('version' => 'f7b147e3138419bb9db86d7e0b0bd5e5', 'file' => 'blocks.min.css'), 'common-css-utilities.min.css' => array('version' => '2633df3a029b0d34687e2d197707e947', 'file' => 'common-css-utilities.min.css'), 'editor.min.css' => array('version' => '2f49083c345e8bfb0963334961946713', 'file' => 'editor.min.css'), 'font-awesome.min.css' => array('version' => 'ab928ca9bd3a308082b143be8a422524', 'file' => 'font-awesome.min.css'), 'gravity-forms-common-icons.min.css' => array('version' => '7144d998edb50d92c9bd4e51d89e1248', 'file' => 'gravity-forms-common-icons.min.css'), 'gravity-forms-orbital-theme.min.css' => array('version' => 'd41d8cd98f00b204e9800998ecf8427e', 'file' => 'gravity-forms-orbital-theme.min.css'), 'gravity-forms-theme-foundation.min.css' => array('version' => '24e1aab73d398b04bedb185ac75f540d', 'file' => 'gravity-forms-theme-foundation.min.css'), 'gravity-forms-theme-framework.min.css' => array('version' => '7ed359ef17010b5a486e83c0767de750', 'file' => 'gravity-forms-theme-framework.min.css'), 'gravity-forms-theme-reset.min.css' => array('version' => '590d763581c57d55da02972ac0f387d2', 'file' => 'gravity-forms-theme-reset.min.css'), 'settings.min.css' => array('version' => '4cb83c6672a27a4c740ed77ad231fd11', 'file' => 'settings.min.css'), 'setup-wizard.min.css' => array('version' => '7c1011a25f000c4eb8f1bcb85fa4dfa2', 'file' => 'setup-wizard.min.css'), 'template-library.min.css' => array('version' => '560c6c8266f8a6c5cf81077ad29c13a9', 'file' => 'template-library.min.css'), 'theme-components.min.css' => array('version' => 'd41d8cd98f00b204e9800998ecf8427e', 'file' => 'theme-components.min.css'), 'theme-ie11.min.css' => array('version' => '67ea51dbc2856d10c83352871408a6da', 'file' => 'theme-ie11.min.css'), 'theme.min.css' => array('version' => '6a7e3f08eafa3f4cd82cb28dfa574bfa', 'file' => 'theme.min.css')));
<?php return array('hash_map' => array('admin-components.min.css' => array('version' => 'f78e5368d8b599a78b9709de2178cf97', 'file' => 'admin-components.min.css'), 'admin-css-utilities.min.css' => array('version' => '047c723392c56ed67effb778811f50ea', 'file' => 'admin-css-utilities.min.css'), 'admin-icons.min.css' => array('version' => '520e7dcc452befec5f1c95e51400ec2d', 'file' => 'admin-icons.min.css'), 'admin-ie11.min.css' => array('version' => 'b1f15b2772b378a5549ac45eefe2fcb7', 'file' => 'admin-ie11.min.css'), 'admin-theme.min.css' => array('version' => '181487c53e25a62e81e1db77d7c504e3', 'file' => 'admin-theme.min.css'), 'admin.min.css' => array('version' => 'ad4bd4031a7381623aa492f221204300', 'file' => 'admin.min.css'), 'basic.min.css' => array('version' => '4bedfdb9cf94d64f854157dffba8b66f', 'file' => 'basic.min.css'), 'blocks.min.css' => array('version' => 'f7b147e3138419bb9db86d7e0b0bd5e5', 'file' => 'blocks.min.css'), 'common-css-utilities.min.css' => array('version' => '2633df3a029b0d34687e2d197707e947', 'file' => 'common-css-utilities.min.css'), 'editor.min.css' => array('version' => '6a4bdd86191cb74f53524474d2ee78a8', 'file' => 'editor.min.css'), 'font-awesome.min.css' => array('version' => 'ab928ca9bd3a308082b143be8a422524', 'file' => 'font-awesome.min.css'), 'gravity-forms-common-icons.min.css' => array('version' => '7144d998edb50d92c9bd4e51d89e1248', 'file' => 'gravity-forms-common-icons.min.css'), 'gravity-forms-orbital-theme.min.css' => array('version' => 'd41d8cd98f00b204e9800998ecf8427e', 'file' => 'gravity-forms-orbital-theme.min.css'), 'gravity-forms-theme-foundation.min.css' => array('version' => '24e1aab73d398b04bedb185ac75f540d', 'file' => 'gravity-forms-theme-foundation.min.css'), 'gravity-forms-theme-framework.min.css' => array('version' => '7ed359ef17010b5a486e83c0767de750', 'file' => 'gravity-forms-theme-framework.min.css'), 'gravity-forms-theme-reset.min.css' => array('version' => '590d763581c57d55da02972ac0f387d2', 'file' => 'gravity-forms-theme-reset.min.css'), 'settings.min.css' => array('version' => '4cb83c6672a27a4c740ed77ad231fd11', 'file' => 'settings.min.css'), 'setup-wizard.min.css' => array('version' => '7c1011a25f000c4eb8f1bcb85fa4dfa2', 'file' => 'setup-wizard.min.css'), 'template-library.min.css' => array('version' => '560c6c8266f8a6c5cf81077ad29c13a9', 'file' => 'template-library.min.css'), 'theme-components.min.css' => array('version' => 'd41d8cd98f00b204e9800998ecf8427e', 'file' => 'theme-components.min.css'), 'theme-ie11.min.css' => array('version' => '67ea51dbc2856d10c83352871408a6da', 'file' => 'theme-ie11.min.css'), 'theme.min.css' => array('version' => '6a7e3f08eafa3f4cd82cb28dfa574bfa', 'file' => 'theme.min.css')));
2 changes: 1 addition & 1 deletion assets/css/dist/editor.min.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 2.8.14 | 2024-07-10
- Fixed the compatibility of the reCAPTCHA v2 field with Conversational Forms by removing the field from the form in Conversational view.
- Fixed a PHP warning that occurs when the current user role only has the capability to access the System Status Page.

### 2.8.13 | 2024-06-26
- Fixed an issue where custom theme styles are sometimes not applied on confirmation page or when navigating between pages in a multi-page form.
- Fixed an issue where the AJAX spinner init script is output in save and continue notifications, which can impact deliverability in some environments.
Expand Down
6 changes: 3 additions & 3 deletions gravityforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Gravity Forms
Plugin URI: https://gravityforms.com
Description: Easily create web forms and manage form entries within the WordPress admin.
Version: 2.8.13
Version: 2.8.14
Requires at least: 4.0
Requires PHP: 5.6
Author: Gravity Forms
Expand Down Expand Up @@ -244,7 +244,7 @@ class GFForms {
*
* @var string $version The version number.
*/
public static $version = '2.8.13';
public static $version = '2.8.14';

/**
* Handles background upgrade tasks.
Expand Down Expand Up @@ -1910,7 +1910,7 @@ public static function get_parent_menu( $addon_menus ) {
} else if ( GFCommon::current_user_can_any( 'gravityforms_view_addons' ) ) {
$parent = array( 'name' => 'gf_addons', 'callback' => array( 'GFForms', 'addons_page' ) );
} else if ( GFCommon::current_user_can_any( 'gravityforms_system_status' ) ) {
$parent = array( 'name' => 'gf_system_status', 'callback' => array( 'GFForms', 'system_status_page' ) );
$parent = array( 'name' => 'gf_system_status', 'callback' => array( 'GFForms', 'system_status' ) );
} else if ( GFCommon::current_user_can_any( GFCommon::all_caps() ) ) {
$parent = array( 'name' => 'gf_help', 'callback' => array( 'GFForms', 'help_page' ) );
}
Expand Down
67 changes: 65 additions & 2 deletions includes/fields/class-gf-field-captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ class GF_Field_CAPTCHA extends GF_Field {
*/
private $secret_key;

/**
* The reCAPTCHA field constructor.
*
* @since 2.8.13
*
* @param $data
*/
public function __construct( $data = array() ) {
parent::__construct( $data );

if ( ! has_filter( 'gform_pre_render', array( __CLASS__, 'maybe_remove_recaptcha_v2' ) ) ) {
add_filter( 'gform_pre_render', array( __CLASS__, 'maybe_remove_recaptcha_v2' ), 11 );
}
}

public function get_form_editor_field_title() {
return esc_attr__( 'CAPTCHA', 'gravityforms' );
}
Expand Down Expand Up @@ -84,17 +99,58 @@ function get_form_editor_field_settings() {
*
* @since 2.8
*
* @return string
* @return string|array
*/
public function get_field_sidebar_messages() {
if ( $this->captchaType === 'math' || $this->captchaType === 'simple_captcha' || ( ! empty( $this->get_site_key() ) && ! empty( $this->get_secret_key() ) ) ) {
// If the field is a math or simple captcha, we don't need to display a warning.
if ( $this->captchaType === 'math' || $this->captchaType === 'simple_captcha' ) {
return '';
}

// If the reCAPTCHA keys are configured and Conversational Forms is active, we need to display a warning.
if ( ( ! empty( $this->get_site_key() ) && ! empty( $this->get_secret_key() ) ) ) {
if ( is_plugin_active( 'gravityformsconversationalforms/conversationalforms.php' ) ) {
return array(
'type' => 'notice',
'content' => esc_html__( 'The reCAPTCHA v2 field is not supported in Conversational Forms and will be removed, but will continue to work as expected in other contexts.', 'gravityforms' )
);

} else {
return '';
}
}

// If the reCAPTCHA keys are not configured, we need to display a warning.
// Translators: 1. Opening <a> tag with link to the Forms > Settings > reCAPTCHA page. 2. closing <a> tag.
return sprintf( __( 'To use reCAPTCHA v2 you must configure the site and secret keys on the %1$sreCAPTCHA Settings%2$s page.', 'gravityforms' ), "<a href='?page=gf_settings&subview=recaptcha' target='_blank'>", '</a>' );
}

/**
* Recaptcha v2 does not work in conversational forms, so we have to remove it.
*
* @since 2.8.13
*
* @param $form
*
* @return void
*/
public static function maybe_remove_recaptcha_v2( $form ) {
if ( ! function_exists( 'is_conversational_form' ) ) {
return $form;
}

if ( ! is_conversational_form( $form ) ) {
return $form;
}

foreach ( $form['fields'] as $key => $field ) {
if ( $field->type === 'captcha' && ( $field->captchaType === '' || $field->captchaType === 'captcha' ) ) {
unset( $form['fields'][ $key ] );
}
}
return $form;
}

/**
* Validate the reCAPTCHA field.
*
Expand Down Expand Up @@ -179,6 +235,13 @@ public function validate( $value, $form ) {
* @return bool
*/
public function validate_recaptcha( $form ) {
if ( rgpost( 'gform_conversational_form' ) ) {
$hash = md5( $form['title'] . $form['id'] );
if ( $hash === $_POST['gform_conversational_form'] && is_plugin_active( 'gravityformsconversationalforms/conversationalforms.php' ) ) {
// This is a conversational form, and recaptcha v2 isn't supported
return true;
}
}
$response = $this->get_posted_recaptcha_response();

if ( ! ( $this->verify_decoded_response( $form, $response ) || $this->verify_recaptcha_response( $response ) ) ) {
Expand Down
28 changes: 16 additions & 12 deletions languages/gravityforms.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the GPL-2.0+.
msgid ""
msgstr ""
"Project-Id-Version: Gravity Forms 2.8.13\n"
"Project-Id-Version: Gravity Forms 2.8.14\n"
"Report-Msgid-Bugs-To: https://gravityforms.com/support\n"
"Last-Translator: Gravity Forms <support@gravityforms.com>\n"
"Language-Team: Gravity Forms <support@gravityforms.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-06-26T15:46:54+00:00\n"
"POT-Creation-Date: 2024-07-10T16:11:10+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.10.0\n"
"X-Domain: gravityforms\n"
Expand Down Expand Up @@ -8613,42 +8613,46 @@ msgstr ""
msgid "Price: "
msgstr ""

#: includes/fields/class-gf-field-captcha.php:37
#: includes/fields/class-gf-field-captcha.php:52
#: js.php:870
msgid "CAPTCHA"
msgstr ""

#: includes/fields/class-gf-field-captcha.php:48
#: includes/fields/class-gf-field-captcha.php:63
msgid "Adds a captcha field to your form to help protect your website from spam and bot abuse."
msgstr ""

#: includes/fields/class-gf-field-captcha.php:115
msgid "The reCAPTCHA v2 field is not supported in Conversational Forms and will be removed, but will continue to work as expected in other contexts."
msgstr ""

#. Translators: 1. Opening <a> tag with link to the Forms > Settings > reCAPTCHA page. 2. closing <a> tag.
#: includes/fields/class-gf-field-captcha.php:95
#: includes/fields/class-gf-field-captcha.php:125
msgid "To use reCAPTCHA v2 you must configure the site and secret keys on the %1$sreCAPTCHA Settings%2$s page."
msgstr ""

#: includes/fields/class-gf-field-captcha.php:116
#: includes/fields/class-gf-field-captcha.php:152
#: includes/fields/class-gf-field-captcha.php:172
#: includes/fields/class-gf-field-captcha.php:208
msgid "The CAPTCHA wasn't entered correctly. Go back and try it again."
msgstr ""

#: includes/fields/class-gf-field-captcha.php:185
#: includes/fields/class-gf-field-captcha.php:248
msgid "The reCAPTCHA was invalid. Go back and try it again."
msgstr ""

#: includes/fields/class-gf-field-captcha.php:368
#: includes/fields/class-gf-field-captcha.php:431
msgid "To use the reCAPTCHA field you must do the following:"
msgstr ""

#: includes/fields/class-gf-field-captcha.php:368
#: includes/fields/class-gf-field-captcha.php:431
msgid "Sign up%s for an API key pair for your site."
msgstr ""

#: includes/fields/class-gf-field-captcha.php:368
#: includes/fields/class-gf-field-captcha.php:431
msgid "Enter your reCAPTCHA site and secret keys in the %sreCAPTCHA Settings%s."
msgstr ""

#: includes/fields/class-gf-field-captcha.php:372
#: includes/fields/class-gf-field-captcha.php:435
msgid "An example of reCAPTCHA"
msgstr ""

Expand Down

0 comments on commit 82e86f6

Please sign in to comment.