Formidable Forms – Form Builder for WordPress - Version 3.03.03

Version Description

  • Improve the appearance of the import/export page
  • Move the admin menu position below the post comments
  • Remove unused CSS including CSS for login forms in the user registration plugin
  • Override theme styling for box shadows on inputs
  • Add a new migrator class that will serve as a base for migrations from other form builder plugins
  • Add a prepare_field_value function for altering the value show inside a form field that can be overridden in extension classes for fields
Download this release

Release Info

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

Code changes from version 3.03.02 to 3.03.03

classes/controllers/FrmAppController.php CHANGED
@@ -13,15 +13,7 @@ class FrmAppController {
13
  }
14
 
15
  private static function get_menu_position() {
16
- $query = array(
17
- 'show_ui' => true,
18
- '_builtin' => false,
19
- 'show_in_menu' => true,
20
- );
21
- $count = count( get_post_types( $query ) );
22
- $pos = $count ? '22.7' : '29.3';
23
- $pos = apply_filters( 'frm_menu_position', $pos );
24
- return $pos;
25
  }
26
 
27
  /**
13
  }
14
 
15
  private static function get_menu_position() {
16
+ return apply_filters( 'frm_menu_position', '29.3' );
 
 
 
 
 
 
 
 
17
  }
18
 
19
  /**
classes/helpers/FrmAppHelper.php CHANGED
@@ -11,7 +11,7 @@ class FrmAppHelper {
11
  /**
12
  * @since 2.0
13
  */
14
- public static $plug_version = '3.03.02';
15
 
16
  /**
17
  * @since 1.07.02
11
  /**
12
  * @since 2.0
13
  */
14
+ public static $plug_version = '3.03.03';
15
 
16
  /**
17
  * @since 1.07.02
classes/models/FrmAddon.php CHANGED
@@ -269,7 +269,7 @@ class FrmAddon {
269
  }
270
 
271
  $response = $this->get_license_status();
272
- if ( 'revoked' === $response['status'] ) {
273
  $this->clear_license();
274
  }
275
  }
269
  }
270
 
271
  $response = $this->get_license_status();
272
+ if ( 'revoked' === $response['status'] || 'blocked' === $response['status'] || 'disabled' === $response['status'] ) {
273
  $this->clear_license();
274
  }
275
  }
classes/models/FrmFormMigrator.php ADDED
@@ -0,0 +1,394 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ abstract class FrmFormMigrator {
4
+
5
+ public $source_active;
6
+
7
+ public $slug;
8
+ public $path;
9
+ public $name;
10
+
11
+ public $response = array();
12
+ public $tracking = 'frm_forms_imported';
13
+
14
+ /**
15
+ * Define required properties.
16
+ */
17
+ public function __construct() {
18
+ if ( ! is_admin() ) {
19
+ return;
20
+ }
21
+
22
+ $this->source_active = is_plugin_active( $this->path );
23
+ if ( ! $this->source_active ) {
24
+ // if source plugin is not installed, do nothing
25
+ return;
26
+ }
27
+
28
+ $this->maybe_add_to_import_page();
29
+
30
+ $this->response = array(
31
+ 'upgrade_omit' => array(),
32
+ 'unsupported' => array(),
33
+ );
34
+ }
35
+
36
+ private function maybe_add_to_import_page() {
37
+ $menu_name = sanitize_title( FrmAppHelper::get_menu_name() );
38
+ add_action( $menu_name . '_page_formidable-import', array( $this, 'import_page' ), 1 );
39
+ add_action( 'wp_ajax_frm_import_' . $this->slug, array( $this, 'import_forms' ) );
40
+ }
41
+
42
+ public function import_page() {
43
+ ?>
44
+ <div class="wrap">
45
+ <div class="welcome-panel" id="welcome-panel">
46
+ <h2><?php echo esc_html( $this->name ); ?> Importer</h2>
47
+ <div class="welcome-panel-content" style="text-align:center;margin-bottom:10px;">
48
+ <p class="about-description">
49
+ Import forms and settings automatically from <?php echo esc_html( $this->name ); ?>. <br/>
50
+ Select the forms to import.
51
+ </p>
52
+ <form id="frm_form_importer" method="post" action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>">
53
+ <?php wp_nonce_field( 'nonce', 'frm_ajax' ); ?>
54
+ <input type="hidden" name="slug" value="<?php echo esc_attr( $this->slug ); ?>" />
55
+ <input type="hidden" name="action" value="frm_import_<?php echo esc_attr( $this->slug ); ?>" />
56
+ <div style="margin:10px auto;max-width:400px;text-align:left;">
57
+ <?php foreach ( $this->get_forms() as $form_id => $name ) { ?>
58
+ <p>
59
+ <label>
60
+ <input type="checkbox" name="form_id[]" value="<?php echo esc_attr( $form_id ); ?>" checked="checked" />
61
+ <?php
62
+ echo esc_html( $name );
63
+ $new_form_id = $this->is_imported( $form_id );
64
+ ?>
65
+ <?php if ( $new_form_id ) { ?>
66
+ (<a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable&frm_action=edit&id=' . $new_form_id ) ); ?>">previously imported</a>)
67
+ <?php } ?>
68
+ </label>
69
+ </p>
70
+ <?php } ?>
71
+ </div>
72
+ <button type="submit" class="button button-primary button-hero">Start Import</button>
73
+ </form>
74
+ <div id="frm-importer-process" class="frm_hidden">
75
+
76
+ <p class="process-count">
77
+ <i class="fa fa-spinner fa-spin" aria-hidden="true"></i>
78
+ Importing <span class="form-current">1</span> of <span class="form-total">0</span> forms from <?php echo esc_html( $this->name ); ?>.
79
+ </p>
80
+
81
+ <p class="process-completed" class="frm_hidden">
82
+ The import process has finished! We have successfully imported <span class="forms-completed"></span> forms. You can review the results below.
83
+ </p>
84
+
85
+ <div class="status"></div>
86
+
87
+ </div>
88
+ </div>
89
+ </div>
90
+ </div>
91
+ <?php
92
+ }
93
+
94
+ /**
95
+ * Import all forms using ajax
96
+ */
97
+ public function import_forms() {
98
+
99
+ check_ajax_referer( 'frm_ajax', 'nonce' );
100
+ FrmAppHelper::permission_check( 'frm_edit_forms' );
101
+
102
+ $forms = FrmAppHelper::get_simple_request(
103
+ array(
104
+ 'param' => 'form_id',
105
+ 'type' => 'post',
106
+ 'sanitize' => 'absint',
107
+ )
108
+ );
109
+
110
+ if ( is_array( $forms ) ) {
111
+ $imported = array();
112
+ foreach ( (array) $forms as $form_id ) {
113
+ $imported[] = $this->import_form( $form_id );
114
+ }
115
+ } else {
116
+ $imported = $this->import_form( $forms );
117
+ }
118
+
119
+ wp_send_json_success( $imported );
120
+ }
121
+
122
+ /**
123
+ * Import a single form
124
+ */
125
+ protected function import_form( $source_id ) {
126
+
127
+ $source_form = $this->get_form( $source_id );
128
+ $source_form_name = $this->get_form_name( $source_form );
129
+ $source_fields = $this->get_form_fields( $source_id );
130
+
131
+ // If form does not contain fields, bail.
132
+ if ( empty( $source_fields ) ) {
133
+ wp_send_json_success(
134
+ array(
135
+ 'error' => true,
136
+ 'name' => esc_html( $source_form_name ),
137
+ 'msg' => __( 'No form fields found.', 'formidable' ),
138
+ )
139
+ );
140
+ }
141
+
142
+ $form = $this->prepare_new_form( $source_id, $source_form_name );
143
+
144
+ $this->prepare_fields( $source_fields, $form );
145
+
146
+ $this->prepare_form( $source_form, $form );
147
+
148
+ return $this->add_form( $form );
149
+ }
150
+
151
+ protected function prepare_new_form( $source_id, $source_form_name ) {
152
+ return array(
153
+ 'import_form_id' => $source_id,
154
+ 'fields' => array(),
155
+ 'name' => $source_form_name,
156
+ 'description' => '',
157
+ 'options' => array(),
158
+ 'actions' => array(),
159
+ );
160
+ }
161
+
162
+ protected function prepare_form( $form, &$new_form ) {
163
+ // customize this function
164
+ }
165
+
166
+ protected function prepare_fields( $fields, &$form ) {
167
+ $field_order = 1;
168
+ foreach ( $fields as $field ) {
169
+
170
+ $label = $this->get_field_label( $field );
171
+ $type = $this->get_field_type( $field );
172
+
173
+ // check if field is unsupported. If unsupported make note and continue
174
+ if ( $this->is_unsupported_field( $type ) ) {
175
+ $this->response['unsupported'][] = $label;
176
+ continue;
177
+ }
178
+
179
+ if ( $this->should_skip_field( $type ) ) {
180
+ $this->response['upgrade_omit'][] = $label;
181
+ continue;
182
+ }
183
+
184
+ $new_field = FrmFieldsHelper::setup_new_vars( $this->convert_field_type( $type ) );
185
+ $new_field['name'] = $label;
186
+ $new_field['field_order'] = $field_order;
187
+ $new_field['original'] = $type;
188
+
189
+ $this->prepare_field( $field, $new_field );
190
+ $form['fields'][] = $new_field;
191
+
192
+ $field_order++;
193
+ }
194
+ }
195
+
196
+ protected function prepare_field( $field, &$new_field ) {
197
+ // customize this function
198
+ }
199
+
200
+ protected function convert_field_type( $type ) {
201
+ return $type;
202
+ }
203
+
204
+ /**
205
+ * Add the new form to the database and return AJAX data.
206
+ *
207
+ * @since 1.4.2
208
+ *
209
+ * @param array $form Form to import.
210
+ * @param array $upgrade_omit No field alternative
211
+ */
212
+ private function add_form( $form, $upgrade_omit = array() ) {
213
+
214
+ // Create empty form so we have an ID to work with.
215
+ $form_id = FrmForm::create(
216
+ array(
217
+ 'name' => $form['name'],
218
+ 'description' => $form['description'],
219
+ 'options' => $form['options'],
220
+ 'form_key' => $form['name'],
221
+ 'status' => 'published',
222
+ )
223
+ );
224
+
225
+ if ( empty( $form_id ) ) {
226
+ return array(
227
+ 'error' => true,
228
+ 'name' => sanitize_text_field( $form['settings']['form_title'] ),
229
+ 'msg' => esc_html__( 'There was an error while creating a new form.', 'formidable' ),
230
+ );
231
+ }
232
+
233
+ foreach ( $form['fields'] as $key => $new_field ) {
234
+ $new_field['form_id'] = $form_id;
235
+ $form['fields'][ $key ]['id'] = FrmField::create( $new_field );
236
+ }
237
+
238
+ // create emails
239
+ foreach ( $form['actions'] as $action ) {
240
+ $action_control = FrmFormActionsController::get_form_actions( $action['type'] );
241
+ unset( $action['type'] );
242
+ $new_action = $action_control->prepare_new( $form_id );
243
+ foreach ( $action as $key => $value ) {
244
+ if ( $key === 'post_title' ) {
245
+ $new_action->post_title = $value;
246
+ } else {
247
+ $new_action->post_content[ $key ] = $this->replace_smart_tags( $value, $form['fields'] );
248
+ }
249
+ }
250
+
251
+ $action_control->save_settings( $new_action );
252
+ }
253
+
254
+ $this->track_import( $form['import_form_id'], $form_id );
255
+
256
+ // Build and send final AJAX response!
257
+ return array(
258
+ 'name' => $form['name'],
259
+ 'id' => $form_id,
260
+ 'link' => esc_url_raw( admin_url( 'admin.php?page=formidable&frm_action=edit&id=' . $form_id ) ),
261
+ 'upgrade_omit' => $this->response['upgrade_omit'],
262
+ );
263
+ }
264
+
265
+ /**
266
+ * After a form has been successfully imported we track it, so that in the
267
+ * future we can alert users if they try to import a form that has already
268
+ * been imported.
269
+ *
270
+ * @param int $source_id Imported plugin form ID
271
+ * @param int $new_form_id Formidable form ID
272
+ */
273
+ private function track_import( $source_id, $new_form_id ) {
274
+
275
+ $imported = $this->get_tracked_import();
276
+
277
+ $imported[ $this->slug ][ $new_form_id ] = $source_id;
278
+
279
+ update_option( $this->tracking, $imported, false );
280
+ }
281
+
282
+ /**
283
+ * @return array
284
+ */
285
+ private function get_tracked_import() {
286
+ return get_option( $this->tracking, array() );
287
+ }
288
+
289
+ /**
290
+ * @param int $source_id Imported plugin form ID
291
+ *
292
+ * @return int the ID of the created form or 0
293
+ */
294
+ private function is_imported( $source_id ) {
295
+ $imported = $this->get_tracked_import();
296
+ $new_form_id = 0;
297
+ if ( isset( $imported[ $this->slug ] ) && in_array( $source_id, $imported[ $this->slug ] ) ) {
298
+ $new_form_id = array_search( $source_id, array_reverse( $imported[ $this->slug ], true ) );
299
+ }
300
+ return $new_form_id;
301
+ }
302
+
303
+ /** Start functions here that should be overridden **/
304
+
305
+ /**
306
+ * @return array
307
+ */
308
+ protected function unsupported_field_types() {
309
+ return array();
310
+ }
311
+
312
+ private function is_unsupported_field( $type ) {
313
+ $fields = $this->unsupported_field_types();
314
+ return in_array( $type, $fields, true );
315
+ }
316
+
317
+ /**
318
+ * Strict PRO fields with no Lite alternatives.
319
+ * @return array
320
+ */
321
+ protected function skip_pro_fields() {
322
+ return array();
323
+ }
324
+
325
+ private function should_skip_field( $type ) {
326
+ $skip_pro_fields = $this->skip_pro_fields();
327
+ return ( ! FrmAppHelper::pro_is_installed() && in_array( $type, $skip_pro_fields, true ) );
328
+ }
329
+
330
+ /**
331
+ * Replace 3rd-party form provider tags/shortcodes with our own Tags.
332
+ *
333
+ * @param string $string String to process the smart tag in.
334
+ * @param array $fields List of fields for the form.
335
+ *
336
+ * @return string
337
+ */
338
+ protected function replace_smart_tags( $string, $fields ) {
339
+ return $string;
340
+ }
341
+
342
+ /**
343
+ * Get ALL THE FORMS.
344
+ *
345
+ * @return array
346
+ */
347
+ public function get_forms() {
348
+ return array();
349
+ }
350
+
351
+ public function get_form( $id ) {
352
+ return array();
353
+ }
354
+
355
+ /**
356
+ * @param object|array $source_form
357
+ * @return string
358
+ */
359
+ protected function get_form_name( $source_form ) {
360
+ return __( 'Default Form', 'formidable' );
361
+ }
362
+
363
+ /**
364
+ * @param object|array|int $source_form
365
+ * @return array
366
+ */
367
+ protected function get_form_fields( $source_form ) {
368
+ return array();
369
+ }
370
+
371
+ /**
372
+ * @param object|array $field
373
+ * @return string
374
+ */
375
+ protected function get_field_type( $field ) {
376
+ return is_array( $field ) ? $field['type'] : $field->type;
377
+ }
378
+
379
+ /**
380
+ * @param object|array $field
381
+ *
382
+ * @return string
383
+ */
384
+ protected function get_field_label( $field ) {
385
+ $type = $this->get_field_type( $field );
386
+ $label = sprintf(
387
+ /* translators: %1$s - field type */
388
+ esc_html__( '%1$s Field', 'formidable' ),
389
+ ucfirst( $type )
390
+ );
391
+
392
+ return trim( $label );
393
+ }
394
+ }
classes/models/fields/FrmFieldType.php CHANGED
@@ -382,9 +382,22 @@ DEFAULT_HTML;
382
  * @return array
383
  */
384
  public function prepare_front_field( $values, $atts ) {
 
385
  return $values;
386
  }
387
 
 
 
 
 
 
 
 
 
 
 
 
 
388
  /**
389
  * @param array $values
390
  *
382
  * @return array
383
  */
384
  public function prepare_front_field( $values, $atts ) {
385
+ $values['value'] = $this->prepare_field_value( $values['value'], $atts );
386
  return $values;
387
  }
388
 
389
+ /**
390
+ * @since 3.03.03
391
+ *
392
+ * @param mixed $value
393
+ * @param array $atts
394
+ *
395
+ * @return mixed
396
+ */
397
+ public function prepare_field_value( $value, $atts ) {
398
+ return $value;
399
+ }
400
+
401
  /**
402
  * @param array $values
403
  *
classes/views/xml/import_form.php CHANGED
@@ -2,13 +2,12 @@
2
  <h1><?php esc_html_e( 'Import/Export', 'formidable' ); ?></h1>
3
 
4
  <?php include( FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php' ); ?>
5
- <div id="poststuff" class="metabox-holder">
6
- <div id="post-body">
7
- <div id="post-body-content">
8
 
9
  <div class="postbox ">
10
- <h3 class="hndle"><span><?php esc_html_e( 'Import', 'formidable' ) ?></span></h3>
11
  <div class="inside">
 
 
12
  <p class="howto"><?php echo esc_html( apply_filters( 'frm_upload_instructions1', __( 'Upload your Formidable XML file to import forms into this site. If your imported form key and creation date match a form on your site, that form will be updated.', 'formidable' ) ) ) ?></p>
13
  <br/>
14
  <form enctype="multipart/form-data" method="post">
@@ -33,8 +32,9 @@
33
  </div>
34
 
35
  <div class="postbox">
36
- <h3 class="hndle"><span><?php esc_html_e( 'Export', 'formidable' ) ?></span></h3>
37
  <div class="inside with_frm_style">
 
 
38
  <form method="post" action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" id="frm_export_xml">
39
  <input type="hidden" name="action" value="frm_export_xml" />
40
  <?php wp_nonce_field( 'export-xml-nonce', 'export-xml' ); ?>
@@ -118,6 +118,4 @@
118
  </div>
119
 
120
  </div>
121
- </div>
122
- </div>
123
  </div>
2
  <h1><?php esc_html_e( 'Import/Export', 'formidable' ); ?></h1>
3
 
4
  <?php include( FrmAppHelper::plugin_path() . '/classes/views/shared/errors.php' ); ?>
5
+ <div class="metabox-holder">
 
 
6
 
7
  <div class="postbox ">
 
8
  <div class="inside">
9
+ <h2><?php esc_html_e( 'Import', 'formidable' ); ?></h2>
10
+ <hr/>
11
  <p class="howto"><?php echo esc_html( apply_filters( 'frm_upload_instructions1', __( 'Upload your Formidable XML file to import forms into this site. If your imported form key and creation date match a form on your site, that form will be updated.', 'formidable' ) ) ) ?></p>
12
  <br/>
13
  <form enctype="multipart/form-data" method="post">
32
  </div>
33
 
34
  <div class="postbox">
 
35
  <div class="inside with_frm_style">
36
+ <h2><?php esc_html_e( 'Export', 'formidable' ); ?></h2>
37
+ <hr/>
38
  <form method="post" action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" id="frm_export_xml">
39
  <input type="hidden" name="action" value="frm_export_xml" />
40
  <?php wp_nonce_field( 'export-xml-nonce', 'export-xml' ); ?>
118
  </div>
119
 
120
  </div>
 
 
121
  </div>
css/_single_theme.css.php CHANGED
@@ -90,8 +90,7 @@ $arrow_icons = FrmStylesHelper::arrow_icons();
90
  margin-top:<?php echo esc_html( $field_margin . $important ) ?>;
91
  }
92
 
93
- .<?php echo esc_html( $style_class ) ?> label.frm_primary_label,
94
- .<?php echo esc_html( $style_class ) ?>.frm_login_form label{
95
  font-family:<?php echo FrmAppHelper::kses( $font ); // WPCS: XSS ok. ?>;
96
  font-size:<?php echo esc_html( $font_size . $important ) ?>;
97
  color:<?php echo esc_html( $label_color . $important ) ?>;
@@ -306,7 +305,7 @@ if ( ! empty( $important ) ) {
306
  box-sizing:border-box;
307
  outline:none<?php echo esc_html( $important ) ?>;
308
  font-weight:<?php echo esc_html( $field_weight ) ?>;
309
- box-shadow:<?php echo esc_html( ( isset( $remove_box_shadow ) && $remove_box_shadow ) ? 'none' : '0 1px 1px rgba(0, 0, 0, 0.075) inset' ) ?>;
310
  }
311
 
312
  .<?php echo esc_html( $style_class ) ?> input[type=text],
@@ -432,8 +431,7 @@ if ( ! empty( $important ) ) {
432
  .<?php echo esc_html( $style_class ) ?> input[type=submit],
433
  .<?php echo esc_html( $style_class ) ?> .frm_submit input[type=button],
434
  .<?php echo esc_html( $style_class ) ?> .frm_submit button,
435
- .frm_form_submit_style,
436
- .<?php echo esc_html( $style_class ) ?>.frm_login_form input[type=submit]{
437
  width:<?php echo esc_html( ( $submit_width == '' ? 'auto' : $submit_width ) . $important ) ?>;
438
  font-family:<?php echo FrmAppHelper::kses( $font ); // WPCS: XSS ok. ?>;
439
  font-size:<?php echo esc_html( $submit_font_size . $important ); ?>;
@@ -481,8 +479,7 @@ if ( ! empty( $important ) ) {
481
  <?php if ( empty( $submit_bg_img ) ) { ?>
482
  .<?php echo esc_html( $style_class ); ?> input[type=submit]:hover,
483
  .<?php echo esc_html( $style_class ); ?> .frm_submit input[type=button]:hover,
484
- .<?php echo esc_html( $style_class ); ?> .frm_submit button:hover,
485
- .<?php echo esc_html( $style_class ); ?>.frm_login_form input[type=submit]:hover{
486
  background: <?php echo esc_html( $submit_hover_bg_color . $important ) ?>;
487
  border-color: <?php echo esc_html( $submit_hover_border_color . $important ) ?>;
488
  color: <?php echo esc_html( $submit_hover_color . $important ) ?>;
@@ -495,11 +492,9 @@ if ( ! empty( $important ) ) {
495
  .<?php echo esc_html( $style_class ) ?> input[type=submit]:focus,
496
  .<?php echo esc_html( $style_class ) ?> .frm_submit input[type=button]:focus,
497
  .<?php echo esc_html( $style_class ) ?> .frm_submit button:focus,
498
- .<?php echo esc_html( $style_class ) ?>.frm_login_form input[type=submit]:focus,
499
  .<?php echo esc_html( $style_class ) ?> input[type=submit]:active,
500
  .<?php echo esc_html( $style_class ) ?> .frm_submit input[type=button]:active,
501
- .<?php echo esc_html( $style_class ) ?> .frm_submit button:active,
502
- .<?php echo esc_html( $style_class ) ?>.frm_login_form input[type=submit]:active{
503
  background: <?php echo esc_html( $submit_active_bg_color . $important ) ?>;
504
  border-color: <?php echo esc_html( $submit_active_border_color . $important ) ?>;
505
  color: <?php echo esc_html( $submit_active_color . $important ) ?>;
90
  margin-top:<?php echo esc_html( $field_margin . $important ) ?>;
91
  }
92
 
93
+ .<?php echo esc_html( $style_class ) ?> label.frm_primary_label{
 
94
  font-family:<?php echo FrmAppHelper::kses( $font ); // WPCS: XSS ok. ?>;
95
  font-size:<?php echo esc_html( $font_size . $important ) ?>;
96
  color:<?php echo esc_html( $label_color . $important ) ?>;
305
  box-sizing:border-box;
306
  outline:none<?php echo esc_html( $important ) ?>;
307
  font-weight:<?php echo esc_html( $field_weight ) ?>;
308
+ box-shadow:<?php echo esc_html( ( isset( $remove_box_shadow ) && $remove_box_shadow ) ? 'none' : '0 1px 1px rgba(0, 0, 0, 0.075) inset' ) . esc_html( $important ) ?>;
309
  }
310
 
311
  .<?php echo esc_html( $style_class ) ?> input[type=text],
431
  .<?php echo esc_html( $style_class ) ?> input[type=submit],
432
  .<?php echo esc_html( $style_class ) ?> .frm_submit input[type=button],
433
  .<?php echo esc_html( $style_class ) ?> .frm_submit button,
434
+ .frm_form_submit_style{
 
435
  width:<?php echo esc_html( ( $submit_width == '' ? 'auto' : $submit_width ) . $important ) ?>;
436
  font-family:<?php echo FrmAppHelper::kses( $font ); // WPCS: XSS ok. ?>;
437
  font-size:<?php echo esc_html( $submit_font_size . $important ); ?>;
479
  <?php if ( empty( $submit_bg_img ) ) { ?>
480
  .<?php echo esc_html( $style_class ); ?> input[type=submit]:hover,
481
  .<?php echo esc_html( $style_class ); ?> .frm_submit input[type=button]:hover,
482
+ .<?php echo esc_html( $style_class ); ?> .frm_submit button:hover{
 
483
  background: <?php echo esc_html( $submit_hover_bg_color . $important ) ?>;
484
  border-color: <?php echo esc_html( $submit_hover_border_color . $important ) ?>;
485
  color: <?php echo esc_html( $submit_hover_color . $important ) ?>;
492
  .<?php echo esc_html( $style_class ) ?> input[type=submit]:focus,
493
  .<?php echo esc_html( $style_class ) ?> .frm_submit input[type=button]:focus,
494
  .<?php echo esc_html( $style_class ) ?> .frm_submit button:focus,
 
495
  .<?php echo esc_html( $style_class ) ?> input[type=submit]:active,
496
  .<?php echo esc_html( $style_class ) ?> .frm_submit input[type=button]:active,
497
+ .<?php echo esc_html( $style_class ) ?> .frm_submit button:active{
 
498
  background: <?php echo esc_html( $submit_active_bg_color . $important ) ?>;
499
  border-color: <?php echo esc_html( $submit_active_border_color . $important ) ?>;
500
  color: <?php echo esc_html( $submit_active_color . $important ) ?>;
css/custom_theme.css.php CHANGED
@@ -862,65 +862,6 @@ select.frm_loading_lookup{
862
  display:block;
863
  }
864
 
865
- /* Login form */
866
- .with_frm_style.frm_login_form,
867
- .with_frm_style.frm_login_form form{
868
- clear:both;
869
- }
870
-
871
- .with_frm_style.frm_login_form.frm_inline_login .login-remember input{
872
- vertical-align:baseline;
873
- }
874
-
875
- .with_frm_style.frm_login_form.frm_inline_login .login-submit{
876
- float:left;
877
- }
878
-
879
- .with_frm_style.frm_login_form.frm_inline_login label{
880
- display:inline;
881
- }
882
-
883
- .with_frm_style.frm_login_form.frm_inline_login .login-username,
884
- .with_frm_style.frm_login_form.frm_inline_login .login-password,
885
- .with_frm_style.frm_login_form.frm_inline_login .login-remember{
886
- float:left;
887
- margin-right:5px;
888
- }
889
-
890
- .with_frm_style.frm_login_form.frm_inline_login form{
891
- position:relative;
892
- clear:none;
893
- }
894
-
895
- .with_frm_style.frm_login_form.frm_inline_login .login-remember{
896
- position:absolute;
897
- top:35px;
898
- }
899
-
900
- .with_frm_style.frm_login_form.frm_inline_login input[type=submit]{
901
- margin:0 !important;
902
- }
903
-
904
- .with_frm_style.frm_login_form.frm_no_labels .login-username label,
905
- .with_frm_style.frm_login_form.frm_no_labels .login-password label{
906
- display:none;
907
- }
908
-
909
- .with_frm_style .frm-open-login{
910
- float:left;
911
- margin-right:15px;
912
- }
913
-
914
- .with_frm_style .frm-open-login a{
915
- text-decoration:none;
916
- border:none;
917
- outline:none;
918
- }
919
-
920
- .with_frm_style.frm_slide.frm_login_form form{
921
- display:none;
922
- }
923
-
924
  /* Fonts */
925
  @font-face {
926
  font-family:'s11-fp';
@@ -963,19 +904,6 @@ select.frm_loading_lookup{
963
  max-width:220px;
964
  }
965
 
966
- .with_frm_style.frm_login_form.frm_inline_login p{
967
- clear:both;
968
- float:none;
969
- }
970
-
971
- .with_frm_style.frm_login_form.frm_inline_login form{
972
- position:static;
973
- }
974
-
975
- .with_frm_style.frm_login_form.frm_inline_login .login-remember{
976
- position:static;
977
- }
978
-
979
  .with_frm_style .frm-g-recaptcha > div > div,
980
  .with_frm_style .g-recaptcha > div > div{
981
  width:inherit !important;
862
  display:block;
863
  }
864
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
865
  /* Fonts */
866
  @font-face {
867
  font-family:'s11-fp';
904
  max-width:220px;
905
  }
906
 
 
 
 
 
 
 
 
 
 
 
 
 
 
907
  .with_frm_style .frm-g-recaptcha > div > div,
908
  .with_frm_style .g-recaptcha > div > div{
909
  width:inherit !important;
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: 3.03.02
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11
2
  /*
3
  Plugin Name: Formidable Forms
4
  Description: Quickly and easily create drag-and-drop forms
5
+ Version: 3.03.03
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11
js/formidable_admin.js CHANGED
@@ -6,6 +6,9 @@ function frmAdminBuildJS(){
6
  var $newFields = jQuery(document.getElementById('new_fields'));
7
  var this_form_id = jQuery(document.getElementById('form_id')).val();
8
  var cancelSort = false;
 
 
 
9
 
10
  function showElement(element){
11
  element[0].style.display = '';
@@ -2755,6 +2758,96 @@ function frmAdminBuildJS(){
2755
  }
2756
 
2757
  /* Import/Export page */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2758
  function validateExport(e){
2759
  /*jshint validthis:true */
2760
  e.preventDefault();
@@ -2888,6 +2981,8 @@ function frmAdminBuildJS(){
2888
 
2889
  return{
2890
  init: function(){
 
 
2891
  // Bootstrap dropdown button
2892
  jQuery('.wp-admin').click(function(e){
2893
  var t = jQuery(e.target);
@@ -3440,6 +3535,7 @@ function frmAdminBuildJS(){
3440
  },
3441
 
3442
  exportInit: function(){
 
3443
  jQuery(document.getElementById('frm_export_xml')).submit(validateExport);
3444
  jQuery('#frm_export_xml input, #frm_export_xml select').change(removeExportError);
3445
  jQuery('input[name="frm_import_file"]').change(checkCSVExtension);
6
  var $newFields = jQuery(document.getElementById('new_fields'));
7
  var this_form_id = jQuery(document.getElementById('form_id')).val();
8
  var cancelSort = false;
9
+
10
+ // Global settings
11
+ var s;
12
 
13
  function showElement(element){
14
  element[0].style.display = '';
2758
  }
2759
 
2760
  /* Import/Export page */
2761
+
2762
+ function startFormMigration( event ) {
2763
+ event.preventDefault();
2764
+
2765
+ var checkedBoxes = jQuery( '#frm_form_importer input:checked' );
2766
+ if ( checkedBoxes.length ) {
2767
+
2768
+ var ids = [];
2769
+ checkedBoxes.each( function ( i ) {
2770
+ ids[i] = this.value;
2771
+ });
2772
+
2773
+ // Begin the import process.
2774
+ importForms( ids );
2775
+ }
2776
+ }
2777
+
2778
+ /**
2779
+ * Begins the process of importing the forms.
2780
+ */
2781
+ function importForms( forms ) {
2782
+
2783
+ var $processSettings = jQuery( '#frm-importer-process' );
2784
+
2785
+ // Display total number of forms we have to import.
2786
+ $processSettings.find( '.form-total' ).text( forms.length );
2787
+ $processSettings.find( '.form-current' ).text( '1' );
2788
+
2789
+ // Hide the form select section.
2790
+ jQuery( '#frm_form_importer' ).hide();
2791
+
2792
+ // Show processing status.
2793
+ $processSettings.show();
2794
+ $processSettings.find( '.process-completed' ).hide();
2795
+
2796
+ // Create global import queue.
2797
+ s.importQueue = forms;
2798
+ s.imported = 0;
2799
+
2800
+ // Import the first form in the queue.
2801
+ importForm();
2802
+ }
2803
+
2804
+ /**
2805
+ * Imports a single form from the import queue.
2806
+ */
2807
+ function importForm() {
2808
+ var $processSettings = jQuery( '#frm-importer-process' ),
2809
+ formID = s.importQueue[0],
2810
+ provider = jQuery('input[name="slug"]').val(),
2811
+ data = {
2812
+ action: 'frm_import_' + provider,
2813
+ form_id: formID,
2814
+ nonce: frmGlobal.nonce
2815
+ };
2816
+
2817
+ // Trigger AJAX import for this form.
2818
+ jQuery.post( ajaxurl, data, function( res ) {
2819
+
2820
+ if ( res.success ){
2821
+ var statusUpdate;
2822
+
2823
+ if ( res.data.error ) {
2824
+ statusUpdate = '<p>' + res.data.name + ': ' + res.data.msg + '</p>';
2825
+ } else {
2826
+ statusUpdate = '<p>Imported <a href="' + res.data.link + '" target="_blank">' + res.data.name + '</a></p>';
2827
+ }
2828
+
2829
+ $processSettings.find( '.status' ).prepend( statusUpdate );
2830
+ $processSettings.find( '.status' ).show();
2831
+
2832
+ // Remove this form ID from the queue.
2833
+ s.importQueue = jQuery.grep(s.importQueue, function(value) {
2834
+ return value != formID;
2835
+ });
2836
+ s.imported++;
2837
+
2838
+ if ( s.importQueue.length === 0 ) {
2839
+ $processSettings.find( '.process-count' ).hide();
2840
+ $processSettings.find( '.forms-completed' ).text( s.imported );
2841
+ $processSettings.find( '.process-completed' ).show();
2842
+ } else {
2843
+ // Import next form in the queue.
2844
+ $processSettings.find( '.form-current' ).text( s.imported+1 );
2845
+ importForm();
2846
+ }
2847
+ }
2848
+ });
2849
+ }
2850
+
2851
  function validateExport(e){
2852
  /*jshint validthis:true */
2853
  e.preventDefault();
2981
 
2982
  return{
2983
  init: function(){
2984
+ s = {};
2985
+
2986
  // Bootstrap dropdown button
2987
  jQuery('.wp-admin').click(function(e){
2988
  var t = jQuery(e.target);
3535
  },
3536
 
3537
  exportInit: function(){
3538
+ jQuery('#frm_form_importer').submit( startFormMigration );
3539
  jQuery(document.getElementById('frm_export_xml')).submit(validateExport);
3540
  jQuery('#frm_export_xml input, #frm_export_xml select').change(removeExportError);
3541
  jQuery('input[name="frm_import_file"]').change(checkCSVExtension);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: contact form, form builder, custom form, forms, form, form maker, form cre
4
  Requires at least: 4.4
5
  Tested up to: 4.9.5
6
  Requires PHP: 5.3
7
- Stable tag: 3.03.02
8
 
9
  The best WordPress forms plugin for custom forms. Go beyond contact forms with a drag & drop form builder, HTML control & form style generator
10
 
@@ -160,6 +160,14 @@ The field and form names and descriptions are all changed with in-place edit. Ju
160
  [See more FAQs](https://formidableforms.com/formidable-faqs/ "Formidable Form FAQs")
161
 
162
  == Changelog ==
 
 
 
 
 
 
 
 
163
  = 3.03.02 =
164
  * Fix: When syntax highlighting was turned off in the user profile, the custom CSS box didn't appear.
165
  * Fix: Allow 'aside' tags in the form widget. Don't remove it when sanitizing.
4
  Requires at least: 4.4
5
  Tested up to: 4.9.5
6
  Requires PHP: 5.3
7
+ Stable tag: 3.03.03
8
 
9
  The best WordPress forms plugin for custom forms. Go beyond contact forms with a drag & drop form builder, HTML control & form style generator
10
 
160
  [See more FAQs](https://formidableforms.com/formidable-faqs/ "Formidable Form FAQs")
161
 
162
  == Changelog ==
163
+ = 3.03.03 =
164
+ * Improve the appearance of the import/export page
165
+ * Move the admin menu position below the post comments
166
+ * Remove unused CSS including CSS for login forms in the user registration plugin
167
+ * Override theme styling for box shadows on inputs
168
+ * Add a new migrator class that will serve as a base for migrations from other form builder plugins
169
+ * Add a prepare_field_value function for altering the value show inside a form field that can be overridden in extension classes for fields
170
+
171
  = 3.03.02 =
172
  * Fix: When syntax highlighting was turned off in the user profile, the custom CSS box didn't appear.
173
  * Fix: Allow 'aside' tags in the form widget. Don't remove it when sanitizing.