Skip to content

Commit 134c47b

Browse files
author
Gravity Forms
committed
Updates to 2.9.21
1 parent 26175ae commit 134c47b

24 files changed

+863
-271
lines changed

assets/js/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.js' => array('version' => '268f6a3dd9b4cf0082f7980aa8ef906f', 'file' => 'admin-components.min.js'), 'libraries.min.js' => array('version' => 'ed8a7666c544ac15b91ded2ef2fd658f', 'file' => 'libraries.min.js'), 'react-utils.min.js' => array('version' => 'b096083749e2c3fabb85622059bcee22', 'file' => 'react-utils.min.js'), 'scripts-admin.min.js' => array('version' => '9c27ff1c929fe1b5784f1ed05be8a186', 'file' => 'scripts-admin.min.js'), 'scripts-theme.min.js' => array('version' => '8fa5e6390c795318e567cd2b080e169b', 'file' => 'scripts-theme.min.js'), 'utils.min.js' => array('version' => '380b7a5ec0757c78876bc8a59488f2f3', 'file' => 'utils.min.js'), 'vendor-admin.min.js' => array('version' => '7d3d04c83df035485594e5913fdd0c4f', 'file' => 'vendor-admin.min.js'), 'vendor-theme.min.js' => array('version' => '21e5a4db1670166692ac5745329bfc80', 'file' => 'vendor-theme.min.js')));
1+
<?php return array('hash_map' => array('admin-components.min.js' => array('version' => '268f6a3dd9b4cf0082f7980aa8ef906f', 'file' => 'admin-components.min.js'), 'libraries.min.js' => array('version' => 'ed8a7666c544ac15b91ded2ef2fd658f', 'file' => 'libraries.min.js'), 'react-utils.min.js' => array('version' => 'b096083749e2c3fabb85622059bcee22', 'file' => 'react-utils.min.js'), 'scripts-admin.min.js' => array('version' => '9c27ff1c929fe1b5784f1ed05be8a186', 'file' => 'scripts-admin.min.js'), 'scripts-theme.min.js' => array('version' => 'ea8a466a3fdf642558f016efd46a6aff', 'file' => 'scripts-theme.min.js'), 'utils.min.js' => array('version' => '380b7a5ec0757c78876bc8a59488f2f3', 'file' => 'utils.min.js'), 'vendor-admin.min.js' => array('version' => '7d3d04c83df035485594e5913fdd0c4f', 'file' => 'vendor-admin.min.js'), 'vendor-theme.min.js' => array('version' => '8673c9a2ff188de55f9073009ba56f5e', 'file' => 'vendor-theme.min.js')));
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('gform_gravityforms_utils', 'jquery', 'wp-polyfill'), 'version' => 'f7234e01fc1987efd5bd');
1+
<?php return array('dependencies' => array('gform_gravityforms_utils', 'jquery', 'wp-polyfill'), 'version' => '7bcd744b0d6fe5aee7fe');

assets/js/dist/scripts-theme.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array(), 'version' => 'f48a53be353699fb345e');
1+
<?php return array('dependencies' => array(), 'version' => 'fd4eff9dd235326c1ae7');

assets/js/dist/vendor-theme.min.js

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: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
### 2.9.21 | 2025-10-29
2+
- Added security enhancements.
3+
- Added a new setting to the Honeypot Field to check the time it takes to submit a form and mark the form as spam if the submission is too fast.
4+
- Updated account/license links to point to the new Gravity account site at [https://account.gravity.com/](https://account.gravity.com/).
5+
- Fixed Mailchimp capitalization in Survey Form template and elsewhere.
6+
- Fixed an issue that can cause the `gform_update_feed_active` action hook to fail if the hooked action calls $wpdb.
7+
- Fixed an issue where a page with multiple forms including file upload fields will retain and display submitted files from differing forms.
8+
- Fixed an issue with the timing of the multi-file upload handler sending the headers that prevents the Chained Selects field CSV upload completing.
9+
110
### 2.9.20 | 2025-10-16
211
- Added several performance improvements to the form editor by running large queries asynchronously.
312
- Added support for feed conditional logic based on payment status.
@@ -3193,7 +3202,7 @@ Description Filter which checks whether the operator is valid. Allows …)* filt
31933202
- AF: Added handling of the date_created merge tag to the get_field_value function for instances where this function is used before the entry has been created.
31943203
- AF: Added ability to set a limit on the number of fields that may be added for fields of type dynamic_field_map.
31953204
- AF: Added support for displaying validation errors set for fields created as type dynamic_field_map.
3196-
- AF: Change "get_field_value" to use "get_full_name" and "get_full_address" functions to prevent access level conflict with MailChimp Add-On.
3205+
- AF: Change "get_field_value" to use "get_full_name" and "get_full_address" functions to prevent access level conflict with Mailchimp Add-On.
31973206
- AF: Fixed a bug where an error would be thrown if the function plugin_settings_page was not included in the add-on.
31983207
- AF: Added the ability to exclude certain field types from field mapping in the get_field_map_choices function.
31993208
- AF: Added "get_field_value" helper function to get value of a selected field.
@@ -4405,7 +4414,7 @@ Description Use this filter to prevent the thousand separator being …)* filter
44054414
- AF: Added support for labels, tooltips and default values to text and textarea settings.
44064415
- AF: Added support for tooltips in checkbox choices.
44074416
- AF: Added settings_radio().
4408-
- AF: Moved some MailChimp specific functions back into MailChimp.
4417+
- AF: Moved some Mailchimp specific functions back into Mailchimp.
44094418
- Fixed issue with admin_title filter return false instead of original title when not on form settings page.
44104419

44114420

form_display.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,6 +1856,13 @@ public static function gform_footer( $form, $class, $ajax, $field_values, $previ
18561856
$unique_id = isset( self::$submission[ $form_id ] ) && rgar( self::$submission[ $form_id ], 'resuming_incomplete_submission' ) == true ? rgar( GFFormsModel::$unique_ids, $form_id ) : GFFormsModel::get_form_unique_id( $form_id );
18571857
$style_settings = $is_valid_json ? esc_attr( $style_settings ) : '';
18581858

1859+
/** @var Honeypot\GF_Honeypot_Handler $honeypot_handler */
1860+
$honeypot_handler = GFForms::get_service_container()->get( Honeypot\GF_Honeypot_Service_Provider::GF_HONEYPOT_HANDLER );
1861+
1862+
if ( $honeypot_handler->is_speed_check_enabled( $form ) ) {
1863+
$footer .= "<input type='hidden' class='gform_hidden' name='gform_submission_speeds' value='" . esc_attr( $honeypot_handler->get_submission_speeds_json( $form_id ) ) . "' />";
1864+
}
1865+
18591866
$footer .= "
18601867
<input type='hidden' class='gform_hidden' name='gform_submission_method' data-js='gform_submission_method_{$form_id}' value='" . self::get_submission_method( $submission_method ) . "' />
18611868
<input type='hidden' class='gform_hidden' name='gform_theme' data-js='gform_theme_{$form_id}' id='gform_theme_{$form_id}' value='" . esc_attr( $theme ) . "' />

form_settings.php

Lines changed: 110 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ public static function form_settings_ui() {
9797
* Prepare form settings fields.
9898
*
9999
* @since 2.5
100-
* @since 2.9.8 Updated honeypotAction default to spam.
100+
* @since 2.9.8 Updated honeypotAction default to spam.
101+
* @since 2.9.21 Moved the honeypot fields to a new spam section and added submission speed check fields.
101102
*
102103
* @param array $form Form being edited.
103104
*
@@ -106,8 +107,8 @@ public static function form_settings_ui() {
106107
public static function form_settings_fields( $form ) {
107108

108109
// Handles the deprecation notice for the confirmation ready classes in the CSS class field of form settings.
109-
$deprecated_confirmation_classes_field_notice = function( $value, $field ) use ( $form ) {
110-
if ( GFCommon::is_legacy_markup_enabled_og( $form ) ){
110+
$deprecated_confirmation_classes_field_notice = function ( $value, $field ) use ( $form ) {
111+
if ( GFCommon::is_legacy_markup_enabled_og( $form ) ) {
111112
return false;
112113
}
113114

@@ -135,7 +136,7 @@ public static function form_settings_fields( $form ) {
135136
};
136137

137138
$fields = array(
138-
'form_basics' => array(
139+
'form_basics' => array(
139140
'title' => esc_html__( 'Form Basics', 'gravityforms' ),
140141
'fields' => array(
141142
array(
@@ -144,11 +145,12 @@ public static function form_settings_fields( $form ) {
144145
'label' => esc_html__( 'Form Title', 'gravityforms' ),
145146
'tooltip' => gform_tooltip( 'form_title', '', true ),
146147
'required' => true,
147-
'validation_callback' => function( $field, $value ) use ( $form ) {
148+
'validation_callback' => function ( $field, $value ) use ( $form ) {
148149

149150
// If value is empty, set error.
150151
if ( rgblank( $value ) ) {
151152
$field->set_error( rgobj( $field, 'error_message' ) );
153+
152154
return;
153155
}
154156

@@ -187,7 +189,7 @@ public static function form_settings_fields( $form ) {
187189
),
188190
),
189191
),
190-
'form_layout' => array(
192+
'form_layout' => array(
191193
'title' => esc_html__( 'Form Layout', 'gravityforms' ),
192194
'fields' => array(
193195
array(
@@ -305,8 +307,8 @@ public static function form_settings_fields( $form ) {
305307
'label' => esc_html__( 'Custom Required Indicator', 'gravityforms' ),
306308
'default_value' => esc_html__( '(Required)', 'gravityforms' ),
307309
'dependency' => array(
308-
'live' => true,
309-
'fields' => array(
310+
'live' => true,
311+
'fields' => array(
310312
array(
311313
'field' => 'requiredIndicator',
312314
'values' => array( 'custom' ),
@@ -323,7 +325,7 @@ public static function form_settings_fields( $form ) {
323325
),
324326
),
325327
),
326-
'form_button' => array(
328+
'form_button' => array(
327329
'title' => esc_html__( 'Form Button', 'gravityforms' ),
328330
'fields' => array(
329331
array(
@@ -362,7 +364,7 @@ public static function form_settings_fields( $form ) {
362364
),
363365
),
364366
),
365-
'restrictions' => array(
367+
'restrictions' => array(
366368
'title' => esc_html__( 'Restrictions', 'gravityforms' ),
367369
'fields' => array(
368370
array(
@@ -537,13 +539,13 @@ public static function form_settings_fields( $form ) {
537539
),
538540
),
539541
),
540-
'form_options' => array(
541-
'title' => esc_html__( 'Form Options', 'gravityforms' ),
542+
'spam' => array(
543+
'title' => esc_html__( 'Spam Detection', 'gravityforms' ),
542544
'fields' => array(
543545
array(
544546
'name' => 'enableHoneypot',
545547
'type' => 'toggle',
546-
'label' => esc_html__( 'Anti-spam honeypot', 'gravityforms' ),
548+
'label' => esc_html__( 'Honeypot', 'gravityforms' ),
547549
'tooltip' => gform_tooltip( 'form_honeypot', '', true ),
548550
),
549551
array(
@@ -571,6 +573,78 @@ public static function form_settings_fields( $form ) {
571573
),
572574
),
573575
),
576+
array(
577+
'name' => 'enableSubmitSpeedCheck',
578+
'type' => 'toggle',
579+
'label' => esc_html__( 'Submission Speed Check', 'gravityforms' ),
580+
'description' => esc_html__( 'Flags the submission as spam if the elapsed time between page load and form submission is less than the threshold.', 'gravityforms' ),
581+
'default_value' => false,
582+
'dependency' => array(
583+
'live' => true,
584+
'fields' => array(
585+
array(
586+
'field' => 'enableHoneypot',
587+
),
588+
),
589+
),
590+
),
591+
array(
592+
'name' => 'submitSpeedCheckThreshold',
593+
'type' => 'text',
594+
'input_type' => 'number',
595+
'min' => 1,
596+
'default_value' => 2000,
597+
'label' => esc_html__( 'Submission Speed Check: Threshold (milliseconds)', 'gravityforms' ),
598+
'dependency' => array(
599+
'live' => true,
600+
'fields' => array(
601+
array(
602+
'field' => 'enableHoneypot',
603+
),
604+
array(
605+
'field' => 'enableSubmitSpeedCheck',
606+
),
607+
),
608+
),
609+
'validation_callback' => function ( $field, $value ) {
610+
if ( ! ctype_digit( $value ) || (int) $value < 1 ) {
611+
$field->set_error( esc_html__( 'Please enter a valid number greater than zero.', 'gravityforms' ) );
612+
}
613+
},
614+
),
615+
array(
616+
'name' => 'submitSpeedCheckMode',
617+
'type' => 'radio',
618+
'default_value' => 'normal',
619+
'label' => esc_html__( 'Submission Speed Check: Mode', 'gravityforms' ),
620+
'description' => esc_html__( 'Submission speed is captured for each page of a multi-page form and for each submission attempt after a validation error. If there are multiple submission speeds for one submission, which mode should be used to evaluate the submission?', 'gravityforms' ),
621+
'dependency' => array(
622+
'live' => true,
623+
'fields' => array(
624+
array(
625+
'field' => 'enableHoneypot',
626+
),
627+
array(
628+
'field' => 'enableSubmitSpeedCheck',
629+
),
630+
),
631+
),
632+
'choices' => array(
633+
array(
634+
'label' => esc_html__( 'Normal: at least one speed must be above the threshold.', 'gravityforms' ),
635+
'value' => 'normal',
636+
),
637+
array(
638+
'label' => esc_html__( 'Strict: all speeds must be above the threshold.', 'gravityforms' ),
639+
'value' => 'strict',
640+
),
641+
),
642+
),
643+
),
644+
),
645+
'form_options' => array(
646+
'title' => esc_html__( 'Form Options', 'gravityforms' ),
647+
'fields' => array(
574648
array(
575649
'name' => 'enableAnimation',
576650
'type' => 'toggle',
@@ -795,7 +869,8 @@ public static function deprecated_classes_warning( $form ) {
795869
* Initialize Plugin Settings fields renderer.
796870
*
797871
* @since 2.5
798-
* @since 2.9.8 Updated honeypotAction default to spam.
872+
* @since 2.9.8 Updated honeypotAction default to spam.
873+
* @since 2.9.21 Updated to save the submission speed check fields.
799874
*/
800875
public static function initialize_settings_renderer() {
801876

@@ -859,9 +934,27 @@ public static function initialize_settings_renderer() {
859934
$form['schedulePendingMessage'] = rgar( $values, 'schedulePendingMessage' );
860935
$form['scheduleMessage'] = rgar( $values, 'scheduleMessage' );
861936

862-
// Form Options
863-
$form['enableHoneypot'] = (bool) rgar( $values, 'enableHoneypot' );
864-
$form['honeypotAction'] = GFCommon::whitelist( rgar( $values, 'honeypotAction' ), array( 'spam', 'abort' ) );
937+
// Spam Detection.
938+
$form['enableHoneypot'] = (bool) rgar( $values, 'enableHoneypot' );
939+
$form['honeypotAction'] = GFCommon::whitelist(
940+
rgar( $values, 'honeypotAction' ),
941+
array(
942+
'spam',
943+
'abort',
944+
)
945+
);
946+
947+
$form['enableSubmitSpeedCheck'] = (bool) rgar( $values, 'enableSubmitSpeedCheck' );
948+
$form['submitSpeedCheckThreshold'] = absint( rgar( $values, 'submitSpeedCheckThreshold' ) );
949+
$form['submitSpeedCheckMode'] = GFCommon::whitelist(
950+
rgar( $values, 'submitSpeedCheckMode' ),
951+
array(
952+
'normal',
953+
'strict',
954+
)
955+
);
956+
957+
// Form Options.
865958
$form['enableAnimation'] = (bool) rgar( $values, 'enableAnimation' );
866959
$form['markupVersion'] = rgar( $values, 'markupVersion' ) ? 1 : 2;
867960

forms_model.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5487,7 +5487,14 @@ private static function copy_post_image( $url, $post_id ) {
54875487

54885488
// the source path
54895489
$upload_root_info = GF_Field_FileUpload::get_upload_root_info( $form_id );
5490-
$path = str_replace( $upload_root_info['url'], $upload_root_info['path'], $url );
5490+
if ( ! str_starts_with( $url, $upload_root_info['url'] ) ) {
5491+
return false;
5492+
}
5493+
5494+
$path = str_replace( $upload_root_info['url'], $upload_root_info['path'], $url );
5495+
if ( ! file_exists( $path ) ) {
5496+
return false;
5497+
}
54915498

54925499
// copy the file to the destination path
54935500
if ( ! copy( $path, $new_file ) ) {

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.9.20
6+
Version: 2.9.21
77
Requires at least: 6.5
88
Requires PHP: 7.4
99
Author: Gravity Forms
@@ -257,7 +257,7 @@ class GFForms {
257257
*
258258
* @var string $version The version number.
259259
*/
260-
public static $version = '2.9.20';
260+
public static $version = '2.9.21';
261261

262262
/**
263263
* Handles background upgrade tasks.
@@ -2698,7 +2698,7 @@ public static function get_status_messages( $plugin_name, $plugin_data, $slug =
26982698
/* translators: %1$s Plugin name %2$s and %3$s are link tag markup */
26992699
__( 'The %1$s is not available with the configured license; please visit the %2$sGravity Forms website%3$s to verify your license. ', 'gravityforms' ),
27002700
esc_html( rgar( $plugin_data, 'Name' ) ),
2701-
'<a href="https://www.gravityforms.com/my-account/licenses/?utm_source=gf-admin&utm_medium=purchase-link&utm_campaign=license-enforcement" target="_blank">',
2701+
'<a href="https://account.gravity.com/?utm_source=gf-admin&utm_medium=purchase-link&utm_campaign=license-enforcement" target="_blank">',
27022702
'<span class="screen-reader-text">' . esc_html__( '(opens in a new tab)', 'gravityforms' ) . '</span>&nbsp;<span class="gform-icon gform-icon--external-link" aria-hidden="true"></span></a>'
27032703
);
27042704
}

0 commit comments

Comments
 (0)