Formidable Forms – Form Builder for WordPress - Version 5.5.4

Version Description

  • New: Added support for hCaptcha. Now in Global Settings, the reCAPTCHA tab has been changed to a CAPTCHA tab with a new CAPTCHA type setting so you can choose between using reCAPTCHA or hCaptcha.
  • Fix: Avoid a fatal error if the hidden columns setting is in an unexpected format on the form and entry list pages. This may happen because of invalid option data being set or a conflict with another plugin or custom code.
  • Fix: Long field names on the reports tab would force the table to horizontally scroll. A long field name will now break into multiple lines instead.
  • Fix: The frm_form_object filter wouldn't get applied to a cached form result.
  • Fix: Prevent an undefined function get_editable_roles fatal error that triggers when trying to connect an account.
  • Fix: An incorrect section comparison was causing fields to keep old section data after being moved somewhere else. This would result in unexpected data exports and other side effects.
  • Fix: A "row is undefined" error would prevent merging multiple field groups together after the layout option was clicked.
  • Updated message styling on admin pages.
Download this release

Release Info

Developer sswells
Plugin Icon 128x128 Formidable Forms – Form Builder for WordPress
Version 5.5.4
Comparing to
See all releases

Code changes from version 5.5.3.1 to 5.5.4

classes/controllers/FrmEntriesController.php CHANGED
@@ -306,7 +306,18 @@ class FrmEntriesController {
306
  return apply_filters( 'frm_field_column_is_sortable', $is_sortable, $field );
307
  }
308
 
 
 
 
 
309
  public static function hidden_columns( $result ) {
 
 
 
 
 
 
 
310
  $form_id = FrmForm::get_current_form_id();
311
 
312
  $hidden = self::user_hidden_columns_for_form( $form_id, $result );
@@ -473,7 +484,7 @@ class FrmEntriesController {
473
 
474
  $message = '';
475
  if ( FrmEntry::destroy( $params['id'] ) ) {
476
- $message = __( 'Entry was Successfully Deleted', 'formidable' );
477
  }
478
 
479
  self::display_list( $message );
306
  return apply_filters( 'frm_field_column_is_sortable', $is_sortable, $field );
307
  }
308
 
309
+ /**
310
+ * @param mixed $result Option value from database for hidden columns in entries table.
311
+ * @return array
312
+ */
313
  public static function hidden_columns( $result ) {
314
+ if ( ! is_array( $result ) ) {
315
+ // Force an unexpected value to be an array.
316
+ // Since $result is a filtered option and gets saved to the database, it's possible it could be a string.
317
+ // Since this code expects an array it would break with a "Uncaught Error: [] operator not supported for strings" error.
318
+ $result = array();
319
+ }
320
+
321
  $form_id = FrmForm::get_current_form_id();
322
 
323
  $hidden = self::user_hidden_columns_for_form( $form_id, $result );
484
 
485
  $message = '';
486
  if ( FrmEntry::destroy( $params['id'] ) ) {
487
+ $message = __( 'Entry was successfully deleted', 'formidable' );
488
  }
489
 
490
  self::display_list( $message );
classes/controllers/FrmFormsController.php CHANGED
@@ -888,7 +888,15 @@ class FrmFormsController {
888
  );
889
  }
890
 
 
 
 
 
891
  public static function hidden_columns( $hidden_columns ) {
 
 
 
 
892
  $type = FrmAppHelper::get_simple_request(
893
  array(
894
  'param' => 'form_type',
@@ -2421,7 +2429,7 @@ class FrmFormsController {
2421
  }
2422
 
2423
  public static function defer_script_loading( $tag, $handle ) {
2424
- if ( 'recaptcha-api' == $handle && ! strpos( $tag, 'defer' ) ) {
2425
  $tag = str_replace( ' src', ' defer="defer" async="async" src', $tag );
2426
  }
2427
 
888
  );
889
  }
890
 
891
+ /**
892
+ * @param mixed $hidden_columns
893
+ * @return array
894
+ */
895
  public static function hidden_columns( $hidden_columns ) {
896
+ if ( ! is_array( $hidden_columns ) ) {
897
+ $hidden_columns = array();
898
+ }
899
+
900
  $type = FrmAppHelper::get_simple_request(
901
  array(
902
  'param' => 'form_type',
2429
  }
2430
 
2431
  public static function defer_script_loading( $tag, $handle ) {
2432
+ if ( 'captcha-api' == $handle && ! strpos( $tag, 'defer' ) ) {
2433
  $tag = str_replace( ' src', ' defer="defer" async="async" src', $tag );
2434
  }
2435
 
classes/controllers/FrmHooksController.php CHANGED
@@ -169,6 +169,9 @@ class FrmHooksController {
169
  add_action( 'admin_enqueue_scripts', 'FrmApplicationsController::dequeue_scripts', 15 );
170
  add_action( 'wp_ajax_frm_get_applications_data', 'FrmApplicationsController::get_applications_data' );
171
 
 
 
 
172
  FrmSMTPController::load_hooks();
173
  FrmWelcomeController::load_hooks();
174
  new FrmPluginSearch();
169
  add_action( 'admin_enqueue_scripts', 'FrmApplicationsController::dequeue_scripts', 15 );
170
  add_action( 'wp_ajax_frm_get_applications_data', 'FrmApplicationsController::get_applications_data' );
171
 
172
+ // CAPTCHA
173
+ add_filter( 'frm_setup_edit_field_vars', 'FrmFieldCaptcha::update_field_name' );
174
+
175
  FrmSMTPController::load_hooks();
176
  FrmWelcomeController::load_hooks();
177
  new FrmPluginSearch();
classes/controllers/FrmSettingsController.php CHANGED
@@ -51,10 +51,10 @@ class FrmSettingsController {
51
  'name' => __( 'Permissions', 'formidable' ),
52
  'icon' => 'frm_icon_font frm_lock_icon',
53
  ),
54
- 'recaptcha' => array(
55
  'class' => __CLASS__,
56
- 'function' => 'recaptcha_settings',
57
- 'name' => __( 'reCAPTCHA', 'formidable' ),
58
  'icon' => 'frm_icon_font frm_shield_check_icon',
59
  ),
60
  'white_label' => array(
@@ -180,11 +180,11 @@ class FrmSettingsController {
180
  /**
181
  * @since 4.0
182
  */
183
- public static function recaptcha_settings() {
184
  $frm_settings = FrmAppHelper::get_settings();
185
  $captcha_lang = FrmAppHelper::locales( 'captcha' );
186
 
187
- include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/recaptcha.php' );
188
  }
189
 
190
  /**
@@ -345,4 +345,12 @@ class FrmSettingsController {
345
 
346
  wp_send_json( $results );
347
  }
 
 
 
 
 
 
 
 
348
  }
51
  'name' => __( 'Permissions', 'formidable' ),
52
  'icon' => 'frm_icon_font frm_lock_icon',
53
  ),
54
+ 'captcha' => array(
55
  'class' => __CLASS__,
56
+ 'function' => 'captcha_settings',
57
+ 'name' => __( 'CAPTCHA', 'formidable' ),
58
  'icon' => 'frm_icon_font frm_shield_check_icon',
59
  ),
60
  'white_label' => array(
180
  /**
181
  * @since 4.0
182
  */
183
+ public static function captcha_settings() {
184
  $frm_settings = FrmAppHelper::get_settings();
185
  $captcha_lang = FrmAppHelper::locales( 'captcha' );
186
 
187
+ include( FrmAppHelper::plugin_path() . '/classes/views/frm-settings/captcha/captcha.php' );
188
  }
189
 
190
  /**
345
 
346
  wp_send_json( $results );
347
  }
348
+
349
+ /**
350
+ * @deprecated x.x use FrmSettingsController::captcha_settings().
351
+ */
352
+ public static function recaptcha_settings() {
353
+ _deprecated_function( __FUNCTION__, 'x.x', 'FrmSettingsController::captcha_settings()' );
354
+ self::captcha_settings();
355
+ }
356
  }
classes/helpers/FrmAppHelper.php CHANGED
@@ -16,7 +16,7 @@ class FrmAppHelper {
16
  /**
17
  * @since 2.0
18
  */
19
- public static $plug_version = '5.5.3.1';
20
 
21
  /**
22
  * @since 1.07.02
@@ -2950,7 +2950,7 @@ class FrmAppHelper {
2950
  $pro_version = FrmProDb::$plug_version;
2951
  $expired = FrmAddonsController::is_license_expired();
2952
  ?>
2953
- <div class="error frm_previous_install">
2954
  <?php
2955
  esc_html_e( 'You are running a version of Formidable Forms that may not be compatible with your version of Formidable Forms Pro.', 'formidable' );
2956
  if ( empty( $expired ) ) {
@@ -2991,7 +2991,7 @@ class FrmAppHelper {
2991
 
2992
  foreach ( $message as $m ) {
2993
  ?>
2994
- <div class="error frm_previous_install">
2995
  <?php echo esc_html( $m ); ?>
2996
  </div>
2997
  <?php
16
  /**
17
  * @since 2.0
18
  */
19
+ public static $plug_version = '5.5.4';
20
 
21
  /**
22
  * @since 1.07.02
2950
  $pro_version = FrmProDb::$plug_version;
2951
  $expired = FrmAddonsController::is_license_expired();
2952
  ?>
2953
+ <div class="frm-banner-alert frm_error_style frm_previous_install">
2954
  <?php
2955
  esc_html_e( 'You are running a version of Formidable Forms that may not be compatible with your version of Formidable Forms Pro.', 'formidable' );
2956
  if ( empty( $expired ) ) {
2991
 
2992
  foreach ( $message as $m ) {
2993
  ?>
2994
+ <div class="frm-banner-alert frm_error_style frm_previous_install">
2995
  <?php echo esc_html( $m ); ?>
2996
  </div>
2997
  <?php
classes/helpers/FrmFieldsHelper.php CHANGED
@@ -159,7 +159,7 @@ class FrmFieldsHelper {
159
  $field_array['blank'] = $frm_settings->blank_msg;
160
  }
161
 
162
- if ( '' == $field_array['invalid'] ) {
163
  if ( 'captcha' === $field->type ) {
164
  $field_array['invalid'] = $frm_settings->re_msg;
165
  } else {
159
  $field_array['blank'] = $frm_settings->blank_msg;
160
  }
161
 
162
+ if ( '' === $field_array['invalid'] ) {
163
  if ( 'captcha' === $field->type ) {
164
  $field_array['invalid'] = $frm_settings->re_msg;
165
  } else {
classes/models/FrmAddon.php CHANGED
@@ -251,6 +251,10 @@ class FrmAddon {
251
  protected function update_pro_capabilities() {
252
  global $wp_roles;
253
 
 
 
 
 
254
  $caps = FrmAppHelper::frm_capabilities( 'pro_only' );
255
  $roles = get_editable_roles();
256
  $settings = new FrmSettings();
251
  protected function update_pro_capabilities() {
252
  global $wp_roles;
253
 
254
+ if ( ! function_exists( 'get_editable_roles' ) ) {
255
+ require_once ABSPATH . 'wp-admin/includes/user.php';
256
+ }
257
+
258
  $caps = FrmAppHelper::frm_capabilities( 'pro_only' );
259
  $roles = get_editable_roles();
260
  $settings = new FrmSettings();
classes/models/FrmField.php CHANGED
@@ -9,6 +9,15 @@ class FrmField {
9
  public static $transient_size = 200;
10
 
11
  public static function field_selection() {
 
 
 
 
 
 
 
 
 
12
  $fields = array(
13
  'text' => array(
14
  'name' => __( 'Text', 'formidable' ),
@@ -63,7 +72,7 @@ class FrmField {
63
  'icon' => 'frm_icon_font frm_user_icon',
64
  ),
65
  'captcha' => array(
66
- 'name' => __( 'reCAPTCHA', 'formidable' ),
67
  'icon' => 'frm_icon_font frm_shield_check_icon',
68
  ),
69
  );
9
  public static $transient_size = 200;
10
 
11
  public static function field_selection() {
12
+ $frm_settings = FrmAppHelper::get_settings();
13
+ $active_captcha = $frm_settings->active_captcha;
14
+ if ( ! FrmFieldCaptcha::should_show_captcha() ) {
15
+ $captcha_name = 'CAPTCHA';
16
+ } elseif ( $active_captcha === 'recaptcha' ) {
17
+ $captcha_name = 'reCAPTCHA';
18
+ } else {
19
+ $captcha_name = 'hCaptcha';
20
+ }
21
  $fields = array(
22
  'text' => array(
23
  'name' => __( 'Text', 'formidable' ),
72
  'icon' => 'frm_icon_font frm_user_icon',
73
  ),
74
  'captcha' => array(
75
+ 'name' => $captcha_name,
76
  'icon' => 'frm_icon_font frm_shield_check_icon',
77
  ),
78
  );
classes/models/FrmFieldCaptchaSettings.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ die( 'You are not allowed to call this page directly.' );
4
+ }
5
+
6
+ /**
7
+ * @since x.x
8
+ */
9
+ class FrmFieldCaptchaSettings {
10
+
11
+ public $secret;
12
+
13
+ public $token_field;
14
+
15
+ public $end_point;
16
+
17
+ public function __construct( $frm_settings ) {
18
+ if ( $frm_settings->active_captcha === 'recaptcha' ) {
19
+ $this->secret = $frm_settings->privkey;
20
+ $this->token_field = 'g-recaptcha-response';
21
+ $this->endpoint = 'https://www.google.com/recaptcha/api/siteverify';
22
+ } else {
23
+ $this->secret = $frm_settings->hcaptcha_privkey;
24
+ $this->token_field = 'h-captcha-response';
25
+ $this->endpoint = 'https://hcaptcha.com/siteverify';
26
+ }
27
+ }
28
+ }
classes/models/FrmForm.php CHANGED
@@ -727,7 +727,7 @@ class FrmForm {
727
  FrmAppHelper::unserialize_or_decode( $cache->options );
728
  }
729
 
730
- return wp_unslash( $cache );
731
  }
732
  }
733
 
727
  FrmAppHelper::unserialize_or_decode( $cache->options );
728
  }
729
 
730
+ return apply_filters( 'frm_form_object', wp_unslash( $cache ) );
731
  }
732
  }
733
 
classes/models/FrmSettings.php CHANGED
@@ -27,6 +27,9 @@ class FrmSettings {
27
  public $load_style;
28
  public $custom_style;
29
 
 
 
 
30
  public $pubkey;
31
  public $privkey;
32
  public $re_lang;
@@ -116,7 +119,7 @@ class FrmSettings {
116
  }
117
 
118
  private function set_default_options() {
119
- $this->fill_recaptcha_settings();
120
 
121
  if ( ! isset( $this->load_style ) ) {
122
  if ( ! isset( $this->custom_style ) ) {
@@ -179,9 +182,17 @@ class FrmSettings {
179
  }
180
  }
181
 
182
- private function fill_recaptcha_settings() {
183
- $privkey = '';
184
- $re_lang = '';
 
 
 
 
 
 
 
 
185
 
186
  if ( ! isset( $this->pubkey ) ) {
187
  // get the options from the database
@@ -192,7 +203,7 @@ class FrmSettings {
192
  }
193
 
194
  if ( ! isset( $this->re_msg ) || empty( $this->re_msg ) ) {
195
- $this->re_msg = __( 'The reCAPTCHA was not entered correctly', 'formidable' );
196
  }
197
 
198
  if ( ! isset( $this->privkey ) ) {
@@ -267,12 +278,15 @@ class FrmSettings {
267
  }
268
 
269
  private function update_settings( $params ) {
270
- $this->pubkey = trim( $params['frm_pubkey'] );
271
- $this->privkey = $params['frm_privkey'];
272
- $this->re_type = $params['frm_re_type'];
273
- $this->re_lang = $params['frm_re_lang'];
274
- $this->re_threshold = floatval( $params['frm_re_threshold'] );
275
- $this->load_style = $params['frm_load_style'];
 
 
 
276
 
277
  $checkboxes = array( 'mu_menu', 're_multi', 'use_html', 'jquery_css', 'accordion_js', 'fade_form', 'no_ips', 'tracking', 'admin_bar' );
278
  foreach ( $checkboxes as $set ) {
27
  public $load_style;
28
  public $custom_style;
29
 
30
+ public $active_captcha;
31
+ public $hcaptcha_pubkey;
32
+ public $hcaptcha_privkey;
33
  public $pubkey;
34
  public $privkey;
35
  public $re_lang;
119
  }
120
 
121
  private function set_default_options() {
122
+ $this->fill_captcha_settings();
123
 
124
  if ( ! isset( $this->load_style ) ) {
125
  if ( ! isset( $this->custom_style ) ) {
182
  }
183
  }
184
 
185
+ private function fill_captcha_settings() {
186
+ if ( ! isset( $this->active_captcha ) ) {
187
+ $this->active_captcha = 'recaptcha';
188
+ }
189
+
190
+ $privkey = '';
191
+ $re_lang = '';
192
+
193
+ if ( ! isset( $this->hcaptcha_privkey ) ) {
194
+ $this->hcaptcha_privkey = '';
195
+ }
196
 
197
  if ( ! isset( $this->pubkey ) ) {
198
  // get the options from the database
203
  }
204
 
205
  if ( ! isset( $this->re_msg ) || empty( $this->re_msg ) ) {
206
+ $this->re_msg = __( 'The CAPTCHA was not entered correctly', 'formidable' );
207
  }
208
 
209
  if ( ! isset( $this->privkey ) ) {
278
  }
279
 
280
  private function update_settings( $params ) {
281
+ $this->active_captcha = $params['frm_active_captcha'];
282
+ $this->hcaptcha_pubkey = trim( $params['frm_hcaptcha_pubkey'] );
283
+ $this->hcaptcha_privkey = $params['frm_hcaptcha_privkey'];
284
+ $this->pubkey = trim( $params['frm_pubkey'] );
285
+ $this->privkey = $params['frm_privkey'];
286
+ $this->re_type = $params['frm_re_type'];
287
+ $this->re_lang = $params['frm_re_lang'];
288
+ $this->re_threshold = floatval( $params['frm_re_threshold'] );
289
+ $this->load_style = $params['frm_load_style'];
290
 
291
  $checkboxes = array( 'mu_menu', 're_multi', 'use_html', 'jquery_css', 'accordion_js', 'fade_form', 'no_ips', 'tracking', 'admin_bar' );
292
  foreach ( $checkboxes as $set ) {
classes/models/fields/FrmFieldCaptcha.php CHANGED
@@ -21,15 +21,34 @@ class FrmFieldCaptcha extends FrmFieldType {
21
  return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/field-captcha.php';
22
  }
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  /**
25
  * @return array
26
  */
27
  protected function field_settings_for_type() {
28
  return array(
29
- 'required' => false,
30
- 'invalid' => true,
31
- 'captcha_size' => true,
32
- 'default' => false,
33
  );
34
  }
35
 
@@ -64,21 +83,34 @@ class FrmFieldCaptcha extends FrmFieldType {
64
  * @return string
65
  */
66
  protected function before_replace_html_shortcodes( $args, $html ) {
67
- return str_replace( ' for="field_[key]"', ' for="g-recaptcha-response"', $html );
 
 
 
 
68
  }
69
 
70
  public function front_field_input( $args, $shortcode_atts ) {
71
  $frm_settings = FrmAppHelper::get_settings();
72
- if ( empty( $frm_settings->pubkey ) ) {
73
  return '';
74
  }
75
 
76
- $class_prefix = $this->class_prefix();
77
- $captcha_size = $this->captcha_size();
 
78
  $allow_mutiple = $frm_settings->re_multi;
79
 
80
- $html = '<div id="' . esc_attr( $args['html_id'] ) . '" class="' . esc_attr( $class_prefix ) . 'g-recaptcha" data-sitekey="' . esc_attr( $frm_settings->pubkey ) . '" data-size="' . esc_attr( $captcha_size ) . '" data-theme="' . esc_attr( $this->field['captcha_theme'] ) . '"';
81
- if ( $captcha_size == 'invisible' && ! $allow_mutiple ) {
 
 
 
 
 
 
 
 
82
  $html .= ' data-callback="frmAfterRecaptcha"';
83
  }
84
  $html .= '></div>';
@@ -89,14 +121,22 @@ class FrmFieldCaptcha extends FrmFieldType {
89
  protected function load_field_scripts( $args ) {
90
  $api_js_url = $this->api_url();
91
 
92
- wp_register_script( 'recaptcha-api', $api_js_url, array( 'formidable' ), '3', true );
93
- wp_enqueue_script( 'recaptcha-api' );
94
  }
95
 
96
  protected function api_url() {
 
 
 
 
 
 
 
 
 
97
  $api_js_url = 'https://www.google.com/recaptcha/api.js?';
98
 
99
- $frm_settings = FrmAppHelper::get_settings();
100
  $allow_mutiple = $frm_settings->re_multi;
101
  if ( $allow_mutiple ) {
102
  $api_js_url .= '&onload=frmRecaptcha&render=explicit';
@@ -107,11 +147,28 @@ class FrmFieldCaptcha extends FrmFieldType {
107
  $api_js_url .= '&hl=' . $lang;
108
  }
109
 
110
- return apply_filters( 'frm_recaptcha_js_url', $api_js_url );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  }
112
 
113
- protected function class_prefix() {
114
- if ( $this->allow_multiple() ) {
115
  $class_prefix = 'frm-';
116
  } else {
117
  $class_prefix = '';
@@ -120,17 +177,18 @@ class FrmFieldCaptcha extends FrmFieldType {
120
  return $class_prefix;
121
  }
122
 
123
- protected function allow_multiple() {
124
- $frm_settings = FrmAppHelper::get_settings();
 
125
 
 
126
  return $frm_settings->re_multi;
127
  }
128
 
129
  /**
130
  * @return string
131
  */
132
- protected function captcha_size() {
133
- $frm_settings = FrmAppHelper::get_settings();
134
  if ( in_array( $frm_settings->re_type, array( 'invisible', 'v3' ), true ) ) {
135
  return 'invisible';
136
  }
@@ -151,7 +209,7 @@ class FrmFieldCaptcha extends FrmFieldType {
151
 
152
  if ( is_wp_error( $resp ) ) {
153
  $error_string = $resp->get_error_message();
154
- $errors[ 'field' . $args['id'] ] = __( 'There was a problem verifying your recaptcha', 'formidable' );
155
  $errors[ 'field' . $args['id'] ] .= ' ' . $error_string;
156
  return $errors;
157
  }
@@ -160,21 +218,26 @@ class FrmFieldCaptcha extends FrmFieldType {
160
  return $errors;
161
  }
162
 
163
- if ( 'v3' === $frm_settings->re_type && array_key_exists( 'score', $response ) ) {
164
- $threshold = floatval( $frm_settings->re_threshold );
165
- $score = floatval( $response['score'] );
 
166
 
167
- $this->set_score( $score );
168
 
169
- if ( $score < $threshold ) {
170
- $response['success'] = false;
 
171
  }
172
  }
173
 
174
  if ( isset( $response['success'] ) && ! $response['success'] ) {
175
  // What happens when the CAPTCHA was entered incorrectly
176
- $invalid_message = FrmField::get_option( $this->field, 'invalid' );
177
- $errors[ 'field' . $args['id'] ] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message );
 
 
 
178
  }
179
 
180
  return $errors;
@@ -205,7 +268,7 @@ class FrmFieldCaptcha extends FrmFieldType {
205
  }
206
 
207
  // phpcs:ignore WordPress.Security.NonceVerification.Missing
208
- if ( ! isset( $_POST['g-recaptcha-response'] ) ) {
209
  // There was no captcha submitted.
210
  return array( 'field' . $args['id'] => __( 'The captcha is missing from this form', 'formidable' ) );
211
  }
@@ -217,9 +280,13 @@ class FrmFieldCaptcha extends FrmFieldType {
217
  * @since 4.07
218
  * @return bool
219
  */
220
- private function should_show_captcha() {
221
  $frm_settings = FrmAppHelper::get_settings();
222
- return ! empty( $frm_settings->pubkey );
 
 
 
 
223
  }
224
 
225
  protected function should_validate() {
@@ -229,18 +296,40 @@ class FrmFieldCaptcha extends FrmFieldType {
229
  }
230
 
231
  // don't require the captcha if it shouldn't be shown
232
- return $this->should_show_captcha();
233
  }
234
 
235
  protected function send_api_check( $frm_settings ) {
 
 
236
  $arg_array = array(
237
  'body' => array(
238
- 'secret' => $frm_settings->privkey,
239
- 'response' => FrmAppHelper::get_param( 'g-recaptcha-response', '', 'post', 'sanitize_text_field' ),
240
  'remoteip' => FrmAppHelper::get_ip_address(),
241
  ),
242
  );
243
 
244
- return wp_remote_post( 'https://www.google.com/recaptcha/api/siteverify', $arg_array );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
  }
246
  }
21
  return FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/field-captcha.php';
22
  }
23
 
24
+ /**
25
+ * Returns the image name for a captcha.
26
+ *
27
+ * @return string
28
+ */
29
+ public static function get_captcha_image_name() {
30
+ $frm_settings = FrmAppHelper::get_settings();
31
+ $active_captcha = $frm_settings->active_captcha;
32
+ if ( ! self::should_show_captcha() ) {
33
+ $image_name = 'captcha_not_setup';
34
+ } elseif ( $active_captcha === 'recaptcha' && $frm_settings->re_type === 'v3' ) {
35
+ $image_name = 'recaptcha_v3';
36
+ } else {
37
+ $image_name = $active_captcha;
38
+ }
39
+
40
+ return $image_name;
41
+ }
42
+
43
  /**
44
  * @return array
45
  */
46
  protected function field_settings_for_type() {
47
  return array(
48
+ 'required' => false,
49
+ 'invalid' => true,
50
+ 'captcha_size' => true,
51
+ 'default' => false,
52
  );
53
  }
54
 
83
  * @return string
84
  */
85
  protected function before_replace_html_shortcodes( $args, $html ) {
86
+ $frm_settings = FrmAppHelper::get_settings();
87
+ $replace_response = $frm_settings->active_captcha === 'recaptcha' ? 'g-recaptcha-response' : 'h-captcha-response';
88
+ $replaced_for = str_replace( ' for="field_[key]"', ' for="' . $replace_response . '"', $html );
89
+
90
+ return $replaced_for;
91
  }
92
 
93
  public function front_field_input( $args, $shortcode_atts ) {
94
  $frm_settings = FrmAppHelper::get_settings();
95
+ if ( ! self::should_show_captcha() ) {
96
  return '';
97
  }
98
 
99
+ $class_prefix = $this->class_prefix( $frm_settings );
100
+ $captcha_class = $this->captcha_class( $frm_settings );
101
+ $captcha_size = $this->captcha_size( $frm_settings );
102
  $allow_mutiple = $frm_settings->re_multi;
103
 
104
+ if ( $frm_settings->active_captcha === 'recaptcha' ) {
105
+ $site_key = $frm_settings->pubkey;
106
+ $recaptcha_options = '" data-size="' . esc_attr( $captcha_size ) . '" data-theme="' . esc_attr( $this->field['captcha_theme'] ) . '"';
107
+ } else {
108
+ $site_key = $frm_settings->hcaptcha_pubkey;
109
+ }
110
+
111
+ $html = '<div id="' . esc_attr( $args['html_id'] ) . '" class="' . esc_attr( $class_prefix ) . $captcha_class . '" data-sitekey="' . esc_attr( $site_key ) . '"';
112
+ $html .= ! empty( $recaptcha_options ) ? $recaptcha_options : '';
113
+ if ( $captcha_size === 'invisible' && ! $allow_mutiple ) {
114
  $html .= ' data-callback="frmAfterRecaptcha"';
115
  }
116
  $html .= '></div>';
121
  protected function load_field_scripts( $args ) {
122
  $api_js_url = $this->api_url();
123
 
124
+ wp_register_script( 'captcha-api', $api_js_url, array( 'formidable' ), '3', true );
125
+ wp_enqueue_script( 'captcha-api' );
126
  }
127
 
128
  protected function api_url() {
129
+ $frm_settings = FrmAppHelper::get_settings();
130
+ if ( $frm_settings->active_captcha === 'recaptcha' ) {
131
+ return $this->recaptcha_api_url( $frm_settings );
132
+ }
133
+
134
+ return $this->hcaptcha_api_url();
135
+ }
136
+
137
+ protected function recaptcha_api_url( $frm_settings ) {
138
  $api_js_url = 'https://www.google.com/recaptcha/api.js?';
139
 
 
140
  $allow_mutiple = $frm_settings->re_multi;
141
  if ( $allow_mutiple ) {
142
  $api_js_url .= '&onload=frmRecaptcha&render=explicit';
147
  $api_js_url .= '&hl=' . $lang;
148
  }
149
 
150
+ $api_js_url = apply_filters( 'frm_recaptcha_js_url', $api_js_url );
151
+
152
+ return $api_js_url;
153
+ }
154
+
155
+ protected function hcaptcha_api_url() {
156
+ $api_js_url = 'https://js.hcaptcha.com/1/api.js';
157
+
158
+ /**
159
+ * Allows updating hcaptcha js api url.
160
+ *
161
+ * @since x.x
162
+ *
163
+ * @param string $api_js_url
164
+ */
165
+ $api_js_url = apply_filters( 'frm_hcaptcha_js_url', $api_js_url );
166
+
167
+ return $api_js_url;
168
  }
169
 
170
+ protected function class_prefix( $frm_settings ) {
171
+ if ( $this->allow_multiple( $frm_settings ) && $frm_settings->active_captcha === 'recaptcha' ) {
172
  $class_prefix = 'frm-';
173
  } else {
174
  $class_prefix = '';
177
  return $class_prefix;
178
  }
179
 
180
+ protected function captcha_class( $frm_settings ) {
181
+ return $frm_settings->active_captcha === 'recaptcha' ? 'g-recaptcha' : 'h-captcha';
182
+ }
183
 
184
+ protected function allow_multiple( $frm_settings ) {
185
  return $frm_settings->re_multi;
186
  }
187
 
188
  /**
189
  * @return string
190
  */
191
+ protected function captcha_size( $frm_settings ) {
 
192
  if ( in_array( $frm_settings->re_type, array( 'invisible', 'v3' ), true ) ) {
193
  return 'invisible';
194
  }
209
 
210
  if ( is_wp_error( $resp ) ) {
211
  $error_string = $resp->get_error_message();
212
+ $errors[ 'field' . $args['id'] ] = __( 'There was a problem verifying your captcha', 'formidable' );
213
  $errors[ 'field' . $args['id'] ] .= ' ' . $error_string;
214
  return $errors;
215
  }
218
  return $errors;
219
  }
220
 
221
+ if ( $frm_settings->active_captcha === 'recaptcha' ) {
222
+ if ( 'v3' === $frm_settings->re_type && array_key_exists( 'score', $response ) ) {
223
+ $threshold = floatval( $frm_settings->re_threshold );
224
+ $score = floatval( $response['score'] );
225
 
226
+ $this->set_score( $score );
227
 
228
+ if ( $score < $threshold ) {
229
+ $response['success'] = false;
230
+ }
231
  }
232
  }
233
 
234
  if ( isset( $response['success'] ) && ! $response['success'] ) {
235
  // What happens when the CAPTCHA was entered incorrectly
236
+ $invalid_message = FrmField::get_option( $this->field, 'invalid' );
237
+ if ( $invalid_message === __( 'The reCAPTCHA was not entered correctly', 'formidable' ) ) {
238
+ $invalid_message = '';
239
+ }
240
+ $errors[ 'field' . $args['id'] ] = ( $invalid_message === '' ? $frm_settings->re_msg : $invalid_message );
241
  }
242
 
243
  return $errors;
268
  }
269
 
270
  // phpcs:ignore WordPress.Security.NonceVerification.Missing
271
+ if ( ! isset( $_POST['g-recaptcha-response'] ) && ! isset( $_POST['h-captcha-response'] ) ) {
272
  // There was no captcha submitted.
273
  return array( 'field' . $args['id'] => __( 'The captcha is missing from this form', 'formidable' ) );
274
  }
280
  * @since 4.07
281
  * @return bool
282
  */
283
+ public static function should_show_captcha() {
284
  $frm_settings = FrmAppHelper::get_settings();
285
+ if ( $frm_settings->active_captcha === 'recaptcha' ) {
286
+ return ! empty( $frm_settings->pubkey );
287
+ }
288
+
289
+ return ! empty( $frm_settings->hcaptcha_pubkey );
290
  }
291
 
292
  protected function should_validate() {
296
  }
297
 
298
  // don't require the captcha if it shouldn't be shown
299
+ return self::should_show_captcha();
300
  }
301
 
302
  protected function send_api_check( $frm_settings ) {
303
+ $captcha_settings = new FrmFieldCaptchaSettings( $frm_settings );
304
+
305
  $arg_array = array(
306
  'body' => array(
307
+ 'secret' => $captcha_settings->secret,
308
+ 'response' => FrmAppHelper::get_param( $captcha_settings->token_field, '', 'post', 'sanitize_text_field' ),
309
  'remoteip' => FrmAppHelper::get_ip_address(),
310
  ),
311
  );
312
 
313
+ return wp_remote_post( $captcha_settings->endpoint, $arg_array );
314
+ }
315
+
316
+ /**
317
+ * Updates field name in page builder to the currently activated captcha if it is set to the default.
318
+ *
319
+ * @since x.x
320
+ *
321
+ * @param array $values
322
+ *
323
+ * @return array $values
324
+ */
325
+ public static function update_field_name( $values ) {
326
+ if ( $values['type'] === 'captcha' ) {
327
+ $name = $values['name'];
328
+ if ( in_array( $name, array( __( 'reCAPTCHA', 'formidable' ), __( 'hCaptcha', 'formidable' ) ), true ) ) {
329
+ $values['name'] = __( 'CAPTCHA', 'formidable' );
330
+ }
331
+ }
332
+
333
+ return $values;
334
  }
335
  }
classes/views/frm-fields/back-end/field-captcha.php CHANGED
@@ -3,13 +3,7 @@ if ( ! defined( 'ABSPATH' ) ) {
3
  die( 'You are not allowed to call this page directly.' );
4
  }
5
 
6
- $frm_settings = FrmAppHelper::get_settings();
7
- if ( empty( $frm_settings->pubkey ) ) {
8
- ?>
9
- <div class="howto frm_no_captcha_text"><?php
10
- /* translators: %1$s: Link HTML, %2$s: End link */
11
- printf( esc_html__( 'Your captcha will not appear on your form until you %1$sset up%2$s the Site and Secret Keys', 'formidable' ), '<a href="?page=formidable-settings" target="_blank">', '</a>' );
12
- ?></div>
13
- <?php } ?>
14
- <img src="<?php echo esc_url( FrmAppHelper::plugin_url() . '/images/recaptcha.png' ); ?>" class="recaptcha_placeholder" alt="reCaptcha"/>
15
  <input type="hidden" name="<?php echo esc_attr( $field_name ); ?>" value="1" />
3
  die( 'You are not allowed to call this page directly.' );
4
  }
5
 
6
+ $image_name = FrmFieldCaptcha::get_captcha_image_name();
7
+ ?>
8
+ <img src="<?php echo esc_url( FrmAppHelper::plugin_url() . '/images/' . $image_name . '.png' ); ?>" class="<?php echo esc_attr( $image_name ); ?>_placeholder" alt="<?php echo esc_attr( $image_name ); ?>"/>
 
 
 
 
 
 
9
  <input type="hidden" name="<?php echo esc_attr( $field_name ); ?>" value="1" />
classes/views/frm-fields/back-end/settings.php CHANGED
@@ -21,6 +21,21 @@ if ( ! defined( 'ABSPATH' ) ) {
21
  </h3>
22
 
23
  <div class="frm_grid_container frm-collapse-me">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  <?php if ( $display['label'] ) { ?>
25
  <p>
26
  <label for="frm_name_<?php echo esc_attr( $field['id'] ); ?>">
@@ -226,7 +241,7 @@ do_action( 'frm_before_field_options', $field, compact( 'field_obj', 'display',
226
  </p>
227
  <?php } ?>
228
 
229
- <?php if ( $display['captcha_size'] && $frm_settings->re_type !== 'invisible' ) { ?>
230
  <p class="frm6 frm_first frm_form_field">
231
  <label for="field_options_captcha_size_<?php echo esc_attr( $field['id'] ); ?>" class="frm_help" title="<?php esc_attr_e( 'Set the size of the captcha field. The compact option is best if your form is in a small area.', 'formidable' ); ?>">
232
  <?php esc_html_e( 'ReCaptcha Type', 'formidable' ); ?>
21
  </h3>
22
 
23
  <div class="frm_grid_container frm-collapse-me">
24
+ <?php
25
+ if ( $field['type'] === 'captcha' && ! FrmFieldCaptcha::should_show_captcha() ) {
26
+ ?>
27
+ <div class="frm_builder_captcha frm_warning_style">
28
+ <?php FrmAppHelper::icon_by_class( 'frm_icon_font frm_alert_icon' ); ?>
29
+ <div><b><?php echo esc_html__( 'Setup a captcha', 'formidable' ); ?></b>
30
+ <p>
31
+ <?php
32
+ /* translators: %1$s: Link HTML, %2$s: End link */
33
+ printf( esc_html__( 'Your captcha will not appear on your form until you %1$sset up%2$s the Site and Secret Keys', 'formidable' ), '<a href="?page=formidable-settings" target="_blank">', '</a>' );
34
+ ?>
35
+ </p>
36
+ </div>
37
+ </div>
38
+ <?php } ?>
39
  <?php if ( $display['label'] ) { ?>
40
  <p>
41
  <label for="frm_name_<?php echo esc_attr( $field['id'] ); ?>">
241
  </p>
242
  <?php } ?>
243
 
244
+ <?php if ( $display['captcha_size'] && $frm_settings->re_type !== 'invisible' && $frm_settings->active_captcha === 'recaptcha' ) { ?>
245
  <p class="frm6 frm_first frm_form_field">
246
  <label for="field_options_captcha_size_<?php echo esc_attr( $field['id'] ); ?>" class="frm_help" title="<?php esc_attr_e( 'Set the size of the captcha field. The compact option is best if your form is in a small area.', 'formidable' ); ?>">
247
  <?php esc_html_e( 'ReCaptcha Type', 'formidable' ); ?>
classes/views/frm-settings/captcha/captcha.php ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ die( 'You are not allowed to call this page directly.' );
4
+ }
5
+ ?>
6
+ <p class="howto">
7
+ <?php
8
+ esc_html_e( 'Captcha will help you to avoid gathering automatically generated responses', 'formidable' );
9
+ ?>
10
+ </p>
11
+ <?php
12
+ $active_captcha = $frm_settings->active_captcha;
13
+ $recaptcha_is_active = $active_captcha === 'recaptcha';
14
+ ?>
15
+ <h4><?php esc_html_e( 'Select captcha type', 'formidable' ); ?></h4>
16
+ <div class="frm_captchas">
17
+ <div class="frm_radio">
18
+ <div class="captcha_option <?php echo esc_attr( $recaptcha_is_active ? 'active' : '' ); ?>">
19
+ <input type="radio" name="frm_active_captcha" id="recaptcha" value="recaptcha" <?php checked( $frm_settings->active_captcha, 'recaptcha' ); ?> />
20
+ <label for="recaptcha">
21
+ <?php
22
+ FrmAppHelper::icon_by_class( 'frmfont frm_recaptcha' );
23
+ ?>
24
+ <p><?php echo esc_html_e( 'reCAPTCHA', 'formidable' ); ?></p>
25
+ </label>
26
+ </div>
27
+ <div class="captcha_option <?php echo esc_attr( $recaptcha_is_active ? '' : 'active' ); ?>">
28
+ <input type="radio" name="frm_active_captcha" id="hcaptcha" value="hcaptcha" <?php checked( $frm_settings->active_captcha, 'hcaptcha' ); ?> />
29
+ <label for="hcaptcha">
30
+ <?php
31
+ FrmAppHelper::icon_by_class( 'frmfont frm_hcaptcha' );
32
+ ?>
33
+ <p><?php echo esc_html_e( 'hCaptcha', 'formidable' ); ?></p>
34
+ </label>
35
+ </div>
36
+ </div>
37
+ </div>
38
+
39
+ <div class="alert frm_hidden">
40
+ <?php FrmAppHelper::icon_by_class( 'frm_icon_font frm_tooltip_icon' ); ?>
41
+ <span><?php esc_html_e( 'Changing the captcha type here will replace it in all any forms where it is used.', 'formidable' ); ?></span>
42
+ </div>
43
+
44
+ <div id="recaptcha_settings" class="frm_grid_container <?php echo esc_attr( $recaptcha_is_active ? '' : 'frm_hidden' ); ?>">
45
+ <h3><?php esc_html_e( 'reCAPTCHA Settings', 'formidable' ); ?></h3>
46
+ <?php
47
+ $captcha = 'recaptcha';
48
+ require FrmAppHelper::plugin_path() . '/classes/views/frm-settings/captcha/captcha_keys.php';
49
+ ?>
50
+
51
+ <p class="frm6 frm_form_field">
52
+ <label for="frm_re_type">
53
+ <?php esc_html_e( 'reCAPTCHA Type', 'formidable' ); ?>
54
+ </label>
55
+ <select name="frm_re_type" id="frm_re_type">
56
+ <option value="" <?php selected( $frm_settings->re_type, '' ); ?>>
57
+ <?php esc_html_e( 'Checkbox (V2)', 'formidable' ); ?>
58
+ </option>
59
+ <option value="invisible" <?php selected( $frm_settings->re_type, 'invisible' ); ?>>
60
+ <?php esc_html_e( 'Invisible', 'formidable' ); ?>
61
+ </option>
62
+ <option value="v3" <?php selected( $frm_settings->re_type, 'v3' ); ?>>
63
+ <?php esc_html_e( 'v3', 'formidable' ); ?>
64
+ </option>
65
+ </select>
66
+ </p>
67
+
68
+ <p class="frm6 frm_form_field">
69
+ <label for="frm_re_lang">
70
+ <?php esc_html_e( 'reCAPTCHA Language', 'formidable' ); ?>
71
+ </label>
72
+ <select name="frm_re_lang" id="frm_re_lang">
73
+ <option value="" <?php selected( $frm_settings->re_lang, '' ); ?>>
74
+ <?php esc_html_e( 'Browser Default', 'formidable' ); ?>
75
+ </option>
76
+ <?php foreach ( $captcha_lang as $lang => $lang_name ) { ?>
77
+ <option value="<?php echo esc_attr( $lang ); ?>" <?php selected( $frm_settings->re_lang, $lang ); ?>>
78
+ <?php echo esc_html( $lang_name ); ?>
79
+ </option>
80
+ <?php } ?>
81
+ </select>
82
+ </p>
83
+
84
+ <p id="frm_captcha_threshold_container" class="frm6 frm_form_field <?php echo 'v3' === $frm_settings->re_type ? '' : 'frm_hidden'; ?>">
85
+ <label for="frm_re_type">
86
+ <?php esc_html_e( 'reCAPTCHA Threshold', 'formidable' ); ?>
87
+ <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'A score of 0 is likely to be a bot and a score of 1 is likely not a bot. Setting a lower threshold will allow more bots, but it will also stop fewer real users.', 'formidable' ); ?>"></span>
88
+ </label>
89
+ <span style="vertical-align:top;">0</span>
90
+ <input name="frm_re_threshold" id="frm_re_threshold" type="range" step="0.1" max="1" min="0" value="<?php echo esc_attr( $frm_settings->re_threshold ); ?>" />
91
+ <span style="vertical-align:top;">1</span>
92
+ </p>
93
+
94
+ <p>
95
+ <label for="frm_re_multi">
96
+ <input type="checkbox" name="frm_re_multi" id="frm_re_multi"
97
+ value="1" <?php checked( $frm_settings->re_multi, 1 ); ?> />
98
+ <?php esc_html_e( 'Allow multiple reCAPTCHAs to be used on a single page', 'formidable' ); ?>
99
+ </label>
100
+ </p>
101
+ </div>
102
+
103
+ <div id="hcaptcha_settings" class="frm_grid_container <?php echo esc_attr( $recaptcha_is_active ? 'frm_hidden' : '' ); ?>">
104
+ <h3><?php esc_html_e( 'hCaptcha Settings', 'formidable' ); ?></h3>
105
+ <?php
106
+ $captcha = 'hcaptcha';
107
+ require FrmAppHelper::plugin_path() . '/classes/views/frm-settings/captcha/captcha_keys.php';
108
+ ?>
109
+ </div>
classes/views/frm-settings/captcha/captcha_keys.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ die( 'You are not allowed to call this page directly.' );
4
+ }
5
+ ?>
6
+
7
+ <p class="howto">
8
+ <?php
9
+ $captcha_name = $captcha === 'recaptcha' ? 'reCAPTCHA' : 'hCaptcha';
10
+ if ( $captcha === 'recaptcha' ) {
11
+ $captcha_name = 'reCAPTCHA';
12
+ $captcha_api = 'https://www.google.com/recaptcha/';
13
+ } else {
14
+ $captcha_name = 'hCaptcha';
15
+ $captcha_api = 'https://www.hcaptcha.com/signup-interstitial';
16
+ }
17
+ printf(
18
+ /* translators: %1$s: Captcha name, %2$s: Start link HTML, %3$s: End link HTML */
19
+ esc_html__( '%1$s requires a Site and Private API key. Sign up for a %2$sfree %1$s key%3$s.', 'formidable' ),
20
+ esc_html( $captcha_name ),
21
+ '<a href="' . esc_url( $captcha_api ) . '" target="_blank">',
22
+ '</a>'
23
+ );
24
+ ?>
25
+ </p>
26
+ <?php
27
+ if ( $captcha === 'recaptcha' ) {
28
+ $prefix = '';
29
+ $title = __( 'reCAPTCHA is a free, accessible CAPTCHA service that helps to digitize books while blocking spam on your blog. reCAPTCHA asks commenters to retype two words scanned from a book to prove that they are a human. This verifies that they are not a spambot.', 'formidable' );
30
+ } else {
31
+ $prefix = 'hcaptcha_';
32
+ $title = __( 'hCaptcha is an anti-bot solution that protects user privacy and rewards websites. It is a privacy-focused drop-in replacement for reCAPTCHA.', 'formidable' );
33
+ }
34
+ ?>
35
+ <p class="frm6 frm_form_field">
36
+ <label class="frm_help" for="frm_<?php echo esc_attr( $prefix ); ?>pubkey" title="<?php echo esc_attr( $title ); ?>">
37
+ <?php esc_html_e( 'Site Key', 'formidable' ); ?>
38
+ </label>
39
+ <input type="text" name="frm_<?php echo esc_html( $prefix ); ?>pubkey" id="frm_<?php echo esc_html( $prefix ); ?>pubkey" size="42" value="<?php echo esc_attr( $frm_settings->{$prefix . 'pubkey'} ); ?>" />
40
+ </p>
41
+
42
+ <p class="frm6 frm_form_field">
43
+ <label for="frm_<?php echo esc_attr( $prefix ); ?>privkey">
44
+ <?php esc_html_e( 'Secret Key', 'formidable' ); ?>
45
+ </label>
46
+ <input type="text" name="frm_<?php echo esc_html( $prefix ); ?>privkey" id="frm_<?php echo esc_html( $prefix ); ?>privkey" size="42" value="<?php echo esc_attr( $frm_settings->{$prefix . 'privkey'} ); ?>" />
47
+ </p>
classes/views/frm-settings/recaptcha.php CHANGED
@@ -2,81 +2,7 @@
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  die( 'You are not allowed to call this page directly.' );
4
  }
5
- ?>
6
- <p class="howto">
7
- <?php
8
- printf(
9
- /* translators: %1$s: Start link HTML, %2$s: End link HTML */
10
- esc_html__( 'reCAPTCHA requires a Site and Private API key. Sign up for a %1$sfree reCAPTCHA key%2$s.', 'formidable' ),
11
- '<a href="' . esc_url( 'https://www.google.com/recaptcha/' ) . '" target="_blank">',
12
- '</a>'
13
- );
14
- ?>
15
- </p>
16
 
17
- <div class="frm_grid_container">
18
- <p class="frm6 frm_form_field">
19
- <label class="frm_help" for="frm_pubkey" title="<?php esc_attr_e( 'reCAPTCHA is a free, accessible CAPTCHA service that helps to digitize books while blocking spam on your blog. reCAPTCHA asks commenters to retype two words scanned from a book to prove that they are a human. This verifies that they are not a spambot.', 'formidable' ); ?>">
20
- <?php esc_html_e( 'Site Key', 'formidable' ); ?>
21
- </label>
22
- <input type="text" name="frm_pubkey" id="frm_pubkey" size="42" value="<?php echo esc_attr( $frm_settings->pubkey ); ?>" />
23
- </p>
24
 
25
- <p class="frm6 frm_form_field">
26
- <label for="frm_privkey">
27
- <?php esc_html_e( 'Secret Key', 'formidable' ); ?>
28
- </label>
29
- <input type="text" name="frm_privkey" id="frm_privkey" size="42" value="<?php echo esc_attr( $frm_settings->privkey ); ?>" />
30
- </p>
31
-
32
- <p class="frm6 frm_form_field">
33
- <label for="frm_re_type">
34
- <?php esc_html_e( 'reCAPTCHA Type', 'formidable' ); ?>
35
- </label>
36
- <select name="frm_re_type" id="frm_re_type">
37
- <option value="" <?php selected( $frm_settings->re_type, '' ); ?>>
38
- <?php esc_html_e( 'Checkbox (V2)', 'formidable' ); ?>
39
- </option>
40
- <option value="invisible" <?php selected( $frm_settings->re_type, 'invisible' ); ?>>
41
- <?php esc_html_e( 'Invisible', 'formidable' ); ?>
42
- </option>
43
- <option value="v3" <?php selected( $frm_settings->re_type, 'v3' ); ?>>
44
- <?php esc_html_e( 'v3', 'formidable' ); ?>
45
- </option>
46
- </select>
47
- </p>
48
-
49
- <p class="frm6 frm_form_field">
50
- <label for="frm_re_lang">
51
- <?php esc_html_e( 'reCAPTCHA Language', 'formidable' ); ?>
52
- </label>
53
- <select name="frm_re_lang" id="frm_re_lang">
54
- <option value="" <?php selected( $frm_settings->re_lang, '' ); ?>>
55
- <?php esc_html_e( 'Browser Default', 'formidable' ); ?>
56
- </option>
57
- <?php foreach ( $captcha_lang as $lang => $lang_name ) { ?>
58
- <option value="<?php echo esc_attr( $lang ); ?>" <?php selected( $frm_settings->re_lang, $lang ); ?>>
59
- <?php echo esc_html( $lang_name ); ?>
60
- </option>
61
- <?php } ?>
62
- </select>
63
- </p>
64
-
65
- <p id="frm_captcha_threshold_container" class="frm6 frm_form_field <?php echo 'v3' === $frm_settings->re_type ? '' : 'frm_hidden'; ?>">
66
- <label for="frm_re_type">
67
- <?php esc_html_e( 'reCAPTCHA Threshold', 'formidable' ); ?>
68
- <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'A score of 0 is likely to be a bot and a score of 1 is likely not a bot. Setting a lower threshold will allow more bots, but it will also stop fewer real users.', 'formidable' ); ?>"></span>
69
- </label>
70
- <span style="vertical-align:top;">0</span>
71
- <input name="frm_re_threshold" id="frm_re_threshold" type="range" step="0.1" max="1" min="0" value="<?php echo esc_attr( $frm_settings->re_threshold ); ?>" />
72
- <span style="vertical-align:top;">1</span>
73
- </p>
74
-
75
- <p>
76
- <label for="frm_re_multi">
77
- <input type="checkbox" name="frm_re_multi" id="frm_re_multi"
78
- value="1" <?php checked( $frm_settings->re_multi, 1 ); ?> />
79
- <?php esc_html_e( 'Allow multiple reCAPTCHAs to be used on a single page', 'formidable' ); ?>
80
- </label>
81
- </p>
82
- </div>
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  die( 'You are not allowed to call this page directly.' );
4
  }
 
 
 
 
 
 
 
 
 
 
 
5
 
6
+ _deprecated_file( esc_html( basename( __FILE__ ) ), 'x.x', 'formidable/classes/views/frm-settings/captcha/captcha.php' );
 
 
 
 
 
 
7
 
8
+ include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/captcha/captcha.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/frm_admin.css CHANGED
@@ -239,9 +239,9 @@ td.column-title .frm_actions_dropdown {
239
  }
240
 
241
  .frm-upgrade-bar {
242
- background: var(--sidebar-color);
243
  border-bottom: 1px solid var(--sidebar-hover);
244
- padding: 3px 0 3px 60px;
245
  font-size: 95%;
246
  }
247
 
@@ -1526,17 +1526,17 @@ form .frm_blank_field label {
1526
 
1527
  .frm_error_style,
1528
  .frm_warning_style,
 
1529
  .frm_message,
1530
  #post-body-content .frm_updated_message,
1531
  div.frm_updated_message {
1532
- border-radius: var(--border-radius);
1533
- border: 1px solid #D6E9C6;
1534
- background-color: #DFF0D8;
1535
- color: #468847;
1536
- padding: 5px 25px;
1537
  font-size: 14px;
1538
  margin: 5px 0 15px;
1539
- text-align: center;
1540
  }
1541
 
1542
  #frm_top_bar + .wrap > .frm_updated_message, #frm_top_bar + .wrap > .frm_warning_style {
@@ -1549,19 +1549,17 @@ div.frm_updated_message {
1549
  margin: 5px 65px;
1550
  }
1551
 
1552
- #form_global_settings .frm_updated_message {
1553
  margin: 5px 25px;
1554
  }
1555
 
1556
  .frm_error_style {
1557
  color: #973937;
1558
- border-color: #F2DEDE;
1559
- background-color: #F2DEDE;
1560
  clear: both;
1561
  }
1562
 
1563
  .frm_error_style a {
1564
- color: #973937;
1565
  text-decoration: underline;
1566
  font-weight: 600;
1567
  }
@@ -1571,12 +1569,8 @@ div.frm_updated_message {
1571
  }
1572
 
1573
  .frm_warning_style {
1574
- color: #8B6E3C;
1575
- border-color: #FBECCD;
1576
- background-color: #FDF9E3;
1577
- border-radius: 10px;
1578
- text-align: left;
1579
- padding-top: 5px;
1580
  }
1581
 
1582
  .frm_warning_heading{
@@ -1584,11 +1578,16 @@ div.frm_updated_message {
1584
  margin-bottom:4px;
1585
  }
1586
 
 
 
 
 
 
1587
  .frm-banner-alert {
1588
  text-align: left;
1589
  margin: 0;
1590
  border-radius: 0;
1591
- padding: 10px 0 10px 50px;
1592
  }
1593
 
1594
  .frm-banner-alert a {
@@ -1618,6 +1617,7 @@ div.frm_updated_message {
1618
  }
1619
 
1620
  .frm-inline-message a {
 
1621
  font-weight: 600;
1622
  color: var(--primary-hover);
1623
  }
@@ -1835,7 +1835,7 @@ h2.frm-h2 + .howto {
1835
  overflow: visible;
1836
  }
1837
 
1838
- .frm-admin-page-formidableedit #wpbody-content > *:not(.frm-review-notice):not(.frm_previous_install),
1839
  #wpbody-content > .updated,
1840
  #wpbody-content > #update-nag,
1841
  #wpbody-content > .update-nag,
@@ -2295,10 +2295,6 @@ h2.frm-h2 + .howto {
2295
  padding: 15px 20px;
2296
  }
2297
 
2298
- #frm-create-footer .frm_error_style {
2299
- border-radius: 6px;
2300
- }
2301
-
2302
  #frm_code_from_email_options {
2303
  margin-top: 20px;
2304
  }
@@ -2585,7 +2581,6 @@ a.frm_pro_tip:hover .frmsvg {
2585
 
2586
  .frm_field_list .frm_pro_tip {
2587
  margin: 10px 15px;
2588
- padding-left: 40px;
2589
  position: relative;
2590
  width: calc(100% - 30px);
2591
  box-sizing: border-box;
@@ -4429,6 +4424,94 @@ label.frm-example-icon {
4429
  display: inline-block !important;
4430
  }
4431
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4432
  .frm-example-icon .frmsvg,
4433
  .frm-example-icon i {
4434
  height: 20px;
@@ -5548,6 +5631,7 @@ span.howto {
5548
 
5549
  .frm_wrap .google-visualization-table-tr-head,
5550
  .frm_wrap .google-visualization-table-tr-head th {
 
5551
  font-size: 16px;
5552
  font-weight: 400 !important;
5553
  text-align: left;
239
  }
240
 
241
  .frm-upgrade-bar {
242
+ background: rgba(188, 224, 253, 0.23);
243
  border-bottom: 1px solid var(--sidebar-hover);
244
+ padding: 3px 0 3px 40px;
245
  font-size: 95%;
246
  }
247
 
1526
 
1527
  .frm_error_style,
1528
  .frm_warning_style,
1529
+ .frm_note_style,
1530
  .frm_message,
1531
  #post-body-content .frm_updated_message,
1532
  div.frm_updated_message {
1533
+ border-radius: var(--small-radius);
1534
+ background-color: #D5F2DC;
1535
+ color: #1E561F;
1536
+ padding: 12px 25px;
 
1537
  font-size: 14px;
1538
  margin: 5px 0 15px;
1539
+ text-align: left;
1540
  }
1541
 
1542
  #frm_top_bar + .wrap > .frm_updated_message, #frm_top_bar + .wrap > .frm_warning_style {
1549
  margin: 5px 65px;
1550
  }
1551
 
1552
+ #form_global_settings #post-body-content > .frm_updated_message {
1553
  margin: 5px 25px;
1554
  }
1555
 
1556
  .frm_error_style {
1557
  color: #973937;
1558
+ background-color: #EBCCCC;
 
1559
  clear: both;
1560
  }
1561
 
1562
  .frm_error_style a {
 
1563
  text-decoration: underline;
1564
  font-weight: 600;
1565
  }
1569
  }
1570
 
1571
  .frm_warning_style {
1572
+ color: #7A4D05;
1573
+ background-color: #FFF2D2;
 
 
 
 
1574
  }
1575
 
1576
  .frm_warning_heading{
1578
  margin-bottom:4px;
1579
  }
1580
 
1581
+ .frm_note_style {
1582
+ background: rgba(188, 224, 253, 0.23);
1583
+ color: var(--dark-grey);
1584
+ }
1585
+
1586
  .frm-banner-alert {
1587
  text-align: left;
1588
  margin: 0;
1589
  border-radius: 0;
1590
+ padding: 10px 0 10px 40px;
1591
  }
1592
 
1593
  .frm-banner-alert a {
1617
  }
1618
 
1619
  .frm-inline-message a {
1620
+ text-decoration: underline;
1621
  font-weight: 600;
1622
  color: var(--primary-hover);
1623
  }
1835
  overflow: visible;
1836
  }
1837
 
1838
+ .frm-admin-page-formidableedit #wpbody-content > *:not(.frm-review-notice):not(.frm_previous_install):not(.frm-banner-alert),
1839
  #wpbody-content > .updated,
1840
  #wpbody-content > #update-nag,
1841
  #wpbody-content > .update-nag,
2295
  padding: 15px 20px;
2296
  }
2297
 
 
 
 
 
2298
  #frm_code_from_email_options {
2299
  margin-top: 20px;
2300
  }
2581
 
2582
  .frm_field_list .frm_pro_tip {
2583
  margin: 10px 15px;
 
2584
  position: relative;
2585
  width: calc(100% - 30px);
2586
  box-sizing: border-box;
4424
  display: inline-block !important;
4425
  }
4426
 
4427
+ #form_global_settings .captcha_settings h4 {
4428
+ font-weight: 400;
4429
+ font-size: 14px;
4430
+ }
4431
+
4432
+ #form_global_settings .captcha_settings h3 {
4433
+ font-weight: 600;
4434
+ font-size: 18px;
4435
+ text-transform: none;
4436
+ color: #282F36;
4437
+ margin-bottom: 0;
4438
+ }
4439
+
4440
+ .captcha_settings .alert {
4441
+ display: flex;
4442
+ margin-top: 16px;
4443
+ padding: 12px 16px;
4444
+ column-gap: 10px;
4445
+ background: rgba(188, 224, 253, 0.23);
4446
+ border-radius: 4px;
4447
+ }
4448
+
4449
+ .captcha_settings .alert.frm_hidden {
4450
+ display: none;
4451
+ }
4452
+
4453
+ #form_global_settings .alert p {
4454
+ margin: 0;
4455
+ }
4456
+
4457
+ .frm_captchas {
4458
+ margin-top: 16px;
4459
+ }
4460
+
4461
+ .frm_captchas .frm_radio {
4462
+ display: flex;
4463
+ column-gap: 21px;
4464
+ }
4465
+
4466
+ .captcha_option {
4467
+ border: 1px solid rgba(40, 47, 54, 0.2);
4468
+ border-radius: 4px;
4469
+ display: inline-block;
4470
+ position: relative;
4471
+ }
4472
+
4473
+ .captcha_option label {
4474
+ display: block;
4475
+ padding: 12px;
4476
+ display: flex;
4477
+ flex-direction: column;
4478
+ text-align: center;
4479
+ justify-content: center;
4480
+ }
4481
+
4482
+ .captcha_option label p {
4483
+ color: #545F6E;
4484
+ }
4485
+
4486
+ .captcha_option input[type=radio] {
4487
+ border: none;
4488
+ border-width: 0 !important;
4489
+ display: none;
4490
+ }
4491
+
4492
+ .captcha_option.active label:before {
4493
+ content: '';
4494
+ background-color: none;
4495
+ position: absolute;
4496
+ left: -10px;
4497
+ top: -10px;
4498
+ width: 20px !important;
4499
+ height: 20px !important;
4500
+ margin: 0 !important;
4501
+ background-image: url( data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iIzQxOTlGRCI+PHRpdGxlPmNoZWNrbWFya19jaXJjbGU8L3RpdGxlPjxjaXJjbGUgY3g9IjEyLjIiIGN5PSIxMS43IiByPSIxMCIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0yMy42IDEyQTExLjYgMTEuNiAwIDExLjQgMTJhMTEuNiAxMS42IDAgMDEyMy4yIDB6bS0xMyA2LjJsOC43LTguN2MuMy0uMy4zLS43IDAtMWwtMS0xYS43LjcgMCAwMC0xLjEgMGwtNyA3LTMuNC0zLjNhLjguOCAwIDAwLTEgMGwtMSAxYy0uNC4zLS40LjggMCAxbDQuOCA1Yy4zLjIuOC4yIDEgMHoiLz48L3N2Zz4= );
4502
+ }
4503
+
4504
+ .frm_captchas .frmsvg {
4505
+ width: 140px;
4506
+ height: 38px;
4507
+ }
4508
+
4509
+ .frm_builder_captcha.frm_warning_style {
4510
+ display: flex;
4511
+ column-gap: 10px;
4512
+ padding: 12px 16px;
4513
+ }
4514
+
4515
  .frm-example-icon .frmsvg,
4516
  .frm-example-icon i {
4517
  height: 20px;
5631
 
5632
  .frm_wrap .google-visualization-table-tr-head,
5633
  .frm_wrap .google-visualization-table-tr-head th {
5634
+ white-space: pre-wrap;
5635
  font-size: 16px;
5636
  font-weight: 400 !important;
5637
  text-align: left;
css/frm_fonts.css CHANGED
@@ -20,7 +20,7 @@
20
  .wp-media-buttons .button.frm_insert_form{padding-left:5px;}
21
 
22
  /* Upgrade notice */
23
- #frm_install_message, .frm_previous_install{padding:7px;}
24
  .frm_deauthorize_link .spinner{
25
  display:inline-block;
26
  margin-top:0;
20
  .wp-media-buttons .button.frm_insert_form{padding-left:5px;}
21
 
22
  /* Upgrade notice */
23
+ #frm_install_message{padding:7px;}
24
  .frm_deauthorize_link .spinner{
25
  display:inline-block;
26
  margin-top:0;
formidable.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Formidable Forms
4
  Description: Quickly and easily create drag-and-drop forms
5
- Version: 5.5.3.1
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11 Form Builder Team
2
  /*
3
  Plugin Name: Formidable Forms
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 5.5.4
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11 Form Builder Team
images/captcha_not_setup.png ADDED
Binary file
images/hcaptcha.png ADDED
Binary file
images/icons.svg CHANGED
@@ -250,9 +250,9 @@
250
  <title>pencil_solid</title>
251
  <path d="M1.7 13.4a1 1 0 0 0-.3.4l-1.3 5a.9.9 0 0 0 0 .5 1 1 0 0 0 1 .6l5-1.3c.2 0 .4-.2.5-.3l.2-.2-5-4.9zm.5 4.4zM19.7 2.2l-.8-1.1c-.6-.6-1.5-1-2.5-1S14.6.5 14 1l-1.3 1.3 4.9 5L18.9 6a3.5 3.5 0 0 0 .7-3.8zM3 12.1l8.6-8.6 5 5L7.8 17l-5-5z"/>
252
  </symbol>
253
- <symbol id="frm_pencil_icon" viewBox="0 0 20 20">
254
  <title>pencil</title>
255
- <path d="M19.7 2.2l-.8-1.1c-.6-.6-1.5-1-2.5-1S14.6.5 14 1L1.7 13.4a1 1 0 0 0-.3.4l-1.4 5a.9.9 0 0 0 0 .5 1 1 0 0 0 1.2.6l5-1.3.4-.3L18.9 6a3.5 3.5 0 0 0 .7-3.8zm-6.8 2.6L15.2 7l-8.6 8.7-2.4-2.4zm-10.7 13l1-3.3L5.4 17zM18 4.2l-.4.5L16.3 6 14 3.7l1.3-1.3A1.7 1.7 0 0 1 18 3.6l-.1.6z"/>
256
  </symbol>
257
  <symbol id="frm_signature_icon" viewBox="0 0 20 20">
258
  <title>signature</title>
@@ -921,5 +921,7 @@
921
  <symbol id="frm_thick_more_vert_icon" viewBox="0 0 20 20"><path d="M10 10.834a.833.833 0 100-1.667.833.833 0 000 1.667zM10 5a.833.833 0 100-1.667A.833.833 0 0010 5zM10 16.667A.833.833 0 1010 15a.833.833 0 000 1.667z" fill="#9EA9B8" stroke="#9EA9B8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol>
922
  <symbol id="frm_chat_forms_icon" viewBox="0 0 21 21" fill="none" stroke="currentColor"><path d="M19.991 13.914a2 2 0 0 1-2 2h-12l-4 4v-16a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol>
923
  <symbol id="frm_lightning" viewBox="0 0 20 22" fill="none"><path d="M11 1 1 13h9l-1 8L19 9h-9l1-8Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol>
 
 
924
  </defs>
925
  </svg>
250
  <title>pencil_solid</title>
251
  <path d="M1.7 13.4a1 1 0 0 0-.3.4l-1.3 5a.9.9 0 0 0 0 .5 1 1 0 0 0 1 .6l5-1.3c.2 0 .4-.2.5-.3l.2-.2-5-4.9zm.5 4.4zM19.7 2.2l-.8-1.1c-.6-.6-1.5-1-2.5-1S14.6.5 14 1l-1.3 1.3 4.9 5L18.9 6a3.5 3.5 0 0 0 .7-3.8zM3 12.1l8.6-8.6 5 5L7.8 17l-5-5z"/>
252
  </symbol>
253
+ <symbol id="frm_pencil_icon" viewBox="0 0 18 18" fill="none">
254
  <title>pencil</title>
255
+ <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M13.167 1.5A2.358 2.358 0 0 1 16.5 4.833L5.25 16.083l-4.583 1.25 1.25-4.583L13.167 1.5Z"/>
256
  </symbol>
257
  <symbol id="frm_signature_icon" viewBox="0 0 20 20">
258
  <title>signature</title>
921
  <symbol id="frm_thick_more_vert_icon" viewBox="0 0 20 20"><path d="M10 10.834a.833.833 0 100-1.667.833.833 0 000 1.667zM10 5a.833.833 0 100-1.667A.833.833 0 0010 5zM10 16.667A.833.833 0 1010 15a.833.833 0 000 1.667z" fill="#9EA9B8" stroke="#9EA9B8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol>
922
  <symbol id="frm_chat_forms_icon" viewBox="0 0 21 21" fill="none" stroke="currentColor"><path d="M19.991 13.914a2 2 0 0 1-2 2h-12l-4 4v-16a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol>
923
  <symbol id="frm_lightning" viewBox="0 0 20 22" fill="none"><path d="M11 1 1 13h9l-1 8L19 9h-9l1-8Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol>
924
+ <symbol id="frm_hcaptcha" viewBox="0 0 38 40" fill="none"><path fill="#0074BF" d="M28.75 33.25H24V38h4.75v-4.75Z" opacity=".5"/><path fill="#0074BF" d="M24 33.25h-4.75V38H24v-4.75ZM19.25 33.25H14.5V38h4.75v-4.75Z" opacity=".7"/><path fill="#0074BF" d="M14.5 33.25H9.75V38h4.75v-4.75Z" opacity=".5"/><path fill="#0082BF" d="M33.5 28.5h-4.75v4.75h4.75V28.5Z" opacity=".7"/><path fill="#0082BF" d="M28.75 28.5H24v4.75h4.75V28.5Z" opacity=".8"/><path fill="#0082BF" d="M24 28.5h-4.75v4.75H24V28.5ZM19.25 28.5H14.5v4.75h4.75V28.5Z"/><path fill="#0082BF" d="M14.5 28.5H9.75v4.75h4.75V28.5Z" opacity=".8"/><path fill="#0082BF" d="M9.75 28.5H5v4.75h4.75V28.5Z" opacity=".7"/><path fill="#008FBF" d="M38.25 23.75H33.5v4.75h4.75v-4.75Z" opacity=".5"/><path fill="#008FBF" d="M33.5 23.75h-4.75v4.75h4.75v-4.75Z" opacity=".8"/><path fill="#008FBF" d="M28.75 23.75H24v4.75h4.75v-4.75ZM24 23.75h-4.75v4.75H24v-4.75ZM19.25 23.75H14.5v4.75h4.75v-4.75ZM14.5 23.75H9.75v4.75h4.75v-4.75Z"/><path fill="#008FBF" d="M9.75 23.75H5v4.75h4.75v-4.75Z" opacity=".8"/><path fill="#008FBF" d="M5 23.75H.25v4.75H5v-4.75Z" opacity=".5"/><path fill="#009DBF" d="M38.25 19H33.5v4.75h4.75V19Z" opacity=".7"/><path fill="#009DBF" d="M33.5 19h-4.75v4.75h4.75V19ZM28.75 19H24v4.75h4.75V19ZM24 19h-4.75v4.75H24V19ZM19.25 19H14.5v4.75h4.75V19ZM14.5 19H9.75v4.75h4.75V19ZM9.75 19H5v4.75h4.75V19Z"/><path fill="#009DBF" d="M5 19H.25v4.75H5V19Z" opacity=".7"/><path fill="#00ABBF" d="M38.25 14.25H33.5V19h4.75v-4.75Z" opacity=".7"/><path fill="#00ABBF" d="M33.5 14.25h-4.75V19h4.75v-4.75ZM28.75 14.25H24V19h4.75v-4.75ZM24 14.25h-4.75V19H24v-4.75ZM19.25 14.25H14.5V19h4.75v-4.75ZM14.5 14.25H9.75V19h4.75v-4.75ZM9.75 14.25H5V19h4.75v-4.75Z"/><path fill="#00ABBF" d="M5 14.25H.25V19H5v-4.75Z" opacity=".7"/><path fill="#00B9BF" d="M38.25 9.5H33.5v4.75h4.75V9.5Z" opacity=".5"/><path fill="#00B9BF" d="M33.5 9.5h-4.75v4.75h4.75V9.5Z" opacity=".8"/><path fill="#00B9BF" d="M28.75 9.5H24v4.75h4.75V9.5ZM24 9.5h-4.75v4.75H24V9.5ZM19.25 9.5H14.5v4.75h4.75V9.5ZM14.5 9.5H9.75v4.75h4.75V9.5Z"/><path fill="#00B9BF" d="M9.75 9.5H5v4.75h4.75V9.5Z" opacity=".8"/><path fill="#00B9BF" d="M5 9.5H.25v4.75H5V9.5Z" opacity=".5"/><path fill="#00C6BF" d="M33.5 4.75h-4.75V9.5h4.75V4.75Z" opacity=".7"/><path fill="#00C6BF" d="M28.75 4.75H24V9.5h4.75V4.75Z" opacity=".8"/><path fill="#00C6BF" d="M24 4.75h-4.75V9.5H24V4.75ZM19.25 4.75H14.5V9.5h4.75V4.75Z"/><path fill="#00C6BF" d="M14.5 4.75H9.75V9.5h4.75V4.75Z" opacity=".8"/><path fill="#00C6BF" d="M9.75 4.75H5V9.5h4.75V4.75Z" opacity=".7"/><path fill="#00D4BF" d="M28.75 0H24v4.75h4.75V0Z" opacity=".5"/><path fill="#00D4BF" d="M24 0h-4.75v4.75H24V0ZM19.25 0H14.5v4.75h4.75V0Z" opacity=".7"/><path fill="#00D4BF" d="M14.5 0H9.75v4.75h4.75V0Z" opacity=".5"/><path fill="#fff" d="m12.758 17.496 1.312-2.96c.478-.763.43-1.694-.119-2.22a.933.933 0 0 0-.239-.19 1.454 1.454 0 0 0-1.217-.143c-.454.143-.86.453-1.098.859 0 0-1.814 4.225-2.482 6.134-.669 1.91-.406 5.395 2.196 7.996 2.768 2.77 6.755 3.39 9.285 1.48.095-.047.215-.119.31-.19l7.853-6.54c.382-.311.955-.956.43-1.696-.502-.716-1.432-.238-1.814.024l-4.512 3.294a.217.217 0 0 1-.286-.024c-.12-.143-.143-.525.048-.668l6.922-5.872c.596-.549.692-1.313.19-1.862-.477-.525-1.217-.5-1.837.024l-6.206 4.822a.269.269 0 0 1-.382-.048v-.024c-.12-.143-.167-.382-.024-.501l7.065-6.85a1.39 1.39 0 0 0 .072-1.958 1.298 1.298 0 0 0-.955-.406c-.358 0-.716.144-1.002.406l-7.209 6.78c-.167.166-.501 0-.549-.192-.024-.072 0-.143.072-.19l5.514-6.278c.549-.502.572-1.385.071-1.934-.501-.549-1.384-.573-1.933-.071l-.072.071-8.378 9.261c-.31.31-.74.31-.955.144-.143-.144-.167-.334-.071-.478Z"/></symbol>
925
+ <symbol id="frm_recaptcha" viewBox="0 0 38 38" fill="none"><path fill="#1C3AA9" d="M38.586 19.085a19.756 19.756 0 0 0-.02-.82V2.752L34.278 7.04C30.768 2.744 25.428 0 19.447 0 13.223 0 7.693 2.97 4.197 7.572l7.03 7.103a9.313 9.313 0 0 1 2.848-3.195c1.227-.957 2.966-1.74 5.372-1.74.29 0 .515.034.68.098a9.268 9.268 0 0 1 7.084 4.267l-4.976 4.976c6.303-.025 13.423-.04 16.35.003"/><path fill="#4285F4" d="M19.335 0c-.275.002-.548.008-.82.02H3.002L7.29 4.31C2.994 7.819.25 13.159.25 19.139c0 6.225 2.971 11.754 7.572 15.25l7.103-7.03a9.313 9.313 0 0 1-3.195-2.848c-.957-1.227-1.74-2.966-1.74-5.371 0-.29.034-.515.098-.68a9.268 9.268 0 0 1 4.267-7.085l4.976 4.976c-.025-6.302-.04-13.422.003-16.35"/><path fill="#ABABAB" d="M.25 19.14c.002.274.008.547.02.82v15.512l4.289-4.288c3.51 4.296 8.85 7.04 14.83 7.04 6.225 0 11.754-2.97 15.25-7.571l-7.03-7.104a9.315 9.315 0 0 1-2.848 3.195c-1.227.958-2.966 1.74-5.371 1.74-.29 0-.515-.033-.68-.097a9.267 9.267 0 0 1-7.085-4.268l4.976-4.976c-6.302.025-13.423.04-16.35-.003"/></symbol>
926
  </defs>
927
  </svg>
images/recaptcha_v3.png ADDED
Binary file
js/formidable.js CHANGED
@@ -668,7 +668,6 @@ function frmFrontFormJS() {
668
  );
669
  } else if ( Object.keys( response.errors ).length ) {
670
  // errors were returned
671
-
672
  removeSubmitLoading( jQuery( object ), 'enable' );
673
 
674
  //show errors
@@ -700,7 +699,7 @@ function frmFrontFormJS() {
700
  }
701
  }
702
 
703
- jQuery( object ).find( '.frm-g-recaptcha, .g-recaptcha' ).each( function() {
704
  var $recaptcha = jQuery( this ),
705
  recaptchaID = $recaptcha.data( 'rid' );
706
 
@@ -711,6 +710,9 @@ function frmFrontFormJS() {
711
  grecaptcha.reset();
712
  }
713
  }
 
 
 
714
  });
715
 
716
  jQuery( document ).trigger( 'frmFormErrors', [ object, response ]);
@@ -1129,9 +1131,9 @@ function frmFrontFormJS() {
1129
  * @since 4.10.02
1130
  */
1131
  function changeFocusWhenClickComboFieldLabel() {
1132
- let label;
1133
 
1134
- const comboInputsContainer = document.querySelectorAll( '.frm_combo_inputs_container' );
1135
  comboInputsContainer.forEach( function( inputsContainer ) {
1136
  if ( ! inputsContainer.closest( '.frm_form_field' ) ) {
1137
  return;
668
  );
669
  } else if ( Object.keys( response.errors ).length ) {
670
  // errors were returned
 
671
  removeSubmitLoading( jQuery( object ), 'enable' );
672
 
673
  //show errors
699
  }
700
  }
701
 
702
+ jQuery( object ).find( '.frm-g-recaptcha, .g-recaptcha, .h-captcha' ).each( function() {
703
  var $recaptcha = jQuery( this ),
704
  recaptchaID = $recaptcha.data( 'rid' );
705
 
710
  grecaptcha.reset();
711
  }
712
  }
713
+ if ( typeof hcaptcha !== 'undefined' && hcaptcha ) {
714
+ hcaptcha.reset();
715
+ }
716
  });
717
 
718
  jQuery( document ).trigger( 'frmFormErrors', [ object, response ]);
1131
  * @since 4.10.02
1132
  */
1133
  function changeFocusWhenClickComboFieldLabel() {
1134
+ var label;
1135
 
1136
+ var comboInputsContainer = document.querySelectorAll( '.frm_combo_inputs_container' );
1137
  comboInputsContainer.forEach( function( inputsContainer ) {
1138
  if ( ! inputsContainer.closest( '.frm_form_field' ) ) {
1139
  return;
js/formidable.min.js CHANGED
@@ -24,8 +24,8 @@ pageOrder,formReturned,contSubmit,delay,$fieldCont,key,inCollapsedSection,frmTri
24
  response.redirect}else if(response.content!==""){if(shouldTriggerEvent){triggerCustomEvent(object,"frmSubmitEvent");return}removeSubmitLoading(jQuery(object));if(frm_js.offset!=-1)frmFrontForm.scrollMsg(jQuery(object),false);formID=jQuery(object).find('input[name="form_id"]').val();response.content=response.content.replace(/ frm_pro_form /g," frm_pro_form frm_no_hide ");replaceContent=jQuery(object).closest(".frm_forms");removeAddedScripts(replaceContent,formID);delay=maybeSlideOut(replaceContent,
25
  response.content);setTimeout(function(){var container,input,previousInput;replaceContent.replaceWith(response.content);addUrlParam(response);if(typeof frmThemeOverride_frmAfterSubmit==="function"){pageOrder=jQuery('input[name="frm_page_order_'+formID+'"]').val();formReturned=jQuery(response.content).find('input[name="form_id"]').val();frmThemeOverride_frmAfterSubmit(formReturned,pageOrder,response.content,object)}if(typeof response.recaptcha!=="undefined"){container=jQuery("#frm_form_"+formID+"_container").find(".frm_fields_container");
26
  input='<input type="hidden" name="recaptcha_checked" value="'+response.recaptcha+'">';previousInput=container.find('input[name="recaptcha_checked"]');if(previousInput.length)previousInput.replaceWith(input);else container.append(input)}afterFormSubmitted(object,response)},delay)}else if(Object.keys(response.errors).length){removeSubmitLoading(jQuery(object),"enable");contSubmit=true;removeAllErrors();$fieldCont=null;for(key in response.errors){$fieldCont=jQuery(object).find("#frm_field_"+key+"_container");
27
- if($fieldCont.length){if(!$fieldCont.is(":visible")){inCollapsedSection=$fieldCont.closest(".frm_toggle_container");if(inCollapsedSection.length){frmTrigger=inCollapsedSection.prev();if(!frmTrigger.hasClass("frm_trigger"))frmTrigger=frmTrigger.prev(".frm_trigger");frmTrigger.trigger("click")}}if($fieldCont.is(":visible")){addFieldError($fieldCont,key,response.errors);contSubmit=false}}}jQuery(object).find(".frm-g-recaptcha, .g-recaptcha").each(function(){var $recaptcha=jQuery(this),recaptchaID=$recaptcha.data("rid");
28
- if(typeof grecaptcha!=="undefined"&&grecaptcha)if(recaptchaID)grecaptcha.reset(recaptchaID);else grecaptcha.reset()});jQuery(document).trigger("frmFormErrors",[object,response]);fieldset.removeClass("frm_doing_ajax");scrollToFirstField(object);if(contSubmit)object.submit();else{jQuery(object).prepend(response.error_message);checkForErrorsAndMaybeSetFocus()}}else{showFileLoading(object);object.submit()}};error=function(){jQuery(object).find('input[type="submit"], input[type="button"]').prop("disabled",
29
  false);object.submit()};postToAjaxUrl(object,data,success,error)}function postToAjaxUrl(form,data,success,error){var ajaxUrl,action,ajaxParams;ajaxUrl=frm_js.ajax_url;action=form.getAttribute("action");if("string"===typeof action&&-1!==action.indexOf("?action=frm_forms_preview"))ajaxUrl=action.split("?action=frm_forms_preview")[0];ajaxParams={type:"POST",url:ajaxUrl,data:data,success:success};if("function"===typeof error)ajaxParams.error=error;jQuery.ajax(ajaxParams)}function afterFormSubmitted(object,
30
  response){var formCompleted=jQuery(response.content).find(".frm_message");if(formCompleted.length)jQuery(document).trigger("frmFormComplete",[object,response]);else jQuery(document).trigger("frmPageChanged",[object,response])}function removeAddedScripts(formContainer,formID){var endReplace=jQuery(".frm_end_ajax_"+formID);if(endReplace.length){formContainer.nextUntil(".frm_end_ajax_"+formID).remove();endReplace.remove()}}function maybeSlideOut(oldContent,newContent){var c,newClass="frm_slideout";if(newContent.indexOf(" frm_slide")!==
31
  -1){c=oldContent.children();if(newContent.indexOf(" frm_going_back")!==-1)newClass+=" frm_going_back";c.removeClass("frm_going_back");c.addClass(newClass);return 300}return 0}function addUrlParam(response){var url;if(history.pushState&&typeof response.page!=="undefined"){url=addQueryVar("frm_page",response.page);window.history.pushState({"html":response.html},"","?"+url)}}function addQueryVar(key,value){var kvp,i,x;key=encodeURI(key);value=encodeURI(value);kvp=document.location.search.substr(1).split("&");
24
  response.redirect}else if(response.content!==""){if(shouldTriggerEvent){triggerCustomEvent(object,"frmSubmitEvent");return}removeSubmitLoading(jQuery(object));if(frm_js.offset!=-1)frmFrontForm.scrollMsg(jQuery(object),false);formID=jQuery(object).find('input[name="form_id"]').val();response.content=response.content.replace(/ frm_pro_form /g," frm_pro_form frm_no_hide ");replaceContent=jQuery(object).closest(".frm_forms");removeAddedScripts(replaceContent,formID);delay=maybeSlideOut(replaceContent,
25
  response.content);setTimeout(function(){var container,input,previousInput;replaceContent.replaceWith(response.content);addUrlParam(response);if(typeof frmThemeOverride_frmAfterSubmit==="function"){pageOrder=jQuery('input[name="frm_page_order_'+formID+'"]').val();formReturned=jQuery(response.content).find('input[name="form_id"]').val();frmThemeOverride_frmAfterSubmit(formReturned,pageOrder,response.content,object)}if(typeof response.recaptcha!=="undefined"){container=jQuery("#frm_form_"+formID+"_container").find(".frm_fields_container");
26
  input='<input type="hidden" name="recaptcha_checked" value="'+response.recaptcha+'">';previousInput=container.find('input[name="recaptcha_checked"]');if(previousInput.length)previousInput.replaceWith(input);else container.append(input)}afterFormSubmitted(object,response)},delay)}else if(Object.keys(response.errors).length){removeSubmitLoading(jQuery(object),"enable");contSubmit=true;removeAllErrors();$fieldCont=null;for(key in response.errors){$fieldCont=jQuery(object).find("#frm_field_"+key+"_container");
27
+ if($fieldCont.length){if(!$fieldCont.is(":visible")){inCollapsedSection=$fieldCont.closest(".frm_toggle_container");if(inCollapsedSection.length){frmTrigger=inCollapsedSection.prev();if(!frmTrigger.hasClass("frm_trigger"))frmTrigger=frmTrigger.prev(".frm_trigger");frmTrigger.trigger("click")}}if($fieldCont.is(":visible")){addFieldError($fieldCont,key,response.errors);contSubmit=false}}}jQuery(object).find(".frm-g-recaptcha, .g-recaptcha, .h-captcha").each(function(){var $recaptcha=jQuery(this),recaptchaID=
28
+ $recaptcha.data("rid");if(typeof grecaptcha!=="undefined"&&grecaptcha)if(recaptchaID)grecaptcha.reset(recaptchaID);else grecaptcha.reset();if(typeof hcaptcha!=="undefined"&&hcaptcha)hcaptcha.reset()});jQuery(document).trigger("frmFormErrors",[object,response]);fieldset.removeClass("frm_doing_ajax");scrollToFirstField(object);if(contSubmit)object.submit();else{jQuery(object).prepend(response.error_message);checkForErrorsAndMaybeSetFocus()}}else{showFileLoading(object);object.submit()}};error=function(){jQuery(object).find('input[type="submit"], input[type="button"]').prop("disabled",
29
  false);object.submit()};postToAjaxUrl(object,data,success,error)}function postToAjaxUrl(form,data,success,error){var ajaxUrl,action,ajaxParams;ajaxUrl=frm_js.ajax_url;action=form.getAttribute("action");if("string"===typeof action&&-1!==action.indexOf("?action=frm_forms_preview"))ajaxUrl=action.split("?action=frm_forms_preview")[0];ajaxParams={type:"POST",url:ajaxUrl,data:data,success:success};if("function"===typeof error)ajaxParams.error=error;jQuery.ajax(ajaxParams)}function afterFormSubmitted(object,
30
  response){var formCompleted=jQuery(response.content).find(".frm_message");if(formCompleted.length)jQuery(document).trigger("frmFormComplete",[object,response]);else jQuery(document).trigger("frmPageChanged",[object,response])}function removeAddedScripts(formContainer,formID){var endReplace=jQuery(".frm_end_ajax_"+formID);if(endReplace.length){formContainer.nextUntil(".frm_end_ajax_"+formID).remove();endReplace.remove()}}function maybeSlideOut(oldContent,newContent){var c,newClass="frm_slideout";if(newContent.indexOf(" frm_slide")!==
31
  -1){c=oldContent.children();if(newContent.indexOf(" frm_going_back")!==-1)newClass+=" frm_going_back";c.removeClass("frm_going_back");c.addClass(newClass);return 300}return 0}function addUrlParam(response){var url;if(history.pushState&&typeof response.page!=="undefined"){url=addQueryVar("frm_page",response.page);window.history.pushState({"html":response.html},"","?"+url)}}function addQueryVar(key,value){var kvp,i,x;key=encodeURI(key);value=encodeURI(value);kvp=document.location.search.substr(1).split("&");
js/formidable_admin.js CHANGED
@@ -730,6 +730,15 @@ function frmAdminBuildJS() {
730
  showInputIcon( '#' + cont.attr( 'id' ) );
731
  frmDom.autocomplete.initAutocomplete( 'page', inside );
732
  jQuery( b ).trigger( 'frm-action-loaded' );
 
 
 
 
 
 
 
 
 
733
  }
734
  });
735
  }
@@ -1020,7 +1029,7 @@ function frmAdminBuildJS() {
1020
  maybeOpenCollapsedPage( placeholder );
1021
 
1022
  const $previousFieldContainer = ui.helper.parent();
1023
- const previousSection = ui.helper.get( 0 ).closest( 'ul.frm_sorting' );
1024
  const newSection = placeholder.closest( 'ul.frm_sorting' );
1025
 
1026
  if ( draggable.classList.contains( 'frm-new-field' ) ) {
@@ -1029,7 +1038,7 @@ function frmAdminBuildJS() {
1029
  moveFieldThatAlreadyExists( draggable, placeholder );
1030
  }
1031
 
1032
- const previousSectionId = previousSection && previousSection.classList.contains( 'start_divider' ) ? parseInt( previousSection.closest( '.edit_field_type_divider' ).getAttribute( 'data-fid' ) ) : 0;
1033
  const newSectionId = newSection.classList.contains( 'start_divider' ) ? parseInt( newSection.closest( '.edit_field_type_divider' ).getAttribute( 'data-fid' ) ) : 0;
1034
 
1035
  placeholder.remove();
@@ -1040,7 +1049,7 @@ function frmAdminBuildJS() {
1040
  maybeUpdateDraggableClassAfterDrop( draggable, $previousContainerFields );
1041
 
1042
  if ( previousSectionId !== newSectionId ) {
1043
- updateFieldAfterMovingBetweenSections( jQuery( draggable ) );
1044
  }
1045
 
1046
  debouncedSyncAfterDragAndDrop();
@@ -1538,23 +1547,26 @@ function frmAdminBuildJS() {
1538
  /**
1539
  * Update a field after it is dragged and dropped into, out of, or between sections
1540
  *
1541
- * @param {object} currentItem
 
 
1542
  */
1543
- function updateFieldAfterMovingBetweenSections( currentItem ) {
1544
  if ( ! currentItem.hasClass( 'form-field' ) ) {
1545
  // currentItem is a field group. Call for children recursively.
1546
  getFieldsInRow( jQuery( currentItem.get( 0 ).firstChild ) ).each(
1547
  function() {
1548
- updateFieldAfterMovingBetweenSections( jQuery( this ) );
1549
  }
1550
  );
1551
  return;
1552
  }
1553
 
1554
- const fieldId = currentItem.attr( 'id' ).replace( 'frm_field_id_', '' );
1555
- const section = getSectionForFieldPlacement( currentItem );
1556
- const formId = getFormIdForFieldPlacement( section );
1557
- const sectionId = getSectionIdForFieldPlacement( section );
 
1558
 
1559
  jQuery.ajax({
1560
  type: 'POST',
@@ -1564,6 +1576,7 @@ function frmAdminBuildJS() {
1564
  form_id: formId,
1565
  field: fieldId,
1566
  section_id: sectionId,
 
1567
  nonce: frmGlobal.nonce
1568
  },
1569
  success: function() {
@@ -3857,11 +3870,20 @@ function frmAdminBuildJS() {
3857
  return wrapper;
3858
  }
3859
 
 
 
 
 
 
3860
  function handleFieldGroupLayoutOptionClick() {
3861
- var type, row;
3862
- type = this.getAttribute( 'layout-type' );
3863
- row = document.querySelector( '.frm-field-group-hover-target' );
3864
- size = getFieldsInRow( jQuery( row ) ).length;
 
 
 
 
3865
  syncLayoutClasses( getFieldsInRow( jQuery( row ) ).first(), type );
3866
  destroyFieldGroupPopup();
3867
  }
@@ -6421,6 +6443,15 @@ function frmAdminBuildJS() {
6421
  if ( widgetTop ) {
6422
  jQuery( widgetTop ).trigger( 'frm-action-loaded' );
6423
  }
 
 
 
 
 
 
 
 
 
6424
  }
6425
  }
6426
 
@@ -10315,6 +10346,19 @@ function frmAdminBuildJS() {
10315
  if ( captchaType ) {
10316
  captchaType.addEventListener( 'change', handleCaptchaTypeChange );
10317
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
10318
  },
10319
 
10320
  exportInit: function() {
@@ -10419,7 +10463,9 @@ function frmAdminBuildJS() {
10419
  addFilter: function( hookName, callback, priority ) {
10420
  return wp.hooks.addFilter( hookName, 'formidable', callback, priority );
10421
  }
10422
- }
 
 
10423
  };
10424
  }
10425
 
730
  showInputIcon( '#' + cont.attr( 'id' ) );
731
  frmDom.autocomplete.initAutocomplete( 'page', inside );
732
  jQuery( b ).trigger( 'frm-action-loaded' );
733
+
734
+ /**
735
+ * Fires after filling form action content when opening.
736
+ *
737
+ * @since 5.5.4
738
+ *
739
+ * @param {Object} insideElement JQuery object of form action inside element.
740
+ */
741
+ wp.hooks.doAction( 'frm_filled_form_action', inside );
742
  }
743
  });
744
  }
1029
  maybeOpenCollapsedPage( placeholder );
1030
 
1031
  const $previousFieldContainer = ui.helper.parent();
1032
+ const previousSection = ui.helper.get( 0 ).closest( 'ul.start_divider' );
1033
  const newSection = placeholder.closest( 'ul.frm_sorting' );
1034
 
1035
  if ( draggable.classList.contains( 'frm-new-field' ) ) {
1038
  moveFieldThatAlreadyExists( draggable, placeholder );
1039
  }
1040
 
1041
+ const previousSectionId = previousSection ? parseInt( previousSection.closest( '.edit_field_type_divider' ).getAttribute( 'data-fid' ) ) : 0;
1042
  const newSectionId = newSection.classList.contains( 'start_divider' ) ? parseInt( newSection.closest( '.edit_field_type_divider' ).getAttribute( 'data-fid' ) ) : 0;
1043
 
1044
  placeholder.remove();
1049
  maybeUpdateDraggableClassAfterDrop( draggable, $previousContainerFields );
1050
 
1051
  if ( previousSectionId !== newSectionId ) {
1052
+ updateFieldAfterMovingBetweenSections( jQuery( draggable ), previousSection );
1053
  }
1054
 
1055
  debouncedSyncAfterDragAndDrop();
1547
  /**
1548
  * Update a field after it is dragged and dropped into, out of, or between sections
1549
  *
1550
+ * @param {Object} currentItem
1551
+ * @param {Object} previousSection
1552
+ * @returns {void}
1553
  */
1554
+ function updateFieldAfterMovingBetweenSections( currentItem, previousSection ) {
1555
  if ( ! currentItem.hasClass( 'form-field' ) ) {
1556
  // currentItem is a field group. Call for children recursively.
1557
  getFieldsInRow( jQuery( currentItem.get( 0 ).firstChild ) ).each(
1558
  function() {
1559
+ updateFieldAfterMovingBetweenSections( jQuery( this ), previousSection );
1560
  }
1561
  );
1562
  return;
1563
  }
1564
 
1565
+ const fieldId = currentItem.attr( 'id' ).replace( 'frm_field_id_', '' );
1566
+ const section = getSectionForFieldPlacement( currentItem );
1567
+ const formId = getFormIdForFieldPlacement( section );
1568
+ const sectionId = getSectionIdForFieldPlacement( section );
1569
+ const previousFormId = previousSection ? getFormIdForFieldPlacement( jQuery( previousSection.parentNode ) ) : 0;
1570
 
1571
  jQuery.ajax({
1572
  type: 'POST',
1576
  form_id: formId,
1577
  field: fieldId,
1578
  section_id: sectionId,
1579
+ previous_form_id: previousFormId,
1580
  nonce: frmGlobal.nonce
1581
  },
1582
  success: function() {
3870
  return wrapper;
3871
  }
3872
 
3873
+ /**
3874
+ * Handle when a field group layout option (that sets grid classes/column sizing) is selected in the "Row Layout" popup.
3875
+ *
3876
+ * @returns {void}
3877
+ */
3878
  function handleFieldGroupLayoutOptionClick() {
3879
+ const row = document.querySelector( '.frm-field-group-hover-target' );
3880
+ if ( ! row ) {
3881
+ // The field group layout options also get clicked when merging multiple rows.
3882
+ // The following code isn't required for multiple rows though so just exit early.
3883
+ return;
3884
+ }
3885
+
3886
+ const type = this.getAttribute( 'layout-type' );
3887
  syncLayoutClasses( getFieldsInRow( jQuery( row ) ).first(), type );
3888
  destroyFieldGroupPopup();
3889
  }
6443
  if ( widgetTop ) {
6444
  jQuery( widgetTop ).trigger( 'frm-action-loaded' );
6445
  }
6446
+
6447
+ /**
6448
+ * Fires after added a new form action.
6449
+ *
6450
+ * @since 5.5.4
6451
+ *
6452
+ * @param {HTMLElement} formAction Form action element.
6453
+ */
6454
+ wp.hooks.doAction( 'frm_added_form_action', newAction );
6455
  }
6456
  }
6457
 
10346
  if ( captchaType ) {
10347
  captchaType.addEventListener( 'change', handleCaptchaTypeChange );
10348
  }
10349
+
10350
+ document.querySelector( '.frm_captchas' ).addEventListener( 'change', function( e ) {
10351
+ var selectedValue, unselectedValue;
10352
+ selectedValue = e.target.value;
10353
+ unselectedValue = selectedValue === 'recaptcha' ? 'hcaptcha' : 'recaptcha';
10354
+ document.getElementById( selectedValue + '_settings' ).classList.remove( 'frm_hidden' );
10355
+ document.getElementById( selectedValue ).parentElement.classList.add( 'active' );
10356
+
10357
+ document.getElementById( unselectedValue + '_settings' ).classList.add( 'frm_hidden' );
10358
+ document.getElementById( unselectedValue ).parentElement.classList.remove( 'active' );
10359
+
10360
+ document.querySelector( '.captcha_settings .alert' ).classList.toggle( 'frm_hidden' );
10361
+ });
10362
  },
10363
 
10364
  exportInit: function() {
10463
  addFilter: function( hookName, callback, priority ) {
10464
  return wp.hooks.addFilter( hookName, 'formidable', callback, priority );
10465
  }
10466
+ },
10467
+
10468
+ infoModal: infoModal
10469
  };
10470
  }
10471
 
js/formidable_blocks.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateAttribute=function(e,t,n){n(function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n;return e}({},e,t))},t.setTextAttribute=function(e,t){if(e)return" "+t+'="'+e+'"';return""},t.getSubDir=function(){var e=window.location.pathname,t=e.indexOf("wp-admin"),n="/";t>-1&&(n=e.substr(0,t));return n};t.cssHideAdvancedSettings="\n .components-panel__body.editor-block-inspector__advanced {\n display:none;\n }\n"},function(e,t,n){e.exports=n(8)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(0);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var a=function(e){function t(){return i(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"render",value:function(){return wp.element.createElement("div",null,"[formidable",(e=this.props,t=e.formId,n=e.title,r=e.description,i=e.minimize,l="",l+=(0,o.setTextAttribute)(t,"id"),l+=(0,o.setTextAttribute)(n,"title"),l+=(0,o.setTextAttribute)(r,"description"),l+=(0,o.setTextAttribute)(i,"minimize")),"]");var e,t,n,r,i,l}}]),t}(wp.element.Component);t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=l(n(10)),i=l(n(1));function l(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=wp.i18n.__,s=function(e){function t(){return a(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"render",value:function(){var e=this.props,t=e.formId,n=e.setAttributes,r=e.forms;return wp.element.createElement(o.default,{selected:t,itemName:u("form","formidable"),itemNamePlural:u("forms","formidable"),items:r,onChange:function(e){n({formId:e})}})}}]),t}(wp.element.Component);t.default=s,s.propTypes={formId:i.default.string,setAttributes:i.default.func.isRequired}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var l=wp.element.Component,a=wp.components.Dashicon,c=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"render",value:function(){return"svg"!==formidable_form_selector.icon?wp.element.createElement(a,{icon:formidable_form_selector.icon,size:"120"}):wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 599.68 601.37",width:"120",height:"120"},wp.element.createElement("path",{className:"cls-1 orange",d:"M289.6 384h140v76h-140z"}),wp.element.createElement("path",{className:"cls-1",d:"M400.2 147h-200c-17 0-30.6 12.2-30.6 29.3V218h260v-71zM397.9 264H169.6v196h75V340H398a32.2 32.2 0 0 0 30.1-21.4 24.3 24.3 0 0 0 1.7-8.7V264z"}),wp.element.createElement("path",{className:"cls-1",d:"M299.8 601.4A300.3 300.3 0 0 1 0 300.7a299.8 299.8 0 1 1 511.9 212.6 297.4 297.4 0 0 1-212 88zm0-563A262 262 0 0 0 38.3 300.7a261.6 261.6 0 1 0 446.5-185.5 259.5 259.5 0 0 0-185-76.8z"}))}}]),t}(l);t.default=c},function(e,t,n){"use strict";n(6),n(11)},function(e,t,n){"use strict";var r=c(n(2)),o=c(n(7)),i=c(n(4)),l=c(n(3)),a=n(0);function c(e){return e&&e.__esModule?e:{default:e}}var u=wp.element.Fragment,s=wp.i18n.__,f=wp.blocks.registerBlockType,p=wp.components,m=p.ServerSideRender,b=p.Notice;f("formidable/simple-form",{title:formidable_form_selector.name,description:s("Display a Form","formidable"),icon:i.default,category:"widgets",keywords:[s("contact forms","formidable"),"formidable"],edit:function(e){var t=e.setAttributes,n=e.attributes,r=e.isSelected,c=n.formId,f=formidable_form_selector.forms;return 0===f.length?wp.element.createElement(b,{status:"warning",isDismissible:!1},s("This site does not have any forms.","formidable")):c?wp.element.createElement(u,null,wp.element.createElement(o.default,{attributes:n,setAttributes:t,forms:f}),r&&wp.element.createElement("style",null,a.cssHideAdvancedSettings),wp.element.createElement(m,{block:"formidable/simple-form",attributes:n})):wp.element.createElement("div",{className:"frm-block-intro-screen"},wp.element.createElement("div",{className:"frm-block-intro-content"},wp.element.createElement(i.default,null),wp.element.createElement("div",{className:"frm-block-title"},formidable_form_selector.name),wp.element.createElement("div",{className:"frm-block-selector-screen"},wp.element.createElement(l.default,{formId:c,setAttributes:t,forms:f}))))},save:function(e){var t=e.attributes;return void 0===t.formId?"":wp.element.createElement(u,null,wp.element.createElement(r.default,t))}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=c(n(1)),i=c(n(3)),l=c(n(2)),a=n(0);function c(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=wp.i18n.__,p=wp.element.Component,m=wp.blockEditor.InspectorControls,b=wp.components,d=b.PanelBody,y=b.PanelRow,w=b.ToggleControl,h=b.ExternalLink,v=function(e){function t(){return u(this,t),s(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"render",value:function(){var e=this.props,t=e.setAttributes,n=e.attributes,r=e.forms,o=n.formId,c=n.title,u=n.description,s=n.minimize;return wp.element.createElement(m,null,wp.element.createElement(d,{title:f("Select Form","formidable"),initialOpen:!0},wp.element.createElement(y,null,wp.element.createElement(i.default,{formId:o,setAttributes:t,forms:r})),o&&wp.element.createElement(y,null,wp.element.createElement(h,{href:(0,a.getSubDir)()+"wp-admin/admin.php?page=formidable&frm_action=edit&id="+o},f("Go to form","formidable")))),wp.element.createElement(d,{title:f("Options","formidable"),initialOpen:!1},wp.element.createElement(w,{label:f("Show Form Title","formidable"),checked:c,onChange:function(e){(0,a.updateAttribute)("title",e?"1":"",t)}}),wp.element.createElement(w,{label:f("Show Form Description","formidable"),checked:u,onChange:function(e){(0,a.updateAttribute)("description",e?"1":"",t)}}),wp.element.createElement(w,{label:f("Minimize HTML","formidable"),checked:s,onChange:function(e){(0,a.updateAttribute)("minimize",e?"1":"",t)}})),wp.element.createElement(d,{title:f("Shortcode","formidable"),initialOpen:!1},wp.element.createElement(y,null,wp.element.createElement(l.default,this.props.attributes))))}}]),t}(p);t.default=v,v.propTypes={attributes:o.default.object,setAttributes:o.default.func}},function(e,t,n){"use strict";var r=n(9);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,l){if(l!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),l=(r=i)&&r.__esModule?r:{default:r};function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=wp.i18n,s=u.__,f=u.sprintf,p=wp.element.Component,m=wp.components.SelectControl,b=function(e){function t(){return a(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"createOptions",value:function(e,t){var n=e.map((function(e){return{label:e.label,value:e.value}}));return[{label:f(s("Select a %s","formidable"),t),value:""}].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(n))}},{key:"render",value:function(){var e=this.props,t=e.selected,n=e.items,r=e.onChange,o=e.itemName,i=e.itemNamePlural,l=e.label,a=e.help;return n&&0!==n.length?wp.element.createElement(m,{value:t,options:this.createOptions(n,o),label:l,help:a,onChange:r}):wp.element.createElement("p",{className:"frm-block-select-no-items"},f(s("Currently, there are no %s","formidable"),i))}}]),t}(p);t.default=b,b.defaultProps={itemName:"item",itemNamePlural:"items"},b.propTypes={selected:l.default.oneOfType([l.default.string,l.default.number]),items:l.default.array,onChange:l.default.func,itemName:l.default.string,itemNamePlural:l.default.string,label:l.default.string,help:l.default.string}},function(e,t,n){"use strict";var r,o=n(4),i=(r=o)&&r.__esModule?r:{default:r};var l=wp.i18n.__,a=wp.blocks.registerBlockType,c=wp.components.Notice,u=wp.element.createElement("svg",{width:20,height:20},wp.element.createElement("path",{d:"M16.9 0H3a2 2 0 0 0-1.9 1.9V18a2 2 0 0 0 2 1.9h13.7a2 2 0 0 0 1.9-1.9V2a2 2 0 0 0-2-1.9zm0 18.1H3v-10H17v10zm0-11.9H3V2H17v4.3zM5.5 12.6H7c.3 0 .5-.3.5-.5v-1.5c0-.3-.3-.5-.5-.5H5.5c-.3 0-.5.3-.5.5V12c0 .3.3.5.5.5zm7.5 3.8h1.5c.3 0 .5-.3.5-.6v-5.2c0-.3-.3-.5-.5-.5H13c-.3 0-.5.3-.5.5v5.3c0 .2.3.4.5.4zm-7.5 0H7c.3 0 .5-.3.5-.6v-1.4c0-.3-.3-.6-.5-.6H5.5c-.3 0-.5.3-.5.6v1.4c0 .3.3.6.5.6zm3.8-3.8h1.4c.3 0 .6-.3.6-.5v-1.5c0-.3-.3-.5-.6-.5H9.3c-.3 0-.6.3-.6.5V12c0 .3.3.5.6.5zm0 3.8h1.4c.3 0 .6-.3.6-.6v-1.4c0-.3-.3-.6-.6-.6H9.3c-.3 0-.6.3-.6.6v1.4c0 .3.3.6.6.6z"}));a("formidable/calculator",{title:l("Calculator Form","formidable"),description:l("Display a Calculator Form","formidable"),icon:u,category:"widgets",keywords:["calculation","formidable"],edit:function(e){e.setAttributes,e.attributes.formId;return 0===formidable_form_selector.forms.length?wp.element.createElement(c,{status:"warning",isDismissible:!1},l("This site does not have any forms.","formidable")):wp.element.createElement("div",{className:"frm-block-intro-screen"},wp.element.createElement("div",{className:"frm-block-intro-content"},wp.element.createElement(i.default,null),wp.element.createElement("div",{className:"frm-block-title"},l("Calculator Form","formidable")),wp.element.createElement("div",{className:"frm-block-selector-screen frm_pro_tip"},wp.element.createElement(c,{status:"warning",isDismissible:!1},l("This site does not have any calculator forms.","formidable"),wp.element.createElement("br",null),wp.element.createElement("a",{href:formidable_form_selector.link,target:"_blank"},l("Upgrade Formidable Forms.","formidable"))),wp.element.createElement("img",{src:formidable_form_selector.url+"/images/conversion-calc.jpg",alt:l("Calculator Form","formidable")}))))}})}]);
1
+ (()=>{var e={877:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var l=wp.element.Component,a=wp.components.Dashicon,i=function(e){function t(){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"render",value:function(){return"svg"!==formidable_form_selector.icon?wp.element.createElement(a,{icon:formidable_form_selector.icon,size:"120"}):wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 599.68 601.37",width:"120",height:"120"},wp.element.createElement("path",{className:"cls-1 orange",d:"M289.6 384h140v76h-140z"}),wp.element.createElement("path",{className:"cls-1",d:"M400.2 147h-200c-17 0-30.6 12.2-30.6 29.3V218h260v-71zM397.9 264H169.6v196h75V340H398a32.2 32.2 0 0 0 30.1-21.4 24.3 24.3 0 0 0 1.7-8.7V264z"}),wp.element.createElement("path",{className:"cls-1",d:"M299.8 601.4A300.3 300.3 0 0 1 0 300.7a299.8 299.8 0 1 1 511.9 212.6 297.4 297.4 0 0 1-212 88zm0-563A262 262 0 0 0 38.3 300.7a261.6 261.6 0 1 0 446.5-185.5 259.5 259.5 0 0 0-185-76.8z"}))}}]),t}(l);t.default=i},752:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=(n=r(697))&&n.__esModule?n:{default:n};function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var c=wp.i18n,s=c.__,u=c.sprintf,f=wp.element.Component,m=wp.components.SelectControl,p=function(e){function t(){return a(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"createOptions",value:function(e,t){var r=e.map((function(e){return{label:e.label,value:e.value}}));return[{label:u(s("Select a %s","formidable"),t),value:""}].concat(function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(r))}},{key:"render",value:function(){var e=this.props,t=e.selected,r=e.items,n=e.onChange,o=e.itemName,l=e.itemNamePlural,a=e.label,i=e.help;return r&&0!==r.length?wp.element.createElement(m,{value:t,options:this.createOptions(r,o),label:a,help:i,onChange:n}):wp.element.createElement("p",{className:"frm-block-select-no-items"},u(s("Currently, there are no %s","formidable"),l))}}]),t}(f);t.default=p,p.defaultProps={itemName:"item",itemNamePlural:"items"},p.propTypes={selected:l.default.oneOfType([l.default.string,l.default.number]),items:l.default.array,onChange:l.default.func,itemName:l.default.string,itemNamePlural:l.default.string,label:l.default.string,help:l.default.string}},897:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateAttribute=function(e,t,r){var n,o,l;r((l=t,(o=e)in(n={})?Object.defineProperty(n,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):n[o]=l,n))},t.setTextAttribute=function(e,t){return e?" "+t+'="'+e+'"':""},t.getSubDir=function(){var e=window.location.pathname,t=e.indexOf("wp-admin"),r="/";return t>-1&&(r=e.substr(0,t)),r},t.cssHideAdvancedSettings="\n .components-panel__body.editor-block-inspector__advanced {\n display:none;\n }\n"},186:(e,t,r)=>{"use strict";var n=c(r(350)),o=c(r(3)),l=c(r(877)),a=c(r(776)),i=r(897);function c(e){return e&&e.__esModule?e:{default:e}}var s=wp.element.Fragment,u=wp.i18n.__,f=wp.blocks.registerBlockType,m=wp.components,p=m.ServerSideRender,b=m.Notice;f("formidable/simple-form",{title:formidable_form_selector.name,description:u("Display a Form","formidable"),icon:l.default,category:"widgets",keywords:[u("contact forms","formidable"),"formidable"],edit:function(e){var t=e.setAttributes,r=e.attributes,n=e.isSelected,c=r.formId,f=formidable_form_selector.forms;return 0===f.length?wp.element.createElement(b,{status:"warning",isDismissible:!1},u("This site does not have any forms.","formidable")):c?wp.element.createElement(s,null,wp.element.createElement(o.default,{attributes:r,setAttributes:t,forms:f}),n&&wp.element.createElement("style",null,i.cssHideAdvancedSettings),wp.element.createElement(p,{block:"formidable/simple-form",attributes:r})):wp.element.createElement("div",{className:"frm-block-intro-screen"},wp.element.createElement("div",{className:"frm-block-intro-content"},wp.element.createElement(l.default,null),wp.element.createElement("div",{className:"frm-block-title"},formidable_form_selector.name),wp.element.createElement("div",{className:"frm-block-selector-screen"},wp.element.createElement(a.default,{formId:c,setAttributes:t,forms:f}))))},save:function(e){var t=e.attributes;return void 0===t.formId?"":wp.element.createElement(s,null,wp.element.createElement(n.default,t))}})},264:(e,t,r)=>{"use strict";var n,o=(n=r(877))&&n.__esModule?n:{default:n},l=wp.i18n.__,a=wp.blocks.registerBlockType,i=wp.components.Notice,c=wp.element.createElement("svg",{width:20,height:20},wp.element.createElement("path",{d:"M16.9 0H3a2 2 0 0 0-1.9 1.9V18a2 2 0 0 0 2 1.9h13.7a2 2 0 0 0 1.9-1.9V2a2 2 0 0 0-2-1.9zm0 18.1H3v-10H17v10zm0-11.9H3V2H17v4.3zM5.5 12.6H7c.3 0 .5-.3.5-.5v-1.5c0-.3-.3-.5-.5-.5H5.5c-.3 0-.5.3-.5.5V12c0 .3.3.5.5.5zm7.5 3.8h1.5c.3 0 .5-.3.5-.6v-5.2c0-.3-.3-.5-.5-.5H13c-.3 0-.5.3-.5.5v5.3c0 .2.3.4.5.4zm-7.5 0H7c.3 0 .5-.3.5-.6v-1.4c0-.3-.3-.6-.5-.6H5.5c-.3 0-.5.3-.5.6v1.4c0 .3.3.6.5.6zm3.8-3.8h1.4c.3 0 .6-.3.6-.5v-1.5c0-.3-.3-.5-.6-.5H9.3c-.3 0-.6.3-.6.5V12c0 .3.3.5.6.5zm0 3.8h1.4c.3 0 .6-.3.6-.6v-1.4c0-.3-.3-.6-.6-.6H9.3c-.3 0-.6.3-.6.6v1.4c0 .3.3.6.6.6z"}));a("formidable/calculator",{title:l("Calculator Form","formidable"),description:l("Display a Calculator Form","formidable"),icon:c,category:"widgets",keywords:["calculation","formidable"],edit:function(e){return e.setAttributes,e.attributes.formId,0===formidable_form_selector.forms.length?wp.element.createElement(i,{status:"warning",isDismissible:!1},l("This site does not have any forms.","formidable")):wp.element.createElement("div",{className:"frm-block-intro-screen"},wp.element.createElement("div",{className:"frm-block-intro-content"},wp.element.createElement(o.default,null),wp.element.createElement("div",{className:"frm-block-title"},l("Calculator Form","formidable")),wp.element.createElement("div",{className:"frm-block-selector-screen frm_pro_tip"},wp.element.createElement(i,{status:"warning",isDismissible:!1},l("This site does not have any calculator forms.","formidable"),wp.element.createElement("br",null),wp.element.createElement("a",{href:formidable_form_selector.link,target:"_blank"},l("Upgrade Formidable Forms.","formidable"))),wp.element.createElement("img",{src:formidable_form_selector.url+"/images/conversion-calc.jpg",alt:l("Calculator Form","formidable")}))))}})},776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=a(r(752)),l=a(r(697));function a(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var s=wp.i18n.__,u=function(e){function t(){return i(this,t),c(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,wp.element.Component),n(t,[{key:"render",value:function(){var e=this.props,t=e.formId,r=e.setAttributes,n=e.forms;return wp.element.createElement(o.default,{selected:t,itemName:s("form","formidable"),itemNamePlural:s("forms","formidable"),items:n,onChange:function(e){r({formId:e})}})}}]),t}();t.default=u,u.propTypes={formId:l.default.string,setAttributes:l.default.func.isRequired}},350:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(897);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var i=function(e){function t(){return l(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,wp.element.Component),n(t,[{key:"render",value:function(){return wp.element.createElement("div",null,"[formidable",(t=(e=this.props).formId,r=e.title,n=e.description,l=e.minimize,a="",a+=(0,o.setTextAttribute)(t,"id"),a+=(0,o.setTextAttribute)(r,"title"),(a+=(0,o.setTextAttribute)(n,"description"))+(0,o.setTextAttribute)(l,"minimize")),"]");var e,t,r,n,l,a}}]),t}();t.default=i},3:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=c(r(697)),l=c(r(776)),a=c(r(350)),i=r(897);function c(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var f=wp.i18n.__,m=wp.element.Component,p=wp.blockEditor.InspectorControls,b=wp.components,d=b.PanelBody,w=b.PanelRow,y=b.ToggleControl,h=b.ExternalLink,v=function(e){function t(){return s(this,t),u(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"render",value:function(){var e=this.props,t=e.setAttributes,r=e.attributes,n=e.forms,o=r.formId,c=r.title,s=r.description,u=r.minimize;return wp.element.createElement(p,null,wp.element.createElement(d,{title:f("Select Form","formidable"),initialOpen:!0},wp.element.createElement(w,null,wp.element.createElement(l.default,{formId:o,setAttributes:t,forms:n})),o&&wp.element.createElement(w,null,wp.element.createElement(h,{href:(0,i.getSubDir)()+"wp-admin/admin.php?page=formidable&frm_action=edit&id="+o},f("Go to form","formidable")))),wp.element.createElement(d,{title:f("Options","formidable"),initialOpen:!1},wp.element.createElement(y,{label:f("Show Form Title","formidable"),checked:c,onChange:function(e){(0,i.updateAttribute)("title",e?"1":"",t)}}),wp.element.createElement(y,{label:f("Show Form Description","formidable"),checked:s,onChange:function(e){(0,i.updateAttribute)("description",e?"1":"",t)}}),wp.element.createElement(y,{label:f("Minimize HTML","formidable"),checked:u,onChange:function(e){(0,i.updateAttribute)("minimize",e?"1":"",t)}})),wp.element.createElement(d,{title:f("Shortcode","formidable"),initialOpen:!1},wp.element.createElement(w,null,wp.element.createElement(a.default,this.props.attributes))))}}]),t}(m);t.default=v,v.propTypes={attributes:o.default.object,setAttributes:o.default.func}},703:(e,t,r)=>{"use strict";var n=r(414);function o(){}function l(){}l.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,l,a){if(a!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:o};return r.PropTypes=r,r}},697:(e,t,r)=>{e.exports=r(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,r),l.exports}(()=>{"use strict";r(186),r(264)})()})();
languages/formidable.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Formidable Forms plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Formidable Forms 5.5.3.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/formidable\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2022-11-03T16:12:50+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.6.0\n"
15
  "X-Domain: formidable\n"
@@ -229,7 +229,7 @@ msgid "Applications"
229
  msgstr ""
230
 
231
  #: classes/controllers/FrmEntriesController.php:79
232
- #: classes/controllers/FrmFormsController.php:1456
233
  #: classes/views/frm-entries/form.php:69
234
  #: classes/views/frm-entries/sidebar-shared.php:57
235
  msgid "Entry Key"
@@ -261,21 +261,21 @@ msgstr ""
261
  msgid "Entry update date"
262
  msgstr ""
263
 
264
- #: classes/controllers/FrmEntriesController.php:417
265
  msgid "Your import is complete"
266
  msgstr ""
267
 
268
  #. translators: %1$s: Time string
269
- #: classes/controllers/FrmEntriesController.php:429
270
  msgid "This form is in the trash and is scheduled to be deleted permanently in %s along with any entries."
271
  msgstr ""
272
 
273
- #: classes/controllers/FrmEntriesController.php:448
274
  msgid "You are trying to view an entry that does not exist."
275
  msgstr ""
276
 
277
- #: classes/controllers/FrmEntriesController.php:476
278
- msgid "Entry was Successfully Deleted"
279
  msgstr ""
280
 
281
  #: classes/controllers/FrmFieldsController.php:330
@@ -349,7 +349,7 @@ msgid "Settings Successfully Updated"
349
  msgstr ""
350
 
351
  #: classes/controllers/FrmFormsController.php:179
352
- #: classes/controllers/FrmFormsController.php:1086
353
  msgid "Form was successfully updated."
354
  msgstr ""
355
 
@@ -449,207 +449,207 @@ msgid "Actions"
449
  msgstr ""
450
 
451
  #: classes/controllers/FrmFormsController.php:867
452
- #: classes/models/FrmField.php:87
453
  msgid "Date"
454
  msgstr ""
455
 
456
- #: classes/controllers/FrmFormsController.php:992
457
  #: classes/helpers/FrmFormsHelper.php:1317
458
  msgid "My Templates"
459
  msgstr ""
460
 
461
- #: classes/controllers/FrmFormsController.php:1051
462
  msgid "You are trying to edit a form that does not exist."
463
  msgstr ""
464
 
465
  #. translators: %1$s: Start link HTML, %2$s: End link HTML
466
- #: classes/controllers/FrmFormsController.php:1056
467
  msgid "You are trying to edit a child form. Please edit from %1$shere%2$s"
468
  msgstr ""
469
 
470
- #: classes/controllers/FrmFormsController.php:1088
471
  msgid "Template was successfully updated."
472
  msgstr ""
473
 
474
- #: classes/controllers/FrmFormsController.php:1112
475
  msgid "Form was Successfully Copied"
476
  msgstr ""
477
 
478
- #: classes/controllers/FrmFormsController.php:1177
479
  #: classes/controllers/FrmStylesController.php:403
480
  msgid "General"
481
  msgstr ""
482
 
483
- #: classes/controllers/FrmFormsController.php:1178
484
  msgid "General Form Settings"
485
  msgstr ""
486
 
487
- #: classes/controllers/FrmFormsController.php:1183
488
  msgid "Actions & Notifications"
489
  msgstr ""
490
 
491
- #: classes/controllers/FrmFormsController.php:1189
492
- #: classes/controllers/FrmFormsController.php:1194
493
  msgid "Form Permissions"
494
  msgstr ""
495
 
496
- #: classes/controllers/FrmFormsController.php:1195
497
  msgid "Allow editing, protect forms and files, limit entries, and save drafts. Upgrade to get form and entry permissions."
498
  msgstr ""
499
 
500
- #: classes/controllers/FrmFormsController.php:1200
501
  msgid "Form Scheduling"
502
  msgstr ""
503
 
504
- #: classes/controllers/FrmFormsController.php:1205
505
  msgid "Form scheduling settings"
506
  msgstr ""
507
 
508
- #: classes/controllers/FrmFormsController.php:1210
509
  msgid "Styling & Buttons"
510
  msgstr ""
511
 
512
- #: classes/controllers/FrmFormsController.php:1216
513
  msgid "Form Landing Page"
514
  msgstr ""
515
 
516
- #: classes/controllers/FrmFormsController.php:1222
517
- #: classes/controllers/FrmFormsController.php:1228
518
  msgid "Conversational Forms"
519
  msgstr ""
520
 
521
- #: classes/controllers/FrmFormsController.php:1229
522
  msgid "Ask one question at a time for automated conversations."
523
  msgstr ""
524
 
525
- #: classes/controllers/FrmFormsController.php:1235
526
  msgid "Customize HTML"
527
  msgstr ""
528
 
529
- #: classes/controllers/FrmFormsController.php:1371
530
  msgid "Customize field values with the following parameters."
531
  msgstr ""
532
 
533
- #: classes/controllers/FrmFormsController.php:1409
534
  msgid "Separator"
535
  msgstr ""
536
 
537
- #: classes/controllers/FrmFormsController.php:1410
538
  msgid "Use a different separator for checkbox fields"
539
  msgstr ""
540
 
541
- #: classes/controllers/FrmFormsController.php:1413
542
  msgid "Date Format"
543
  msgstr ""
544
 
545
- #: classes/controllers/FrmFormsController.php:1416
546
- #: classes/views/frm-fields/back-end/settings.php:27
547
  msgid "Field Label"
548
  msgstr ""
549
 
550
- #: classes/controllers/FrmFormsController.php:1419
551
  msgid "No Auto P"
552
  msgstr ""
553
 
554
- #: classes/controllers/FrmFormsController.php:1420
555
  msgid "Do not automatically add any paragraphs or line breaks"
556
  msgstr ""
557
 
558
- #: classes/controllers/FrmFormsController.php:1435
559
- #: classes/models/FrmField.php:62
560
  msgid "User ID"
561
  msgstr ""
562
 
563
- #: classes/controllers/FrmFormsController.php:1436
564
  msgid "First Name"
565
  msgstr ""
566
 
567
- #: classes/controllers/FrmFormsController.php:1437
568
  msgid "Last Name"
569
  msgstr ""
570
 
571
- #: classes/controllers/FrmFormsController.php:1438
572
  msgid "Display Name"
573
  msgstr ""
574
 
575
- #: classes/controllers/FrmFormsController.php:1439
576
  msgid "User Login"
577
  msgstr ""
578
 
579
- #: classes/controllers/FrmFormsController.php:1440
580
- #: classes/models/FrmField.php:34
581
  msgid "Email"
582
  msgstr ""
583
 
584
- #: classes/controllers/FrmFormsController.php:1441
585
  msgid "Avatar"
586
  msgstr ""
587
 
588
- #: classes/controllers/FrmFormsController.php:1442
589
  msgid "Author Link"
590
  msgstr ""