Skip to content

Commit 8a32cf4

Browse files
author
Gravity Forms
committed
Updates to 2.8.14
1 parent 6be56a2 commit 8a32cf4

File tree

6 files changed

+90
-19
lines changed

6 files changed

+90
-19
lines changed

assets/css/dist/assets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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')));
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' => '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')));

assets/css/dist/editor.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

change_log.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 2.8.14 | 2024-07-10
2+
- Fixed the compatibility of the reCAPTCHA v2 field with Conversational Forms by removing the field from the form in Conversational view.
3+
- Fixed a PHP warning that occurs when the current user role only has the capability to access the System Status Page.
4+
15
### 2.8.13 | 2024-06-26
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.
37
- Fixed an issue where the AJAX spinner init script is output in save and continue notifications, which can impact deliverability in some environments.

gravityforms.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Gravity Forms
44
Plugin URI: https://gravityforms.com
55
Description: Easily create web forms and manage form entries within the WordPress admin.
6-
Version: 2.8.13
6+
Version: 2.8.14
77
Requires at least: 4.0
88
Requires PHP: 5.6
99
Author: Gravity Forms
@@ -244,7 +244,7 @@ class GFForms {
244244
*
245245
* @var string $version The version number.
246246
*/
247-
public static $version = '2.8.13';
247+
public static $version = '2.8.14';
248248

249249
/**
250250
* Handles background upgrade tasks.
@@ -1910,7 +1910,7 @@ public static function get_parent_menu( $addon_menus ) {
19101910
} else if ( GFCommon::current_user_can_any( 'gravityforms_view_addons' ) ) {
19111911
$parent = array( 'name' => 'gf_addons', 'callback' => array( 'GFForms', 'addons_page' ) );
19121912
} else if ( GFCommon::current_user_can_any( 'gravityforms_system_status' ) ) {
1913-
$parent = array( 'name' => 'gf_system_status', 'callback' => array( 'GFForms', 'system_status_page' ) );
1913+
$parent = array( 'name' => 'gf_system_status', 'callback' => array( 'GFForms', 'system_status' ) );
19141914
} else if ( GFCommon::current_user_can_any( GFCommon::all_caps() ) ) {
19151915
$parent = array( 'name' => 'gf_help', 'callback' => array( 'GFForms', 'help_page' ) );
19161916
}

includes/fields/class-gf-field-captcha.php

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ class GF_Field_CAPTCHA extends GF_Field {
3333
*/
3434
private $secret_key;
3535

36+
/**
37+
* The reCAPTCHA field constructor.
38+
*
39+
* @since 2.8.13
40+
*
41+
* @param $data
42+
*/
43+
public function __construct( $data = array() ) {
44+
parent::__construct( $data );
45+
46+
if ( ! has_filter( 'gform_pre_render', array( __CLASS__, 'maybe_remove_recaptcha_v2' ) ) ) {
47+
add_filter( 'gform_pre_render', array( __CLASS__, 'maybe_remove_recaptcha_v2' ), 11 );
48+
}
49+
}
50+
3651
public function get_form_editor_field_title() {
3752
return esc_attr__( 'CAPTCHA', 'gravityforms' );
3853
}
@@ -84,17 +99,58 @@ function get_form_editor_field_settings() {
8499
*
85100
* @since 2.8
86101
*
87-
* @return string
102+
* @return string|array
88103
*/
89104
public function get_field_sidebar_messages() {
90-
if ( $this->captchaType === 'math' || $this->captchaType === 'simple_captcha' || ( ! empty( $this->get_site_key() ) && ! empty( $this->get_secret_key() ) ) ) {
105+
// If the field is a math or simple captcha, we don't need to display a warning.
106+
if ( $this->captchaType === 'math' || $this->captchaType === 'simple_captcha' ) {
91107
return '';
92108
}
93109

110+
// If the reCAPTCHA keys are configured and Conversational Forms is active, we need to display a warning.
111+
if ( ( ! empty( $this->get_site_key() ) && ! empty( $this->get_secret_key() ) ) ) {
112+
if ( is_plugin_active( 'gravityformsconversationalforms/conversationalforms.php' ) ) {
113+
return array(
114+
'type' => 'notice',
115+
'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' )
116+
);
117+
118+
} else {
119+
return '';
120+
}
121+
}
122+
123+
// If the reCAPTCHA keys are not configured, we need to display a warning.
94124
// Translators: 1. Opening <a> tag with link to the Forms > Settings > reCAPTCHA page. 2. closing <a> tag.
95125
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>' );
96126
}
97127

128+
/**
129+
* Recaptcha v2 does not work in conversational forms, so we have to remove it.
130+
*
131+
* @since 2.8.13
132+
*
133+
* @param $form
134+
*
135+
* @return void
136+
*/
137+
public static function maybe_remove_recaptcha_v2( $form ) {
138+
if ( ! function_exists( 'is_conversational_form' ) ) {
139+
return $form;
140+
}
141+
142+
if ( ! is_conversational_form( $form ) ) {
143+
return $form;
144+
}
145+
146+
foreach ( $form['fields'] as $key => $field ) {
147+
if ( $field->type === 'captcha' && ( $field->captchaType === '' || $field->captchaType === 'captcha' ) ) {
148+
unset( $form['fields'][ $key ] );
149+
}
150+
}
151+
return $form;
152+
}
153+
98154
/**
99155
* Validate the reCAPTCHA field.
100156
*
@@ -179,6 +235,13 @@ public function validate( $value, $form ) {
179235
* @return bool
180236
*/
181237
public function validate_recaptcha( $form ) {
238+
if ( rgpost( 'gform_conversational_form' ) ) {
239+
$hash = md5( $form['title'] . $form['id'] );
240+
if ( $hash === $_POST['gform_conversational_form'] && is_plugin_active( 'gravityformsconversationalforms/conversationalforms.php' ) ) {
241+
// This is a conversational form, and recaptcha v2 isn't supported
242+
return true;
243+
}
244+
}
182245
$response = $this->get_posted_recaptcha_response();
183246

184247
if ( ! ( $this->verify_decoded_response( $form, $response ) || $this->verify_recaptcha_response( $response ) ) ) {

languages/gravityforms.pot

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# This file is distributed under the GPL-2.0+.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Gravity Forms 2.8.13\n"
5+
"Project-Id-Version: Gravity Forms 2.8.14\n"
66
"Report-Msgid-Bugs-To: https://gravityforms.com/support\n"
77
"Last-Translator: Gravity Forms <[email protected]>\n"
88
"Language-Team: Gravity Forms <[email protected]>\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2024-06-26T15:46:54+00:00\n"
12+
"POT-Creation-Date: 2024-07-10T16:11:10+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.10.0\n"
1515
"X-Domain: gravityforms\n"
@@ -8613,42 +8613,46 @@ msgstr ""
86138613
msgid "Price: "
86148614
msgstr ""
86158615

8616-
#: includes/fields/class-gf-field-captcha.php:37
8616+
#: includes/fields/class-gf-field-captcha.php:52
86178617
#: js.php:870
86188618
msgid "CAPTCHA"
86198619
msgstr ""
86208620

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

8625+
#: includes/fields/class-gf-field-captcha.php:115
8626+
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."
8627+
msgstr ""
8628+
86258629
#. Translators: 1. Opening <a> tag with link to the Forms > Settings > reCAPTCHA page. 2. closing <a> tag.
8626-
#: includes/fields/class-gf-field-captcha.php:95
8630+
#: includes/fields/class-gf-field-captcha.php:125
86278631
msgid "To use reCAPTCHA v2 you must configure the site and secret keys on the %1$sreCAPTCHA Settings%2$s page."
86288632
msgstr ""
86298633

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

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

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

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

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

8651-
#: includes/fields/class-gf-field-captcha.php:372
8655+
#: includes/fields/class-gf-field-captcha.php:435
86528656
msgid "An example of reCAPTCHA"
86538657
msgstr ""
86548658

0 commit comments

Comments
 (0)