Formidable Forms – Form Builder for WordPress - Version 4.04.04

Version Description

  • Increased WP version requirement to 4.7.
  • Added more options on Import/Export page depending on what other plugins are installed.
  • More reliably add new options in fields when also reordering.
  • Fix: When a newly added option is set as the default value, save it correctly.
  • Added an easy way to install and SMTP plugin for better email deliverability.
Download this release

Release Info

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

Code changes from version 4.04.03 to 4.04.04

classes/controllers/FrmAppController.php CHANGED
@@ -279,23 +279,6 @@ class FrmAppController {
279
  remove_action( 'frm_after_settings', 'FrmSettingsController::settings_cta' );
280
  }
281
 
282
- /**
283
- * Don't nag people to install WPForms
284
- *
285
- * @since 3.05
286
- */
287
- public static function remove_wpforms_nag( $upsell ) {
288
- if ( is_array( $upsell ) ) {
289
- foreach ( $upsell as $k => $plugin ) {
290
- if ( strpos( $plugin['slug'], 'wpforms' ) !== false ) {
291
- unset( $upsell[ $k ] );
292
- }
293
- }
294
- }
295
-
296
- return $upsell;
297
- }
298
-
299
  /**
300
  * If there are CURL problems on this server, wp_remote_post won't work for installing
301
  * Use a javascript fallback instead.
279
  remove_action( 'frm_after_settings', 'FrmSettingsController::settings_cta' );
280
  }
281
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  /**
283
  * If there are CURL problems on this server, wp_remote_post won't work for installing
284
  * Use a javascript fallback instead.
classes/controllers/FrmHooksController.php CHANGED
@@ -92,7 +92,6 @@ class FrmHooksController {
92
  add_filter( 'plugin_action_links_' . FrmAppHelper::plugin_folder() . '/formidable.php', 'FrmAppController::settings_link' );
93
  add_filter( 'admin_footer_text', 'FrmAppController::set_footer_text' );
94
  add_action( 'wp_ajax_frm_dismiss_review', 'FrmAppController::dismiss_review' );
95
- add_action( 'wp_mail_smtp_core_recommendations_plugins', 'FrmAppController::remove_wpforms_nag' );
96
 
97
  // Addons Controller.
98
  add_action( 'admin_menu', 'FrmAddonsController::menu', 100 );
@@ -140,6 +139,10 @@ class FrmHooksController {
140
  add_action( 'enqueue_block_editor_assets', 'FrmSimpleBlocksController::block_editor_assets' );
141
 
142
  add_action( 'admin_init', 'FrmUsageController::schedule_send' );
 
 
 
 
143
  }
144
 
145
  public static function load_ajax_hooks() {
92
  add_filter( 'plugin_action_links_' . FrmAppHelper::plugin_folder() . '/formidable.php', 'FrmAppController::settings_link' );
93
  add_filter( 'admin_footer_text', 'FrmAppController::set_footer_text' );
94
  add_action( 'wp_ajax_frm_dismiss_review', 'FrmAppController::dismiss_review' );
 
95
 
96
  // Addons Controller.
97
  add_action( 'admin_menu', 'FrmAddonsController::menu', 100 );
139
  add_action( 'enqueue_block_editor_assets', 'FrmSimpleBlocksController::block_editor_assets' );
140
 
141
  add_action( 'admin_init', 'FrmUsageController::schedule_send' );
142
+
143
+ add_action( 'wp_ajax_frm_dismiss_migrator', 'FrmFormMigratorsHelper::dismiss_migrator' );
144
+
145
+ FrmSMTPController::load_hooks();
146
  }
147
 
148
  public static function load_ajax_hooks() {
classes/controllers/FrmSMTPController.php ADDED
@@ -0,0 +1,536 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * SMTP Sub-page.
5
+ *
6
+ * @since 4.04.04
7
+ */
8
+ class FrmSMTPController {
9
+
10
+ /**
11
+ * Admin menu page slug.
12
+ *
13
+ * @since 4.04.04
14
+ *
15
+ * @var string
16
+ */
17
+ private $slug = 'formidable-smtp';
18
+
19
+ /**
20
+ * @since 4.04.04
21
+ *
22
+ * @var array
23
+ */
24
+ private $config = array(
25
+ 'lite_plugin' => 'wp-mail-smtp/wp_mail_smtp.php',
26
+ 'lite_download_url' => 'https://downloads.wordpress.org/plugin/wp-mail-smtp.zip',
27
+ 'pro_plugin' => 'wp-mail-smtp-pro/wp_mail_smtp.php',
28
+ 'smtp_settings' => 'admin.php?page=wp-mail-smtp',
29
+ );
30
+
31
+ /**
32
+ * Runtime data used for generating page HTML.
33
+ *
34
+ * @since 4.04.04
35
+ *
36
+ * @var array
37
+ */
38
+ private $output_data = array();
39
+
40
+ /**
41
+ * Hooks.
42
+ *
43
+ * @since 4.04.04
44
+ */
45
+ public static function load_hooks() {
46
+
47
+ add_filter( 'wp_mail_smtp_is_white_labeled', '__return_true' );
48
+
49
+ $self = new self();
50
+ if ( wp_doing_ajax() ) {
51
+ add_action( 'wp_ajax_frm_smtp_page_check_plugin_status', array( $self, 'ajax_check_plugin_status' ) );
52
+ }
53
+
54
+ add_filter( 'wp_mail_smtp_core_get_upgrade_link', array( $self, 'link' ) );
55
+ add_action( 'admin_menu', array( $self, 'menu' ), 999 );
56
+ add_action( 'wp_mail_smtp_core_recommendations_plugins', 'FrmAppController::remove_wpforms_nag' );
57
+
58
+ // Only load if we are actually on the SMTP page.
59
+ if ( ! FrmAppHelper::is_admin_page( $self->slug ) ) {
60
+ return;
61
+ }
62
+
63
+ add_action( 'admin_init', array( $self, 'redirect_to_smtp_settings' ) );
64
+
65
+ // Hook for addons.
66
+ do_action( 'frm_admin_pages_smtp_hooks' );
67
+ }
68
+
69
+ /**
70
+ * Customize the upgrade link.
71
+ */
72
+ public function link( $link ) {
73
+ $new_link = 'formidableforms.com/go-wp-mail-smtp/?urllink=wpmailsmtp%2Ecom%2Flite%2Dupgrade&';
74
+ $link = str_replace( 'wpmailsmtp.com/lite-upgrade/?', $new_link, $link );
75
+ return $link;
76
+ }
77
+
78
+ /**
79
+ * Don't nag people to install WPForms
80
+ *
81
+ * @since 4.04.04
82
+ */
83
+ public static function remove_wpforms_nag( $upsell ) {
84
+ if ( is_array( $upsell ) ) {
85
+ foreach ( $upsell as $k => $plugin ) {
86
+ if ( strpos( $plugin['slug'], 'wpforms' ) !== false ) {
87
+ unset( $upsell[ $k ] );
88
+ }
89
+ }
90
+ }
91
+
92
+ return $upsell;
93
+ }
94
+
95
+ /**
96
+ * SMTP submenu page.
97
+ */
98
+ public function menu() {
99
+ add_submenu_page( 'formidable', __( 'SMTP', 'formidable' ) . ' | Formidable', __( 'SMTP', 'formidable' ), 'activate_plugins', $this->slug, array( $this, 'output' ) );
100
+ }
101
+
102
+ /**
103
+ * Generate and output page HTML.
104
+ *
105
+ * @since 4.04.04
106
+ */
107
+ public function output() {
108
+ FrmAppHelper::include_svg();
109
+ $this->css();
110
+
111
+ echo '<div id="frm-admin-smtp" class="wrap frm-wrap frm-admin-plugin-landing">';
112
+
113
+ $this->output_section_heading();
114
+ $this->output_section_screenshot();
115
+ $this->output_section_step_install();
116
+ $this->output_section_step_setup();
117
+
118
+ echo '</div>';
119
+ }
120
+
121
+ /**
122
+ * Generate and output heading section HTML.
123
+ *
124
+ * @since 4.04.04
125
+ */
126
+ protected function output_section_heading() {
127
+ $size = array(
128
+ 'height' => 90,
129
+ 'width' => 90,
130
+ );
131
+
132
+ // Heading section.
133
+ ?>
134
+ <section class="top">
135
+ <div class="frm-smtp-logos">
136
+ <?php
137
+ FrmAppHelper::show_logo( $size );
138
+ FrmAppHelper::icon_by_class(
139
+ 'frmfont frm_heart_solid_icon',
140
+ array(
141
+ 'aria-label' => 'Loves',
142
+ 'style' => 'width:30px;height:30px;margin:0 35px;',
143
+ 'color' => '#d11c25',
144
+ )
145
+ );
146
+ $this->stmp_logo();
147
+ ?>
148
+ </div>
149
+ <h1><?php esc_html_e( 'Making Email Deliverability Easy for WordPress', 'formidable' ); ?></h1>
150
+ <p><?php esc_html_e( 'WP Mail SMTP allows you to easily set up WordPress to use a trusted provider to reliably send emails, including form notifications.', 'formidable' ); ?></p>
151
+ </section>
152
+ <?php
153
+ }
154
+
155
+ /**
156
+ * Generate and output screenshot section HTML.
157
+ *
158
+ * @since 4.04.04
159
+ */
160
+ protected function output_section_screenshot() {
161
+
162
+ printf(
163
+ '<section class="screenshot">
164
+ <div class="cont">
165
+ <img src="%1$s" alt="%2$s"/>
166
+ </div>
167
+ <ul>
168
+ <li>%3$s %4$s</li>
169
+ <li>%3$s %5$s</li>
170
+ <li>%3$s %6$s</li>
171
+ <li>%3$s %7$s</li>
172
+ </ul>
173
+ </section>',
174
+ esc_url( FrmAppHelper::plugin_url() . '/images/smtp-screenshot-tnail.png' ),
175
+ esc_attr__( 'WP Mail SMTP screenshot', 'formidable' ),
176
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 492 492" width="14" height="14"><path d="M484 227L306 49a27 27 0 00-38 0l-16 16a27 27 0 000 38l104 105H27c-15 0-27 11-27 26v23c0 15 12 27 27 27h330L252 389a27 27 0 000 38l16 16a27 27 0 0038 0l178-178a27 27 0 000-38z" fill="#5bbfa5"/></svg> &nbsp;',
177
+ esc_html__( 'Over 1,000,000 websites use WP Mail SMTP.', 'formidable' ),
178
+ esc_html__( 'Send emails authenticated via trusted parties.', 'formidable' ),
179
+ esc_html__( 'Transactional Mailers: Pepipost, SendinBlue, Mailgun, SendGrid, Amazon SES.', 'formidable' ),
180
+ esc_html__( 'Web Mailers: Gmail, G Suite, Office 365, Outlook.com.', 'formidable' )
181
+ );
182
+ }
183
+
184
+ /**
185
+ * Generate and output step 'Install' section HTML.
186
+ *
187
+ * @since 4.04.04
188
+ */
189
+ protected function output_section_step_install() {
190
+
191
+ $step = $this->get_data_step_install();
192
+
193
+ if ( empty( $step ) ) {
194
+ return;
195
+ }
196
+
197
+ $icon = FrmAppHelper::icon_by_class(
198
+ 'frmfont ' . $step['icon'],
199
+ array(
200
+ 'aria-label' => __( 'Step 1', 'formidable' ),
201
+ 'echo' => false,
202
+ 'style' => 'width:50px;height:50px;',
203
+ )
204
+ );
205
+
206
+ /* translators: %s: Name of the plugin */
207
+ $label = sprintf( __( 'Install and Activate %s', 'formidable' ), 'WP Mail SMTP' );
208
+
209
+ printf(
210
+ '<section class="step step-install">
211
+ <aside class="num">
212
+ %1$s
213
+ <i class="loader hidden"></i>
214
+ </aside>
215
+ <div>
216
+ <h2>%2$s</h2>
217
+ <p>%3$s</p>
218
+ <span><a rel="%4$s" class="button button-primary frm-button-primary %5$s" aria-label="%6$s">%7$s</a></span>
219
+ </div>
220
+ </section>',
221
+ FrmAppHelper::kses( $icon, array( 'a', 'i', 'span', 'use', 'svg' ) ), // WPCS: XSS ok.
222
+ esc_html( $label ),
223
+ esc_html__( 'Install WP Mail SMTP from the WordPress.org plugin repository.', 'formidable' ),
224
+ esc_attr( $step['plugin'] ),
225
+ esc_attr( $step['button_class'] ),
226
+ esc_attr( $step['button_action'] ),
227
+ esc_html( $step['button_text'] )
228
+ ); // WPCS: XSS ok.
229
+ }
230
+
231
+ /**
232
+ * Generate and output step 'Setup' section HTML.
233
+ *
234
+ * @since 4.04.04
235
+ */
236
+ protected function output_section_step_setup() {
237
+
238
+ $step = $this->get_data_step_setup();
239
+
240
+ if ( empty( $step ) ) {
241
+ return;
242
+ }
243
+
244
+ $icon = FrmAppHelper::icon_by_class(
245
+ 'frmfont ' . $step['icon'],
246
+ array(
247
+ 'aria-label' => __( 'Step 2', 'formidable' ),
248
+ 'echo' => false,
249
+ 'style' => 'width:50px;height:50px;',
250
+ )
251
+ );
252
+
253
+ printf(
254
+ '<section class="step step-setup %1$s">
255
+ <aside class="num">
256
+ %2$s
257
+ <i class="loader hidden"></i>
258
+ </aside>
259
+ <div>
260
+ <h2>%3$s</h2>
261
+ <p>%4$s</p>
262
+ <span><a href="%5$s" class="button button-primary frm-button-primary %6$s">%7$s</a></span>
263
+ </div>
264
+ </section>',
265
+ esc_attr( $step['section_class'] ),
266
+ FrmAppHelper::kses( $icon, array( 'a', 'i', 'span', 'use', 'svg' ) ), // WPCS: XSS ok.
267
+ esc_html__( 'Set Up WP Mail SMTP', 'formidable' ),
268
+ esc_html__( 'Select and configure your mailer.', 'formidable' ),
269
+ esc_url( admin_url( $this->config['smtp_settings'] ) ),
270
+ esc_attr( $step['button_class'] ),
271
+ esc_html( $step['button_text'] )
272
+ ); // WPCS: XSS ok.
273
+ }
274
+
275
+ /**
276
+ * Step 'Install' data.
277
+ *
278
+ * @since 4.04.04
279
+ *
280
+ * @return array Step data.
281
+ */
282
+ protected function get_data_step_install() {
283
+
284
+ $lite_plugin = new FrmInstallPlugin( array( 'plugin_file' => $this->config['lite_plugin'] ) );
285
+ $pro_plugin = new FrmInstallPlugin( array( 'plugin_file' => $this->config['pro_plugin'] ) );
286
+
287
+ $this->output_data['plugin_installed'] = $lite_plugin->is_installed();
288
+ $this->output_data['pro_plugin_installed'] = $pro_plugin->is_installed();
289
+ $this->output_data['plugin_activated'] = false;
290
+ $this->output_data['plugin_setup'] = false;
291
+
292
+ $step = array(
293
+ 'icon' => 'frm_step1_icon',
294
+ 'button_action' => '',
295
+ );
296
+
297
+ $is_installed = $this->output_data['plugin_installed'] || $this->output_data['pro_plugin_installed'];
298
+ if ( ! $is_installed ) {
299
+ // Return the download url.
300
+ $step['button_text'] = __( 'Install WP Mail SMTP', 'formidable' );
301
+ $step['button_class'] = 'frm-install-addon';
302
+ $step['button_action'] = __( 'Install', 'formidable' );
303
+ $step['plugin'] = $this->config['lite_download_url'];
304
+ return $step;
305
+ }
306
+
307
+ $this->output_data['plugin_activated'] = $this->is_smtp_activated();
308
+ $this->output_data['plugin_setup'] = $this->is_smtp_configured();
309
+
310
+ $step['plugin'] = $this->output_data['pro_plugin_installed'] ? $this->config['pro_plugin'] : $this->config['lite_plugin'];
311
+
312
+ if ( $this->output_data['plugin_activated'] ) {
313
+ $step['icon'] = 'frm_step_complete_icon';
314
+ $step['button_text'] = __( 'WP Mail SMTP Installed & Activated', 'formidable' );
315
+ $step['button_class'] = 'grey disabled';
316
+ } else {
317
+ $step['button_text'] = __( 'Activate WP Mail SMTP', 'formidable' );
318
+ $step['button_class'] = 'frm-activate-addon';
319
+ $step['button_action'] = __( 'Activate', 'formidable' );
320
+ }
321
+
322
+ return $step;
323
+ }
324
+
325
+ /**
326
+ * Step 'Setup' data.
327
+ *
328
+ * @since 4.04.04
329
+ *
330
+ * @return array Step data.
331
+ */
332
+ protected function get_data_step_setup() {
333
+
334
+ $step = array();
335
+
336
+ $step['icon'] = 'frm_step2_icon';
337
+ $step['section_class'] = $this->output_data['plugin_activated'] ? '' : 'grey';
338
+ $step['button_text'] = esc_html__( 'Start Setup', 'formidable' );
339
+ $step['button_class'] = 'grey disabled';
340
+
341
+ if ( $this->output_data['plugin_setup'] ) {
342
+ $step['icon'] = 'frm_step_complete_icon';
343
+ $step['section_class'] = '';
344
+ $step['button_text'] = esc_html__( 'Go to SMTP settings', 'formidable' );
345
+ } elseif ( $this->output_data['plugin_activated'] ) {
346
+ $step['button_class'] = '';
347
+ }
348
+
349
+ return $step;
350
+ }
351
+
352
+ /**
353
+ * Whether WP Mail SMTP plugin configured or not.
354
+ *
355
+ * @since 4.04.04
356
+ *
357
+ * @return bool True if some mailer is selected and configured properly.
358
+ */
359
+ protected function is_smtp_configured() {
360
+
361
+ if ( ! $this->is_smtp_activated() ) {
362
+ return false;
363
+ }
364
+
365
+ $phpmailer = $this->get_phpmailer();
366
+
367
+ $mailer = WPMailSMTP\Options::init()->get( 'mail', 'mailer' );
368
+ $is_mailer_complete = wp_mail_smtp()->get_providers()->get_mailer( $mailer, $phpmailer )->is_mailer_complete();
369
+
370
+ return 'mail' !== $mailer && $is_mailer_complete;
371
+ }
372
+
373
+ /**
374
+ * Whether WP Mail SMTP plugin active or not.
375
+ *
376
+ * @since 4.04.04
377
+ *
378
+ * @return bool True if SMTP plugin is active.
379
+ */
380
+ protected function is_smtp_activated() {
381
+ return function_exists( 'wp_mail_smtp' ) && ( is_plugin_active( $this->config['lite_plugin'] ) || is_plugin_active( $this->config['pro_plugin'] ) );
382
+ }
383
+
384
+
385
+ /**
386
+ * Get $phpmailer instance.
387
+ *
388
+ * @since 4.04.04
389
+ *
390
+ * @return PHPMailer Instance of PHPMailer.
391
+ */
392
+ protected function get_phpmailer() {
393
+ global $phpmailer;
394
+
395
+ if ( ! is_object( $phpmailer ) || ! is_a( $phpmailer, 'PHPMailer' ) ) {
396
+ require_once ABSPATH . WPINC . '/class-phpmailer.php';
397
+ $phpmailer = new PHPMailer( true ); // phpcs:ignore
398
+ }
399
+
400
+ return $phpmailer;
401
+ }
402
+
403
+ /**
404
+ * Redirect to SMTP settings page if it is activated..
405
+ *
406
+ * @since 4.04.04
407
+ */
408
+ public function redirect_to_smtp_settings() {
409
+ if ( $this->is_smtp_configured() ) {
410
+ wp_safe_redirect( admin_url( $this->config['smtp_settings'] ) );
411
+ exit;
412
+ }
413
+ }
414
+
415
+ private function stmp_logo() {
416
+ ?>
417
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" height="90" width="90"><defs><style>.cls-11,.cls-12{fill-rule:evenodd}.cls-4{fill:none}.cls-11{fill:#86a196}.cls-12{fill:#fff}</style></defs><path class="cls-4" d="M-6.3 0h60v60h-60z"/><path d="M16.7 8.1a15.4 15.4 0 00-8 10.2 23.5 23.5 0 1030 0 15.4 15.4 0 00-9.3-10.8 3.4 3.4 0 00-2.1-2.7A4.6 4.6 0 0018.4 3a24.4 24.4 0 00-1.7 5z" fill="#395360" fill-rule="evenodd"/><path fill="#fbaa6f" d="M18 26h12v14H18z"/><path d="M25.9 33.2l-.1-.1a1.4 1.4 0 111.6-2.3 1.9 1.9 0 00-1.2.8 1.9 1.9 0 00-.3 1.6zm-4.5 0a1.8 1.8 0 00-.4-1.6 2 2 0 00-1.2-.8 1.4 1.4 0 011.6 2.3zm7.2-3.2h.5l-1 4.8-2.2 6.5h-4.3l-3.2-5.4 1.1-3.2 2.1 2.7c.6.5 2.7.5 3.8-.6a26.2 26.2 0 003.2-4.8z" fill="#dc7f3c" fill-rule="evenodd"/><path d="M9.7 29H15v-9h-4a13 13 0 017.4-10q1.2-5 2.8-6.8l.1-.1.1-.1a2.3 2.3 0 011.1-.5 2.3 2.3 0 012.2 3.8 1.6 1.6 0 01-.4.3A15 15 0 0023 8a5 5 0 013-1.5 1.4 1.4 0 01.7.2 1.3 1.3 0 01.5 1.8 1.3 1.3 0 01-.6.6 13 13 0 0110.1 11l.1.8H33v8h4.8l1.8 13.4q-6.3 4-15.8 4T8 42.4zM25 38.4q3.8-6.4 3.8-7.6c0-2.2-3.2-4-4.8-4s-4.9 1.7-4.9 4q0 1.2 3.8 7.6a1.2 1.2 0 001 .6 1 1 0 001-.6z" fill="#bdcfc8" fill-rule="evenodd"/><path class="cls-4" d="M19 31h9.6L27 47.2h-6.4l-1.6-16z"/><path d="M39.8 48.8a20 20 0 01-32 0l.8-6a2.7 2.7 0 001 .1 2.8 2.8 0 002.8-2.4v1.2a2.8 2.8 0 005.6 0v1.6a2.9 2.9 0 005.7 0 2.8 2.8 0 005.7 0v-1.6a2.8 2.8 0 105.7 0v-1.2A2.8 2.8 0 0038 43a2.9 2.9 0 001-.2l.8 6z" fill="#809eb0" fill-rule="evenodd"/><path d="M8.3 44.6l.3-1.8a2.7 2.7 0 001 .2 2.8 2.8 0 002.8-2.5v1.2a2.8 2.8 0 005.7 0v1.7a2.9 2.9 0 005.6 0 2.8 2.8 0 005.7 0v-1.7a2.8 2.8 0 105.7 0v-1.2A2.8 2.8 0 0038 43a2.9 2.9 0 001-.2l.3 2a2.9 2.9 0 01-4.1-2.2v1.2a2.8 2.8 0 11-5.7 0v1.6a2.8 2.8 0 01-5.7 0 2.9 2.9 0 01-5.7 0v-1.7a2.8 2.8 0 01-5.7 0v-1.2A2.8 2.8 0 019.6 45a2.9 2.9 0 01-1.3-.3z" fill="#738e9e" fill-rule="evenodd"/><path class="cls-11" d="M37.8 22.4c-1-2.9-3-4.7-4.7-4.5-2.2.2-2.8 3.7-2.3 8s1.7 7.5 3.9 7.3 4-3.9 3.6-8c0 1.2-.5 2.3-1.3 2.4-1.2 0-1.5-1.2-1.6-2.9s-.2-3 1-3a1.5 1.5 0 011.4.7z"/><path class="cls-12" d="M37 21.8c-.6-1.3-1.5-2-2.4-1.9-1.5.1-1.9 2.6-1.6 5.5s1.2 5.1 2.7 5c1.1-.2 2-1.5 2.2-3.4a1.2 1.2 0 01-1 .6c-1 0-1.4-1.2-1.5-2.9s-.1-3 1-3a1.6 1.6 0 01.6 0z"/><path class="cls-11" d="M9.6 22.4c1-2.9 3-4.7 4.7-4.5 2.2.2 2.8 3.7 2.3 8s-1.7 7.5-3.9 7.3-4-3.9-3.7-8c.1 1.2.5 2.3 1.4 2.4 1.1 0 1.5-1.2 1.6-2.9s.1-3-1-3a1.5 1.5 0 00-1.4.7z"/><path class="cls-12" d="M10.4 21.8c.6-1.3 1.5-2 2.4-1.9 1.5.1 1.8 2.6 1.5 5.5s-1.1 5.1-2.6 5c-1.1-.2-2-1.5-2.2-3.4a1.2 1.2 0 00.9.6c1.1 0 1.4-1.2 1.6-2.9s.1-3-1-3a1.7 1.7 0 00-.7 0z"/><path d="M19 28.6a5.3 5.3 0 010-.7c0-2.4 1.2-5.2 4.9-5.2s4.8 2.8 4.8 5.2a4.4 4.4 0 010 1c-.9-1.3-2.4-2.1-4.9-2.1-2.4 0-3.9.7-4.8 1.8z" fill="#f4f8ff" fill-rule="evenodd"/><path class="cls-11" d="M26.5 9.2L23.3 9l4-1.2a1.4 1.4 0 01-.8 1.4zm-3.5-1l-1.3 1a16.8 16.8 0 002-3.8 6.6 6.6 0 00.3-2.7A2.4 2.4 0 0125.2 5a2.4 2.4 0 01-.7 1.5A15 15 0 0023 8.1z"/></svg>
418
+ <?php
419
+ }
420
+
421
+ private function css() {
422
+ ?>
423
+ <style>
424
+ #frm-admin-smtp *, #frm-admin-smtp *::before, #frm-admin-smtpp *::after {
425
+ -webkit-box-sizing: border-box;
426
+ -moz-box-sizing: border-box;
427
+ box-sizing: border-box;
428
+ }
429
+ #frm-admin-smtp{
430
+ width: 700px;
431
+ margin: 0 auto;
432
+ }
433
+ #frm-admin-smtp p {
434
+ font-size: 15px;
435
+ }
436
+ #frm-admin-smtp section{
437
+ margin: 50px 0;
438
+ text-align: left;
439
+ clear: both;
440
+ }
441
+ #frm-admin-smtp .top{
442
+ text-align: center;
443
+ }
444
+ .frm-smtp-logos {
445
+ margin-bottom: 38px;
446
+ }
447
+ .frm-smtp-logos svg {
448
+ vertical-align: middle;
449
+ }
450
+ #frm-admin-smtp .top h1 {
451
+ font-size: 26px;
452
+ font-weight: 600;
453
+ margin-bottom: 0;
454
+ padding: 0;
455
+ }
456
+ #frm-admin-smtp .top p {
457
+ font-size: 17px;
458
+ color: #777;
459
+ margin-top: .5em;
460
+ }
461
+ #frm-admin-smtp .screenshot ul {
462
+ display: inline-block;
463
+ margin: 0 0 0 30px;
464
+ list-style-type: none;
465
+ max-width: calc(100% - 350px);
466
+ }
467
+ #frm-admin-smtp .screenshot li {
468
+ margin: 16px 0;
469
+ padding: 0;
470
+ font-size: 15px;
471
+ color: #777;
472
+ }
473
+ #frm-admin-smtp .screenshot .cont img {
474
+ max-width: 100%;
475
+ display: block;
476
+ }
477
+ #frm-admin-smtp .screenshot .cont {
478
+ display: inline-block;
479
+ position: relative;
480
+ width: 315px;
481
+ padding: 5px;
482
+ background-color: #fff;
483
+ border-radius: 3px;
484
+ }
485
+ #frm-admin-smtp .step,
486
+ #frm-admin-smtp .screenshot .cont {
487
+ -webkit-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05);
488
+ -moz-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05);
489
+ box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05);
490
+ }
491
+ #frm-admin-smtp .step {
492
+ background-color: #F9F9F9;
493
+ border: 1px solid #E5E5E5;
494
+ margin: 0 0 25px;
495
+ }
496
+ #frm-admin-smtp .screenshot > *,
497
+ #frm-admin-smtp .step > * {
498
+ vertical-align: middle;
499
+ }
500
+ #frm-admin-smtp .step p {
501
+ font-size: 16px;
502
+ color: #777777;
503
+ }
504
+ #frm-admin-smtp .step .num {
505
+ display: inline-block;
506
+ position: relative;
507
+ width: 100px;
508
+ height: 50px;
509
+ text-align: center;
510
+ }
511
+ #frm-admin-smtp .step div {
512
+ display: inline-block;
513
+ width: calc(100% - 104px);
514
+ background-color: #fff;
515
+ padding: 30px;
516
+ border-left: 1px solid #eee;
517
+ }
518
+ #frm-admin-smtp .grey {
519
+ opacity: 0.5;
520
+ background: #F6F6F6 !important;
521
+ border-color: #ddd !important;
522
+ color: #9FA5AA !important;
523
+ }
524
+ #frm-admin-smtp .step h2 {
525
+ font-size: 24px;
526
+ line-height: 22px;
527
+ margin-top: 0;
528
+ margin-bottom: 15px;
529
+ }
530
+ #frm-admin-smtp .button.disabled {
531
+ cursor: default;
532
+ }
533
+ </style>
534
+ <?php
535
+ }
536
+ }
classes/controllers/FrmXMLController.php CHANGED
@@ -3,7 +3,8 @@
3
  class FrmXMLController {
4
 
5
  public static function menu() {
6
- add_submenu_page( 'formidable', 'Formidable | ' . __( 'Import/Export', 'formidable' ), __( 'Import/Export', 'formidable' ), 'frm_edit_forms', 'formidable-import', 'FrmXMLController::route' );
 
7
  }
8
 
9
  public static function add_default_templates() {
3
  class FrmXMLController {
4
 
5
  public static function menu() {
6
+ $notification_count = FrmFormMigratorsHelper::notification_count();
7
+ add_submenu_page( 'formidable', 'Formidable | ' . __( 'Import/Export', 'formidable' ), __( 'Import/Export', 'formidable' ) . $notification_count, 'frm_edit_forms', 'formidable-import', 'FrmXMLController::route' );
8
  }
9
 
10
  public static function add_default_templates() {
classes/helpers/FrmAppHelper.php CHANGED
@@ -11,7 +11,7 @@ class FrmAppHelper {
11
  /**
12
  * @since 2.0
13
  */
14
- public static $plug_version = '4.04.03';
15
 
16
  /**
17
  * @since 1.07.02
@@ -289,28 +289,13 @@ class FrmAppHelper {
289
  * @return boolean
290
  */
291
  public static function doing_ajax() {
292
- return self::wp_doing_ajax() && ! self::is_preview_page();
293
  }
294
 
295
  public static function js_suffix() {
296
  return defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
297
  }
298
 
299
- /**
300
- * Use the WP 4.7 wp_doing_ajax function
301
- *
302
- * @since 2.05.07
303
- */
304
- public static function wp_doing_ajax() {
305
- if ( function_exists( 'wp_doing_ajax' ) ) {
306
- $doing_ajax = wp_doing_ajax();
307
- } else {
308
- $doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
309
- }
310
-
311
- return $doing_ajax;
312
- }
313
-
314
  /**
315
  * @since 2.0.8
316
  */
@@ -330,7 +315,7 @@ class FrmAppHelper {
330
  * @return boolean
331
  */
332
  public static function is_admin() {
333
- return is_admin() && ! self::wp_doing_ajax();
334
  }
335
 
336
  /**
@@ -2452,6 +2437,17 @@ class FrmAppHelper {
2452
  return $locales;
2453
  }
2454
 
 
 
 
 
 
 
 
 
 
 
 
2455
  /**
2456
  * @deprecated 4.0
2457
  */
11
  /**
12
  * @since 2.0
13
  */
14
+ public static $plug_version = '4.04.04';
15
 
16
  /**
17
  * @since 1.07.02
289
  * @return boolean
290
  */
291
  public static function doing_ajax() {
292
+ return wp_doing_ajax() && ! self::is_preview_page();
293
  }
294
 
295
  public static function js_suffix() {
296
  return defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
297
  }
298
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  /**
300
  * @since 2.0.8
301
  */
315
  * @return boolean
316
  */
317
  public static function is_admin() {
318
+ return is_admin() && ! wp_doing_ajax();
319
  }
320
 
321
  /**
2437
  return $locales;
2438
  }
2439
 
2440
+ /**
2441
+ * Use the WP 4.7 wp_doing_ajax function
2442
+ *
2443
+ * @since 2.05.07
2444
+ * @deprecated 4.04.04
2445
+ */
2446
+ public static function wp_doing_ajax() {
2447
+ _deprecated_function( __METHOD__, '4.04.04', 'wp_doing_ajax' );
2448
+ return wp_doing_ajax();
2449
+ }
2450
+
2451
  /**
2452
  * @deprecated 4.0
2453
  */
classes/helpers/FrmFormMigratorsHelper.php ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ die( 'You are not allowed to call this page directly.' );
4
+ }
5
+
6
+ class FrmFormMigratorsHelper {
7
+
8
+ public static function notification_count() {
9
+ $forms = self::import_links();
10
+ if ( empty( $forms ) ) {
11
+ return '';
12
+ }
13
+
14
+ $count = count( $forms );
15
+ $dismissed = get_option( 'frm_dismissed' );
16
+ if ( ! empty( $dismissed ) ) {
17
+ foreach ( $forms as $form ) {
18
+ if ( self::is_dismissed( $form, $dismissed ) ) {
19
+ $count --;
20
+ }
21
+ }
22
+ }
23
+
24
+ if ( $count < 1 ) {
25
+ return '';
26
+ }
27
+
28
+ return ' <span class="update-plugins"><span class="plugin-count">' . absint( $count ) . '</span></span>';
29
+ }
30
+
31
+ private static function is_dismissed( $form, $dismissed = null ) {
32
+ if ( $dismissed === null ) {
33
+ $dismissed = get_option( 'frm_dismissed' );
34
+ }
35
+
36
+ if ( ! empty( $dismissed ) && in_array( $form['class'], $dismissed ) ) {
37
+ return true;
38
+ }
39
+
40
+ return false;
41
+ }
42
+
43
+ public static function maybe_show_download_link() {
44
+ $forms = self::import_links();
45
+ foreach ( $forms as $form ) {
46
+ if ( ! self::is_dismissed( $form ) ) {
47
+ self::install_banner( $form );
48
+ } else {
49
+ echo '<span>';
50
+ self::install_button( $form, 'auto' );
51
+ echo '</span>';
52
+ }
53
+ }
54
+ }
55
+
56
+ private static function import_links() {
57
+ if ( ! current_user_can( 'activate_plugins' ) ) {
58
+ return array();
59
+ }
60
+
61
+ $forms = array();
62
+ foreach ( self::importable_forms() as $form ) {
63
+ if ( class_exists( $form['class'] ) || ! is_plugin_active( $form['plugin'] ) ) {
64
+ // Either the importer is installed or the source plugin isn't.
65
+ continue;
66
+ }
67
+
68
+ $installer = new FrmInstallPlugin( array( 'plugin_file' => $form['importer'] ) );
69
+ $form['installed'] = $installer->is_installed();
70
+ $form['link'] = $installer->get_activate_link();
71
+
72
+ $forms[] = $form;
73
+ }
74
+ return $forms;
75
+ }
76
+
77
+ private static function importable_forms() {
78
+ return array(
79
+ /*'gf' => array(
80
+ 'class' => 'FrmGravityImporter',
81
+ 'plugin' => 'gravityforms/gravityforms.php',
82
+ 'importer' => 'formidable-gravity-forms-importer/formidable-gravity-forms-importer.php',
83
+ 'name' => 'Gravity Forms',
84
+ 'package' => 'https://downloads.wordpress.org/plugin/formidable-gravity-forms-importer.zip',
85
+ ),*/
86
+ 'pf' => array(
87
+ 'class' => 'FrmPirateImporter',
88
+ 'plugin' => 'pirate-forms/pirate-forms.php',
89
+ 'importer' => 'formidable-import-pirate-forms/pf-to-frm.php',
90
+ 'name' => 'Pirate Forms',
91
+ 'package' => 'https://downloads.wordpress.org/plugin/formidable-import-pirate-forms.zip',
92
+ ),
93
+ );
94
+ }
95
+
96
+ private static function install_banner( $install ) {
97
+ if ( empty( $install['link'] ) ) {
98
+ return '';
99
+ }
100
+
101
+ ?>
102
+ <div class="frm-feature-banner">
103
+ <a href="#" class="dismiss alignright" id="<?php echo esc_attr( $install['class'] ); ?>" title="<?php esc_attr_e( 'Dismiss this message', 'formidable' ); ?>">
104
+ <?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon', array( 'aria-label' => 'Dismiss' ) ); ?>
105
+ </a>
106
+ <div class="frm-big-icon">
107
+ <?php FrmAppHelper::icon_by_class( 'frmfont frm_cloud_upload_solid_icon', array( 'aria-label' => 'Import' ) ); ?>
108
+ </div>
109
+ <p>Did you know you can import your forms created in <?php echo esc_html( $install['name'] ); ?>?</p>
110
+ <?php self::install_button( $install ); ?>
111
+ </div>
112
+ <?php
113
+ }
114
+
115
+ private static function install_button( $install, $label = '' ) {
116
+ $primary = 'button-secondary frm-button-secondary ';
117
+
118
+ if ( empty( $label ) ) {
119
+ $label = __( 'Get Started', 'formidable' );
120
+ $primary = 'button-primary frm-button-primary ';
121
+ }
122
+
123
+ if ( $install['installed'] ) {
124
+ ?>
125
+ <a rel="<?php echo esc_attr( $install['importer'] ); ?>" class="button frm-activate-addon <?php echo esc_attr( $primary . ( empty( $install['link'] ) ? 'frm_hidden' : '' ) ); ?>">
126
+ <?php
127
+ if ( $label === 'auto' ) {
128
+ /* translators: %s: Name of the plugin */
129
+ $label = sprintf( __( 'Activate %s', 'formidable' ), $install['name'] );
130
+ }
131
+ } else {
132
+ ?>
133
+ <a rel="<?php echo esc_attr( $install['package'] ); ?>" class="frm-install-addon button <?php echo esc_attr( $primary ); ?>" aria-label="<?php esc_attr_e( 'Install', 'formidable' ); ?>">
134
+ <?php
135
+ if ( $label === 'auto' ) {
136
+ /* translators: %s: Name of the plugin */
137
+ $label = sprintf( __( 'Install %s Importer', 'formidable' ), $install['name'] );
138
+ }
139
+ }
140
+ ?>
141
+ <?php echo esc_html( $label ); ?>
142
+ </a>
143
+ <?php
144
+ }
145
+
146
+ public static function dismiss_migrator() {
147
+ check_ajax_referer( 'frm_ajax', 'nonce' );
148
+ $dismissed = get_option( 'frm_dismissed' );
149
+ if ( empty( $dismissed ) ) {
150
+ $dismissed = array();
151
+ }
152
+ $dismissed[] = FrmAppHelper::get_param( 'plugin', '', 'post', 'sanitize_text_field' );
153
+ update_option( 'frm_dismissed', array_filter( $dismissed ), 'no' );
154
+ wp_die();
155
+ }
156
+ }
classes/helpers/FrmListHelper.php CHANGED
@@ -206,7 +206,7 @@ class FrmListHelper {
206
  }
207
 
208
  // Redirect if page number is invalid and headers are not already sent.
209
- if ( ! headers_sent() && ! FrmAppHelper::wp_doing_ajax() && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
210
  wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );
211
  exit;
212
  }
206
  }
207
 
208
  // Redirect if page number is invalid and headers are not already sent.
209
+ if ( ! headers_sent() && ! wp_doing_ajax() && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
210
  wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );
211
  exit;
212
  }
classes/models/FrmInstallPlugin.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @since 4.04.04
5
+ */
6
+ class FrmInstallPlugin {
7
+
8
+ protected $plugin_file; // format: folder/filename.php
9
+ protected $plugin_slug;
10
+
11
+ public function __construct( $atts ) {
12
+ $this->plugin_file = $atts['plugin_file'];
13
+ list( $slug, $file ) = explode( '/', $this->plugin_file );
14
+ $this->plugin_slug = $slug;
15
+ }
16
+
17
+ public function get_activate_link() {
18
+ if ( $this->is_installed() && $this->is_active() ) {
19
+ return '';
20
+ }
21
+
22
+ if ( $this->is_installed() ) {
23
+ $url = $this->activate_url();
24
+ } else {
25
+ $url = $this->install_url();
26
+ }
27
+ return $url;
28
+ }
29
+
30
+ public function is_installed() {
31
+ return is_dir( WP_PLUGIN_DIR . '/' . $this->plugin_slug );
32
+ }
33
+
34
+ public function is_active() {
35
+ return is_plugin_active( $this->plugin_file );
36
+ }
37
+
38
+ protected function install_url() {
39
+ return wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $this->plugin_slug ), 'install-plugin_' . $this->plugin_slug );
40
+ }
41
+
42
+ protected function activate_url() {
43
+ return wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=' . $this->plugin_file ), 'activate-plugin_' . $this->plugin_file );
44
+ }
45
+ }
classes/views/frm-fields/single-option.php CHANGED
@@ -2,13 +2,13 @@
2
  <?php FrmAppHelper::icon_by_class( 'frmfont frm_drag_icon frm-drag' ); ?>
3
  <input type="<?php echo esc_attr( $default_type ); ?>" name="<?php echo esc_attr( $field_name ); ?>" <?php echo ( isset( $checked ) && $checked ? 'checked="checked"' : '' ); ?> value="<?php echo esc_attr( $field_val ); ?>"/>
4
 
5
- <input type="text" name="field_options[options_<?php echo esc_attr( $field['id'] ); ?>][<?php echo esc_attr( $opt_key ); ?>][label]" value="<?php echo esc_attr( $opt ); ?>" class="field_<?php echo esc_attr( $field['id'] ); ?>_option <?php echo esc_attr( $field['separate_value'] ? 'frm_with_key' : '' ); ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ); ?>" data-frmchange="trim" />
6
 
7
  <a href="javascript:void(0)" class="frm_icon_font frm_remove_tag" data-fid="<?php echo esc_attr( $field['id'] ); ?>" data-removeid="frm_delete_field_<?php echo esc_attr( $field['id'] . '-' . $opt_key ); ?>_container" data-removemore="#frm_<?php echo esc_attr( $default_type . '_' . $field['id'] . '-' . $opt_key ); ?>" data-showlast="#frm_add_opt_<?php echo esc_attr( $field['id'] ); ?>"></a>
8
 
9
  <span class="frm_option_key frm-with-right-icon field_<?php echo esc_attr( $field['id'] ); ?>_option_key<?php echo esc_attr( $field['separate_value'] ? '' : ' frm_hidden' ); ?>">
10
  <input type="<?php echo esc_attr( $default_type ); ?>" class="frm_invisible" />
11
- <input type="text" name="field_options[options_<?php echo esc_attr( $field['id'] ); ?>][<?php echo esc_attr( $opt_key ); ?>][value]" id="field_key_<?php echo esc_attr( $field['id'] . '-' . $opt_key ); ?>" value="<?php echo esc_attr( $field_val ); ?>" placeholder="<?php esc_attr_e( 'Saved Value', 'formidable' ); ?>" data-frmchange="trim" />
12
  <?php FrmAppHelper::icon_by_class( 'frmfont frm_save_icon' ); ?>
13
  </span>
14
  </li>
2
  <?php FrmAppHelper::icon_by_class( 'frmfont frm_drag_icon frm-drag' ); ?>
3
  <input type="<?php echo esc_attr( $default_type ); ?>" name="<?php echo esc_attr( $field_name ); ?>" <?php echo ( isset( $checked ) && $checked ? 'checked="checked"' : '' ); ?> value="<?php echo esc_attr( $field_val ); ?>"/>
4
 
5
+ <input type="text" name="field_options[options_<?php echo esc_attr( $field['id'] ); ?>][<?php echo esc_attr( $opt_key ); ?>][label]" value="<?php echo esc_attr( $opt ); ?>" class="field_<?php echo esc_attr( $field['id'] ); ?>_option <?php echo esc_attr( $field['separate_value'] ? 'frm_with_key' : '' ); ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ); ?>" data-frmchange="trim,updateOption" />
6
 
7
  <a href="javascript:void(0)" class="frm_icon_font frm_remove_tag" data-fid="<?php echo esc_attr( $field['id'] ); ?>" data-removeid="frm_delete_field_<?php echo esc_attr( $field['id'] . '-' . $opt_key ); ?>_container" data-removemore="#frm_<?php echo esc_attr( $default_type . '_' . $field['id'] . '-' . $opt_key ); ?>" data-showlast="#frm_add_opt_<?php echo esc_attr( $field['id'] ); ?>"></a>
8
 
9
  <span class="frm_option_key frm-with-right-icon field_<?php echo esc_attr( $field['id'] ); ?>_option_key<?php echo esc_attr( $field['separate_value'] ? '' : ' frm_hidden' ); ?>">
10
  <input type="<?php echo esc_attr( $default_type ); ?>" class="frm_invisible" />
11
+ <input type="text" name="field_options[options_<?php echo esc_attr( $field['id'] ); ?>][<?php echo esc_attr( $opt_key ); ?>][value]" id="field_key_<?php echo esc_attr( $field['id'] . '-' . $opt_key ); ?>" value="<?php echo esc_attr( $field_val ); ?>" placeholder="<?php esc_attr_e( 'Saved Value', 'formidable' ); ?>" data-frmchange="trim,updateDefault" />
12
  <?php FrmAppHelper::icon_by_class( 'frmfont frm_save_icon' ); ?>
13
  </span>
14
  </li>
classes/views/xml/import_form.php CHANGED
@@ -33,6 +33,7 @@
33
  <input type="submit" value="<?php esc_attr_e( 'Upload file and import', 'formidable' ); ?>" class="button-primary frm-button-primary" />
34
  </p>
35
  </form>
 
36
  <?php FrmTipsHelper::pro_tip( 'get_import_tip' ); ?>
37
 
38
  <?php do_action( 'frm_import_settings' ); ?>
33
  <input type="submit" value="<?php esc_attr_e( 'Upload file and import', 'formidable' ); ?>" class="button-primary frm-button-primary" />
34
  </p>
35
  </form>
36
+ <?php FrmFormMigratorsHelper::maybe_show_download_link(); ?>
37
  <?php FrmTipsHelper::pro_tip( 'get_import_tip' ); ?>
38
 
39
  <?php do_action( 'frm_import_settings' ); ?>
css/frm_admin.css CHANGED
@@ -19,7 +19,7 @@
19
  --pink: rgb(226, 42, 110);
20
  --purple: rgb(141, 53, 245);
21
  --border-radius: 35px;
22
- --small-radius: 4px;
23
  --small-sidebar: 275px;
24
  --medium-sidebar: 350px;
25
  --big-sidebar: 390px;
@@ -2009,6 +2009,7 @@ table.frm-list-templates thead th {
2009
  height: 50px;
2010
  }
2011
 
 
2012
  a.frm_pro_tip {
2013
  font-size: 14px;
2014
  border: 1px solid var(--orange);
@@ -3742,6 +3743,42 @@ label.default-style-box input[type="checkbox"] {
3742
  padding: 0;
3743
  }
3744
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3745
  /*for add-on reverse compatibility */
3746
 
3747
  .frm_98_width {
19
  --pink: rgb(226, 42, 110);
20
  --purple: rgb(141, 53, 245);
21
  --border-radius: 35px;
22
+ --small-radius: 6px;
23
  --small-sidebar: 275px;
24
  --medium-sidebar: 350px;
25
  --big-sidebar: 390px;
2009
  height: 50px;
2010
  }
2011
 
2012
+ .frm-right-panel .inside a.frm_pro_tip,
2013
  a.frm_pro_tip {
2014
  font-size: 14px;
2015
  border: 1px solid var(--orange);
3743
  padding: 0;
3744
  }
3745
 
3746
+ .frm-feature-banner {
3747
+ background: var(--dark-grey);
3748
+ color: #fff;
3749
+ border-radius: var(--small-radius);
3750
+ padding: 20px;
3751
+ margin: 10px 0;
3752
+ }
3753
+
3754
+ .frm-feature-banner p {
3755
+ font-size: 14px;
3756
+ }
3757
+
3758
+ .frm-feature-banner .dismiss {
3759
+ margin-top: -10px;
3760
+ margin-right: -10px;
3761
+ }
3762
+
3763
+ .frm-feature-banner .dismiss svg {
3764
+ color: #fff;
3765
+ }
3766
+
3767
+ .frm-feature-banner .frm-big-icon {
3768
+ padding-right: 20px;
3769
+ float: left;
3770
+ min-height: 60px;
3771
+ }
3772
+
3773
+ .frm-big-icon svg {
3774
+ height: 60px;
3775
+ width: 60px;
3776
+ }
3777
+
3778
+ .frm-feature-banner p {
3779
+ margin-top: 0;
3780
+ }
3781
+
3782
  /*for add-on reverse compatibility */
3783
 
3784
  .frm_98_width {
css/frm_grids.css CHANGED
@@ -185,7 +185,7 @@
185
  .frm12,
186
  .frm_full,
187
  .frm_full .wp-editor-wrap,
188
- .frm_full input:not([type='checkbox']):not([type='radio']):not([type='button']),
189
  .frm_full select,
190
  .frm_full textarea{
191
  width:100% !important;
185
  .frm12,
186
  .frm_full,
187
  .frm_full .wp-editor-wrap,
188
+ .frm_full > input:not([type='checkbox']):not([type='radio']):not([type='button']),
189
  .frm_full select,
190
  .frm_full textarea{
191
  width:100% !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: 4.04.03
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: 4.04.04
6
  Plugin URI: https://formidableforms.com/
7
  Author URI: https://formidableforms.com/
8
  Author: Strategy11
images/icons.svg CHANGED
@@ -572,9 +572,9 @@
572
  <title>cloud_download</title>
573
  <path d="M18.1 8.2a7 7 0 0 0-13-2 5.6 5.6 0 0 0 .5 11.3h12.2c2.6 0 4.7-2.1 4.7-4.7 0-2.5-2-4.5-4.4-4.6zm-.3 7.4H5.6a3.7 3.7 0 0 1-.4-7.4l1-.1.5-1a5.2 5.2 0 0 1 9.6 1.4l.3 1.4 1.4.1a2.8 2.8 0 0 1-.2 5.6zm-5.2-7.5H10V11H7.5l3.7 3.8 3.8-3.8h-2.4z"/>
574
  </symbol>
575
- <symbol id="frm_cloud_upload_solid_icon" viewBox="0 0 22 20">
576
  <title>cloud_upload_solid</title>
577
- <path d="M18.1 8.2a7 7 0 0 0-13-2 5.6 5.6 0 0 0 .5 11.3h12.2c2.6 0 4.7-2.1 4.7-4.7 0-2.5-2-4.5-4.4-4.6zm-5 2.7v3.8H9.4v-3.8H6.6l4.6-4.6 4.7 4.6h-2.8z"/>
578
  </symbol>
579
  <symbol id="frm_cloud_upload_icon" viewBox="0 0 22 20">
580
  <title>cloud_upload</title>
@@ -872,6 +872,18 @@
872
  <title>cc_stripe</title>
873
  <path d="M17.3 10c0 .6 0 1-.2 1.2-.1.3-.3.4-.6.4a1 1 0 0 1-.4 0V9c.3-.3.5-.3.6-.3.4 0 .6.4.6 1.3zm4.8-.3h-1.2c0-.7.2-1 .6-1s.6.3.6 1zM5 11.2c0-1-.5-1.3-1.4-1.7-.5-.1-.7-.3-.7-.5s.1-.3.4-.3c.5 0 1 .2 1.3.4L5 7.9c-.2-.2-.8-.4-1.6-.4A2 2 0 0 0 2 8c-.4.3-.5.7-.5 1.2 0 .9.5 1.3 1.4 1.6.5.2.7.4.7.6 0 .2-.1.3-.5.3s-1-.2-1.5-.5l-.2 1.3c.4.2 1 .4 1.8.4.6 0 1-.1 1.4-.4.4-.3.6-.7.6-1.3zm3.3-2.4l.2-1.2h-1V6.1L6 6.4 6 7.6l-.5.1-.1 1.1h.6v2.4c0 .6.2 1 .5 1.3.3.2.7.3 1.2.3l.9-.1v-1.3l-.5.1c-.3 0-.5-.2-.5-.5V8.8h.9zm3.4.3V7.6h-.3a1 1 0 0 0-1 .6v-.6H9v5.1h1.6V9.4c.2-.2.5-.3 1-.3h.2zm.4 3.6h1.6v-5h-1.6v5zm6.7-2.7c0-.8-.1-1.5-.4-2-.3-.3-.7-.5-1.2-.5s-1 .2-1.3.6l-.1-.5h-1.4v7l1.6-.3v-1.6l.7.1c.4 0 1 0 1.5-.6.4-.5.6-1.2.6-2.2zm-5-3.8c0-.4-.4-.8-.9-.8s-.8.4-.8.8.3 1 .8 1 .9-.5.9-1zm9.7 4c0-.9-.2-1.5-.5-2-.4-.4-.9-.7-1.6-.7-1.4 0-2.2 1-2.2 2.7 0 .9.2 1.6.7 2 .4.4 1 .6 1.7.6s1.3-.1 1.7-.4l-.1-1.1c-.4.2-.9.3-1.4.3-.3 0-.5 0-.7-.2-.2-.1-.3-.4-.3-.7h2.7V10zM25 3v13.8c0 .8-.6 1.4-1.4 1.4H1.4C.6 18.3 0 17.7 0 17V3.1c0-.8.6-1.4 1.4-1.4h22.2c.8 0 1.4.6 1.4 1.4z"/>
874
  </symbol>
 
 
 
 
 
 
 
 
 
 
 
 
875
  <symbol id="frm_price_icon" viewBox="0 0 20 20">
876
  <title>price</title>
877
  <path d="M.5 11.5l8 8a1.9 1.9 0 002.7 0l8.3-8.3a1.9 1.9 0 00.5-1.4v-8A1.9 1.9 0 0018.1 0h-8a1.9 1.9 0 00-1.3.5L.5 8.8a1.9 1.9 0 000 2.7zM2 10.2l8.3-8.3h8v8L9.7 18zm12.5-6.4a1.9 1.9 0 11-1.9 1.8 1.9 1.9 0 011.9-1.8z"/>
572
  <title>cloud_download</title>
573
  <path d="M18.1 8.2a7 7 0 0 0-13-2 5.6 5.6 0 0 0 .5 11.3h12.2c2.6 0 4.7-2.1 4.7-4.7 0-2.5-2-4.5-4.4-4.6zm-.3 7.4H5.6a3.7 3.7 0 0 1-.4-7.4l1-.1.5-1a5.2 5.2 0 0 1 9.6 1.4l.3 1.4 1.4.1a2.8 2.8 0 0 1-.2 5.6zm-5.2-7.5H10V11H7.5l3.7 3.8 3.8-3.8h-2.4z"/>
574
  </symbol>
575
+ <symbol id="frm_cloud_upload_solid_icon" viewBox="0 0 640 512">
576
  <title>cloud_upload_solid</title>
577
+ <path d="M537.6 226.6a96 96 0 00-142.9-114.4 159.9 159.9 0 00-298.5 87.9A144.1 144.1 0 00144 480h368a128 128 0 0025.6-253.4zM393.4 288H328v112a16 16 0 01-16 16h-48a16 16 0 01-16-16V288h-65.4a16 16 0 01-11.3-27.3l105.4-105.4a16 16 0 0122.6 0l105.4 105.4a16 16 0 01-11.3 27.3z"/>
578
  </symbol>
579
  <symbol id="frm_cloud_upload_icon" viewBox="0 0 22 20">
580
  <title>cloud_upload</title>
872
  <title>cc_stripe</title>
873
  <path d="M17.3 10c0 .6 0 1-.2 1.2-.1.3-.3.4-.6.4a1 1 0 0 1-.4 0V9c.3-.3.5-.3.6-.3.4 0 .6.4.6 1.3zm4.8-.3h-1.2c0-.7.2-1 .6-1s.6.3.6 1zM5 11.2c0-1-.5-1.3-1.4-1.7-.5-.1-.7-.3-.7-.5s.1-.3.4-.3c.5 0 1 .2 1.3.4L5 7.9c-.2-.2-.8-.4-1.6-.4A2 2 0 0 0 2 8c-.4.3-.5.7-.5 1.2 0 .9.5 1.3 1.4 1.6.5.2.7.4.7.6 0 .2-.1.3-.5.3s-1-.2-1.5-.5l-.2 1.3c.4.2 1 .4 1.8.4.6 0 1-.1 1.4-.4.4-.3.6-.7.6-1.3zm3.3-2.4l.2-1.2h-1V6.1L6 6.4 6 7.6l-.5.1-.1 1.1h.6v2.4c0 .6.2 1 .5 1.3.3.2.7.3 1.2.3l.9-.1v-1.3l-.5.1c-.3 0-.5-.2-.5-.5V8.8h.9zm3.4.3V7.6h-.3a1 1 0 0 0-1 .6v-.6H9v5.1h1.6V9.4c.2-.2.5-.3 1-.3h.2zm.4 3.6h1.6v-5h-1.6v5zm6.7-2.7c0-.8-.1-1.5-.4-2-.3-.3-.7-.5-1.2-.5s-1 .2-1.3.6l-.1-.5h-1.4v7l1.6-.3v-1.6l.7.1c.4 0 1 0 1.5-.6.4-.5.6-1.2.6-2.2zm-5-3.8c0-.4-.4-.8-.9-.8s-.8.4-.8.8.3 1 .8 1 .9-.5.9-1zm9.7 4c0-.9-.2-1.5-.5-2-.4-.4-.9-.7-1.6-.7-1.4 0-2.2 1-2.2 2.7 0 .9.2 1.6.7 2 .4.4 1 .6 1.7.6s1.3-.1 1.7-.4l-.1-1.1c-.4.2-.9.3-1.4.3-.3 0-.5 0-.7-.2-.2-.1-.3-.4-.3-.7h2.7V10zM25 3v13.8c0 .8-.6 1.4-1.4 1.4H1.4C.6 18.3 0 17.7 0 17V3.1c0-.8.6-1.4 1.4-1.4h22.2c.8 0 1.4.6 1.4 1.4z"/>
874
  </symbol>
875
+ <symbol id="frm_step1_icon" viewBox="0 0 100 100">
876
+ <circle cx="50" cy="50" r="50" fill="#ccc"/><path data-name="1" d="M47.48 67.35v-22.7h-8.8V39.3a16.779 16.779 0 003.57-.27 9.344 9.344 0 003.1-1.15 7.565 7.565 0 002.33-2.18 7.737 7.737 0 001.25-3.35h5.65v35h-7.1z" fill="#fff" fill-rule="evenodd"/>
877
+ </symbol>
878
+ <symbol id="frm_step2_icon" viewBox="0 0 100 100">
879
+ <circle cx="50" cy="50" r="50" fill="#ccc"/><path data-name="2" d="M38.53 41.23a12.807 12.807 0 012.4-4.5 10.792 10.792 0 014.02-3 13.616 13.616 0 015.58-1.08 13.905 13.905 0 014.57.75 11.871 11.871 0 013.83 2.15A10.329 10.329 0 0161.55 39a10.589 10.589 0 01.98 4.6 11 11 0 01-.85 4.55 12.168 12.168 0 01-2.25 3.38 18.894 18.894 0 01-3.18 2.67c-1.18.8-2.37 1.59-3.57 2.38s-2.37 1.62-3.5 2.52a16.035 16.035 0 00-3 3.15h16.55v6.1h-25.7a14.681 14.681 0 01.87-5.3 14.2 14.2 0 012.38-4.02 20.5 20.5 0 013.52-3.28c1.35-1 2.78-2.01 4.28-3.05.77-.53 1.58-1.07 2.45-1.62a15.537 15.537 0 002.37-1.83A9.286 9.286 0 0054.7 47a5.5 5.5 0 00.73-2.85 5.006 5.006 0 00-5.25-5.4 4.569 4.569 0 00-2.63.73 5.345 5.345 0 00-1.72 1.9 9.023 9.023 0 00-.93 2.6 15.122 15.122 0 00-.27 2.82h-6.8a16.741 16.741 0 01.7-5.57z" fill="#fff" fill-rule="evenodd"/>
880
+ </symbol>
881
+ <symbol id="frm_step3_icon" viewBox="0 0 100 100">
882
+ <circle cx="50" cy="50" r="50" fill="#ccc"/><path data-name="3" d="M49.83 47.5a7.656 7.656 0 002.42-.57 4.673 4.673 0 001.85-1.38 3.677 3.677 0 00.73-2.4 4.16 4.16 0 00-1.5-3.45 5.367 5.367 0 00-3.45-1.2 4.836 4.836 0 00-4.08 1.78 6.907 6.907 0 00-1.32 4.47h-6.75a15 15 0 01.97-4.92A11.337 11.337 0 0141.15 36a10.877 10.877 0 013.78-2.47 13.034 13.034 0 014.9-.88 14.551 14.551 0 014.2.63 11.78 11.78 0 013.77 1.87 10.2 10.2 0 012.73 3.05 8.1 8.1 0 011.05 4.15 8.255 8.255 0 01-1.23 4.5 6.1 6.1 0 01-3.67 2.65v.1a7.679 7.679 0 014.55 2.8 8.224 8.224 0 011.65 5.15 10.739 10.739 0 01-1.08 4.9 10.481 10.481 0 01-2.87 3.6 12.6 12.6 0 01-4.15 2.2 16.925 16.925 0 01-10.28-.1 10.8 10.8 0 01-6.75-6.45 14.178 14.178 0 01-.87-5.4h6.75a9.83 9.83 0 00.45 2.68 6.671 6.671 0 001.15 2.2 5.437 5.437 0 001.87 1.47 6.019 6.019 0 002.68.55 5.869 5.869 0 004.05-1.47 5.145 5.145 0 001.65-4.03 5.067 5.067 0 00-.78-3.05 4.338 4.338 0 00-1.97-1.52 8.208 8.208 0 00-2.63-.55c-.95-.05-1.85-.08-2.72-.08v-5a14.3 14.3 0 002.45 0z" fill="#fff" fill-rule="evenodd"/>
883
+ </symbol>
884
+ <symbol id="frm_step_complete_icon" viewBox="0 0 56.18 56.18">
885
+ <circle cx="28.09" cy="28.09" r="25" fill="#6fb05a" stroke="#6ab255" stroke-width="6"/><path d="M36.93 19.88L24.09 32.72 19.37 28a.6.6 0 00-.83 0l-1.38 1.39a.573.573 0 000 .82l6.52 6.52a.573.573 0 00.82 0l14.64-14.64a.585.585 0 000-.83l-1.38-1.38a.585.585 0 00-.83 0z" fill="#fff" fill-rule="evenodd"/>
886
+ </symbol>
887
  <symbol id="frm_price_icon" viewBox="0 0 20 20">
888
  <title>price</title>
889
  <path d="M.5 11.5l8 8a1.9 1.9 0 002.7 0l8.3-8.3a1.9 1.9 0 00.5-1.4v-8A1.9 1.9 0 0018.1 0h-8a1.9 1.9 0 00-1.3.5L.5 8.8a1.9 1.9 0 000 2.7zM2 10.2l8.3-8.3h8v8L9.7 18zm12.5-6.4a1.9 1.9 0 11-1.9 1.8 1.9 1.9 0 011.9-1.8z"/>
images/smtp-screenshot-tnail.png ADDED
Binary file
js/formidable.js CHANGED
@@ -761,7 +761,13 @@ function frmFrontFormJS(){
761
  nonce:frm_js.nonce
762
  },
763
  success:function(msg){
764
- label.html(msg);
 
 
 
 
 
 
765
  }
766
  });
767
  return false;
761
  nonce:frm_js.nonce
762
  },
763
  success:function(msg){
764
+ var admin = document.getElementById( 'wpbody' );
765
+ if ( admin === null ) {
766
+ label.html( msg );
767
+ } else {
768
+ label.html( '' );
769
+ $link.after( msg );
770
+ }
771
  }
772
  });
773
  return false;
js/formidable.min.js CHANGED
@@ -28,25 +28,25 @@ describedBy)}input.attr("aria-invalid",true);jQuery(document).trigger("frmAddFie
28
  loadingForm.removeClass("frm_loading_form");loadingForm.removeClass("frm_loading_prev");loadingForm.trigger("frmEndFormLoading");if(enable==="enable"){enableSubmitButton(loadingForm);enableSaveDraft(loadingForm)}}function showFileLoading(object){var loading=document.getElementById("frm_loading");if(loading!==null){var file_val=jQuery(object).find("input[type=file]").val();if(typeof file_val!=="undefined"&&file_val!=="")setTimeout(function(){jQuery(loading).fadeIn("slow")},2E3)}}function replaceCheckedRecaptcha(object,
29
  checkPage){var $recapField=jQuery(object).find(".frm-g-recaptcha, .g-recaptcha");if($recapField.length){if(checkPage){var morePages=jQuery(object).find(".frm_next_page").length<1||jQuery(object).find(".frm_next_page").val()<1;if(!morePages)return}$recapField.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">')}}function clearDefault(){toggleDefault(jQuery(this),"clear")}function replaceDefault(){toggleDefault(jQuery(this),"replace")}function toggleDefault($thisField,
30
  e){var v=$thisField.data("frmval").replace(/(\n|\r\n)/g,"\r");if(v===""||typeof v==="undefined")return false;var thisVal=$thisField.val().replace(/(\n|\r\n)/g,"\r");if("replace"==e){if(thisVal==="")$thisField.addClass("frm_default").val(v)}else if(thisVal==v)$thisField.removeClass("frm_default").val("")}function resendEmail(){var $link=jQuery(this),entry_id=this.getAttribute("data-eid"),form_id=this.getAttribute("data-fid"),label=$link.find(".frm_link_label");if(label.length<1)label=$link;label.append('<span class="frm-wait"></span>');
31
- jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:entry_id,form_id:form_id,nonce:frm_js.nonce},success:function(msg){label.html(msg)}});return false}function confirmClick(){var message=jQuery(this).data("frmconfirm");return confirm(message)}function toggleDiv(){var div=jQuery(this).data("frmtoggle");if(jQuery(div).is(":visible"))jQuery(div).slideUp("fast");else jQuery(div).slideDown("fast");return false}function addIndexOfFallbackForIE8(){if(!Array.prototype.indexOf)Array.prototype.indexOf=
32
- function(elt){var len=this.length>>>0;var from=Number(arguments[1])||0;from=from<0?Math.ceil(from):Math.floor(from);if(from<0)from+=len;for(;from<len;from++)if(from in this&&this[from]===elt)return from;return-1}}function addTrimFallbackForIE8(){if(typeof String.prototype.trim!=="function")String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}}function addFilterFallbackForIE8(){if(!Array.prototype.filter)Array.prototype.filter=function(fun){if(this===void 0||this===null)throw new TypeError;
33
- var t=Object(this);var len=t.length>>>0;if(typeof fun!=="function")throw new TypeError;var res=[];var thisp=arguments[1];for(var i=0;i<len;i++)if(i in t){var val=t[i];if(fun.call(thisp,val,i,t))res.push(val)}return res}}function addKeysFallbackForIE8(){if(!Object.keys)Object.keys=function(obj){var keys=[];for(var i in obj)if(obj.hasOwnProperty(i))keys.push(i);return keys}}return{init:function(){jQuery(document).off("submit.formidable",".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",
34
- frmFrontForm.submitForm);jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){if(jQuery(this).val()==="")jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",clearDefault);jQuery(document).on("blur",".frm_toggle_default",replaceDefault);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(resendEmail);jQuery(document).on("change",'.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',
35
- frmFrontForm.fieldValueChanged);jQuery(document).on("change keyup",".frm-show-form .frm_inside_container input, .frm-show-form .frm_inside_container select, .frm-show-form .frm_inside_container textarea",maybeShowLabel);jQuery(document).on("click","a[data-frmconfirm]",confirmClick);jQuery("a[data-frmtoggle]").click(toggleDiv);addIndexOfFallbackForIE8();addTrimFallbackForIE8();addFilterFallbackForIE8();addKeysFallbackForIE8()},getFieldId:function(field,fullID){return getFieldId(field,fullID)},renderRecaptcha:function(captcha){var size=
36
- captcha.getAttribute("data-size"),rendered=captcha.getAttribute("data-rid")!==null,params={"sitekey":captcha.getAttribute("data-sitekey"),"size":size,"theme":captcha.getAttribute("data-theme")};if(rendered)return;if(size==="invisible"){var formID=jQuery(captcha).closest("form").find('input[name="form_id"]').val();jQuery(captcha).closest(".frm_form_field .frm_primary_label").hide();params.callback=function(token){frmFrontForm.afterRecaptcha(token,formID)}}var recaptchaID=grecaptcha.render(captcha.id,
37
- params);captcha.setAttribute("data-rid",recaptchaID)},afterSingleRecaptcha:function(token){var object=jQuery(".frm-show-form .g-recaptcha").closest("form")[0];frmFrontForm.submitFormNow(object)},afterRecaptcha:function(token,formID){var object=jQuery("#frm_form_"+formID+"_container form")[0];frmFrontForm.submitFormNow(object)},submitForm:function(e){frmFrontForm.submitFormManual(e,this)},submitFormManual:function(e,object){var invisibleRecaptcha=hasInvisibleRecaptcha(object);var classList=object.className.trim().split(/\s+/gi);
38
- if(classList&&invisibleRecaptcha.length<1){var isPro=classList.indexOf("frm_pro_form")>-1;if(!isPro)return}if(jQuery("body").hasClass("wp-admin")&&jQuery(object).closest(".frmapi-form").length<1)return;e.preventDefault();if(typeof frmProForm!=="undefined"&&typeof frmProForm.submitAllowed==="function")if(!frmProForm.submitAllowed(object))return;if(invisibleRecaptcha.length){showLoadingIndicator(jQuery(object));executeInvisibleRecaptcha(invisibleRecaptcha)}else{var errors=frmFrontForm.validateFormSubmit(object);
39
- if(Object.keys(errors).length===0){showSubmitLoading(jQuery(object));frmFrontForm.submitFormNow(object,classList)}}},submitFormNow:function(object){var classList=object.className.trim().split(/\s+/gi);if(classList.indexOf("frm_ajax_submit")>-1){var hasFileFields=jQuery(object).find('input[type="file"]').filter(function(){return!!this.value}).length;if(hasFileFields<1){action=jQuery(object).find('input[name="frm_action"]').val();frmFrontForm.checkFormErrors(object,action)}else object.submit()}else object.submit()},
40
- validateFormSubmit:function(object){if(typeof tinyMCE!=="undefined"&&jQuery(object).find(".wp-editor-wrap").length)tinyMCE.triggerSave();jsErrors=[];if(shouldJSValidate(object)){frmFrontForm.getAjaxFormErrors(object);if(Object.keys(jsErrors).length)frmFrontForm.addAjaxFormErrors(object)}return jsErrors},getAjaxFormErrors:function(object){jsErrors=validateForm(object);if(typeof frmThemeOverride_jsErrors==="function"){action=jQuery(object).find('input[name="frm_action"]').val();var customErrors=frmThemeOverride_jsErrors(action,
41
- object);if(Object.keys(customErrors).length)for(var key in customErrors)jsErrors[key]=customErrors[key]}return jsErrors},addAjaxFormErrors:function(object){removeAllErrors();for(var key in jsErrors){var $fieldCont=jQuery(object).find("#frm_field_"+key+"_container");if($fieldCont.length)addFieldError($fieldCont,key,jsErrors);else delete jsErrors[key]}scrollToFirstField(object)},checkFormErrors:function(object,action){getFormErrors(object,action)},checkRequiredField:function(field,errors){return checkRequiredField(field,
42
- errors)},showSubmitLoading:function($object){showSubmitLoading($object)},removeSubmitLoading:function($object,enable,processesRunning){removeSubmitLoading($object,enable,processesRunning)},scrollToID:function(id){var object=jQuery(document.getElementById(id));frmFrontForm.scrollMsg(object,false)},scrollMsg:function(id,object,animate){var scrollObj="";if(typeof object==="undefined"){scrollObj=jQuery(document.getElementById("frm_form_"+id+"_container"));if(scrollObj.length<1)return}else if(typeof id===
43
- "string")scrollObj=jQuery(object).find("#frm_field_"+id+"_container");else scrollObj=id;var newPos=scrollObj.offset().top;if(!newPos)return;newPos=newPos-frm_js.offset;var m=jQuery("html").css("margin-top");var b=jQuery("body").css("margin-top");if(m||b)newPos=newPos-parseInt(m)-parseInt(b);if(newPos&&window.innerHeight){var screenTop=document.documentElement.scrollTop||document.body.scrollTop;var screenBottom=screenTop+window.innerHeight;if(newPos>screenBottom||newPos<screenTop){if(typeof animate===
44
- "undefined")jQuery(window).scrollTop(newPos);else jQuery("html,body").animate({scrollTop:newPos},500);return false}}},fieldValueChanged:function(e){var field_id=frmFrontForm.getFieldId(this,false);if(!field_id||typeof field_id==="undefined")return;if(e.frmTriggered&&e.frmTriggered==field_id)return;jQuery(document).trigger("frmFieldChanged",[this,field_id,e]);if(e.selfTriggered!==true)maybeValidateChange(field_id,this)},savingDraft:function(object){console.warn("DEPRECATED: function frmFrontForm.savingDraft in v3.0 use frmProForm.savingDraft");
45
- if(typeof frmProForm!=="undefined")return frmProForm.savingDraft(object)},goingToPreviousPage:function(object){console.warn("DEPRECATED: function frmFrontForm.goingToPreviousPage in v3.0 use frmProForm.goingToPreviousPage");if(typeof frmProForm!=="undefined")return frmProForm.goingToPreviousPage(object)},hideOrShowFields:function(ids,event){console.warn("DEPRECATED: function frmFrontForm.hideOrShowFields in v3.0 use frmProForm.hideOrShowFields");if(typeof frmProForm!=="undefined")frmProForm.hideOrShowFields()},
46
- hidePreviouslyHiddenFields:function(){console.warn("DEPRECATED: function frmFrontForm.hidePreviouslyHiddenFields in v3.0 use frmProForm.hidePreviouslyHiddenFields");if(typeof frmProForm!=="undefined")frmProForm.hidePreviouslyHiddenFields()},checkDependentDynamicFields:function(ids){console.warn("DEPRECATED: function frmFrontForm.checkDependentDynamicFields in v3.0 use frmProForm.checkDependentDynamicFields");if(typeof frmProForm!=="undefined")frmProForm.checkDependentDynamicFields(ids)},checkDependentLookupFields:function(ids){console.warn("DEPRECATED: function frmFrontForm.checkDependentLookupFields in v3.0 use frmProForm.checkDependentLookupFields");
47
- if(typeof frmProForm!=="undefined")frmProForm.checkDependentLookupFields(ids)},loadGoogle:function(){console.warn("DEPRECATED: function frmFrontForm.loadGoogle in v3.0 use frmProForm.loadGoogle");frmProForm.loadGoogle()},removeUsedTimes:function(obj,timeField){console.warn("DEPRECATED: function frmFrontForm.removeUsedTimes in v3.0 use frmProForm.removeUsedTimes");if(typeof frmProForm!=="undefined")frmProForm.removeUsedTimes()},escapeHtml:function(text){return text.replace(/&/g,"&amp;").replace(/</g,
48
- "&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},invisible:function(classes){jQuery(classes).css("visibility","hidden")},visible:function(classes){jQuery(classes).css("visibility","visible")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function($){frmFrontForm.init()});function frmRecaptcha(){var captchas=jQuery(".frm-g-recaptcha");for(var c=0,cl=captchas.length;c<cl;c++)frmFrontForm.renderRecaptcha(captchas[c])}
49
- function frmAfterRecaptcha(token){frmFrontForm.afterSingleRecaptcha(token)}
50
  function frmUpdateField(entry_id,field_id,value,message,num){jQuery(document.getElementById("frm_update_field_"+entry_id+"_"+field_id+"_"+num)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:entry_id,field_id:field_id,value:value,nonce:frm_js.nonce},success:function(){if(message.replace(/^\s+|\s+$/g,"")==="")jQuery(document.getElementById("frm_update_field_"+entry_id+"_"+field_id+"_"+num)).fadeOut("slow");
51
  else jQuery(document.getElementById("frm_update_field_"+entry_id+"_"+field_id+"_"+num)).replaceWith(message)}})}
52
  function frmDeleteEntry(entry_id,prefix){console.warn("DEPRECATED: function frmDeleteEntry in v2.0.13 use frmFrontForm.deleteEntry");jQuery(document.getElementById("frm_delete_"+entry_id)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+entry_id+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:entry_id,nonce:frm_js.nonce},success:function(html){if(html.replace(/^\s+|\s+$/g,"")==="success")jQuery(document.getElementById(prefix+entry_id)).fadeOut("slow");
28
  loadingForm.removeClass("frm_loading_form");loadingForm.removeClass("frm_loading_prev");loadingForm.trigger("frmEndFormLoading");if(enable==="enable"){enableSubmitButton(loadingForm);enableSaveDraft(loadingForm)}}function showFileLoading(object){var loading=document.getElementById("frm_loading");if(loading!==null){var file_val=jQuery(object).find("input[type=file]").val();if(typeof file_val!=="undefined"&&file_val!=="")setTimeout(function(){jQuery(loading).fadeIn("slow")},2E3)}}function replaceCheckedRecaptcha(object,
29
  checkPage){var $recapField=jQuery(object).find(".frm-g-recaptcha, .g-recaptcha");if($recapField.length){if(checkPage){var morePages=jQuery(object).find(".frm_next_page").length<1||jQuery(object).find(".frm_next_page").val()<1;if(!morePages)return}$recapField.closest(".frm_form_field").replaceWith('<input type="hidden" name="recaptcha_checked" value="'+frm_js.nonce+'">')}}function clearDefault(){toggleDefault(jQuery(this),"clear")}function replaceDefault(){toggleDefault(jQuery(this),"replace")}function toggleDefault($thisField,
30
  e){var v=$thisField.data("frmval").replace(/(\n|\r\n)/g,"\r");if(v===""||typeof v==="undefined")return false;var thisVal=$thisField.val().replace(/(\n|\r\n)/g,"\r");if("replace"==e){if(thisVal==="")$thisField.addClass("frm_default").val(v)}else if(thisVal==v)$thisField.removeClass("frm_default").val("")}function resendEmail(){var $link=jQuery(this),entry_id=this.getAttribute("data-eid"),form_id=this.getAttribute("data-fid"),label=$link.find(".frm_link_label");if(label.length<1)label=$link;label.append('<span class="frm-wait"></span>');
31
+ jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_send_email",entry_id:entry_id,form_id:form_id,nonce:frm_js.nonce},success:function(msg){var admin=document.getElementById("wpbody");if(admin===null)label.html(msg);else{label.html("");$link.after(msg)}}});return false}function confirmClick(){var message=jQuery(this).data("frmconfirm");return confirm(message)}function toggleDiv(){var div=jQuery(this).data("frmtoggle");if(jQuery(div).is(":visible"))jQuery(div).slideUp("fast");else jQuery(div).slideDown("fast");
32
+ return false}function addIndexOfFallbackForIE8(){if(!Array.prototype.indexOf)Array.prototype.indexOf=function(elt){var len=this.length>>>0;var from=Number(arguments[1])||0;from=from<0?Math.ceil(from):Math.floor(from);if(from<0)from+=len;for(;from<len;from++)if(from in this&&this[from]===elt)return from;return-1}}function addTrimFallbackForIE8(){if(typeof String.prototype.trim!=="function")String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}}function addFilterFallbackForIE8(){if(!Array.prototype.filter)Array.prototype.filter=
33
+ function(fun){if(this===void 0||this===null)throw new TypeError;var t=Object(this);var len=t.length>>>0;if(typeof fun!=="function")throw new TypeError;var res=[];var thisp=arguments[1];for(var i=0;i<len;i++)if(i in t){var val=t[i];if(fun.call(thisp,val,i,t))res.push(val)}return res}}function addKeysFallbackForIE8(){if(!Object.keys)Object.keys=function(obj){var keys=[];for(var i in obj)if(obj.hasOwnProperty(i))keys.push(i);return keys}}return{init:function(){jQuery(document).off("submit.formidable",
34
+ ".frm-show-form");jQuery(document).on("submit.formidable",".frm-show-form",frmFrontForm.submitForm);jQuery(".frm-show-form input[onblur], .frm-show-form textarea[onblur]").each(function(){if(jQuery(this).val()==="")jQuery(this).blur()});jQuery(document).on("focus",".frm_toggle_default",clearDefault);jQuery(document).on("blur",".frm_toggle_default",replaceDefault);jQuery(".frm_toggle_default").blur();jQuery(document.getElementById("frm_resend_email")).click(resendEmail);jQuery(document).on("change",
35
+ '.frm-show-form input[name^="item_meta"], .frm-show-form select[name^="item_meta"], .frm-show-form textarea[name^="item_meta"]',frmFrontForm.fieldValueChanged);jQuery(document).on("change keyup",".frm-show-form .frm_inside_container input, .frm-show-form .frm_inside_container select, .frm-show-form .frm_inside_container textarea",maybeShowLabel);jQuery(document).on("click","a[data-frmconfirm]",confirmClick);jQuery("a[data-frmtoggle]").click(toggleDiv);addIndexOfFallbackForIE8();addTrimFallbackForIE8();
36
+ addFilterFallbackForIE8();addKeysFallbackForIE8()},getFieldId:function(field,fullID){return getFieldId(field,fullID)},renderRecaptcha:function(captcha){var size=captcha.getAttribute("data-size"),rendered=captcha.getAttribute("data-rid")!==null,params={"sitekey":captcha.getAttribute("data-sitekey"),"size":size,"theme":captcha.getAttribute("data-theme")};if(rendered)return;if(size==="invisible"){var formID=jQuery(captcha).closest("form").find('input[name="form_id"]').val();jQuery(captcha).closest(".frm_form_field .frm_primary_label").hide();
37
+ params.callback=function(token){frmFrontForm.afterRecaptcha(token,formID)}}var recaptchaID=grecaptcha.render(captcha.id,params);captcha.setAttribute("data-rid",recaptchaID)},afterSingleRecaptcha:function(token){var object=jQuery(".frm-show-form .g-recaptcha").closest("form")[0];frmFrontForm.submitFormNow(object)},afterRecaptcha:function(token,formID){var object=jQuery("#frm_form_"+formID+"_container form")[0];frmFrontForm.submitFormNow(object)},submitForm:function(e){frmFrontForm.submitFormManual(e,
38
+ this)},submitFormManual:function(e,object){var invisibleRecaptcha=hasInvisibleRecaptcha(object);var classList=object.className.trim().split(/\s+/gi);if(classList&&invisibleRecaptcha.length<1){var isPro=classList.indexOf("frm_pro_form")>-1;if(!isPro)return}if(jQuery("body").hasClass("wp-admin")&&jQuery(object).closest(".frmapi-form").length<1)return;e.preventDefault();if(typeof frmProForm!=="undefined"&&typeof frmProForm.submitAllowed==="function")if(!frmProForm.submitAllowed(object))return;if(invisibleRecaptcha.length){showLoadingIndicator(jQuery(object));
39
+ executeInvisibleRecaptcha(invisibleRecaptcha)}else{var errors=frmFrontForm.validateFormSubmit(object);if(Object.keys(errors).length===0){showSubmitLoading(jQuery(object));frmFrontForm.submitFormNow(object,classList)}}},submitFormNow:function(object){var classList=object.className.trim().split(/\s+/gi);if(classList.indexOf("frm_ajax_submit")>-1){var hasFileFields=jQuery(object).find('input[type="file"]').filter(function(){return!!this.value}).length;if(hasFileFields<1){action=jQuery(object).find('input[name="frm_action"]').val();
40
+ frmFrontForm.checkFormErrors(object,action)}else object.submit()}else object.submit()},validateFormSubmit:function(object){if(typeof tinyMCE!=="undefined"&&jQuery(object).find(".wp-editor-wrap").length)tinyMCE.triggerSave();jsErrors=[];if(shouldJSValidate(object)){frmFrontForm.getAjaxFormErrors(object);if(Object.keys(jsErrors).length)frmFrontForm.addAjaxFormErrors(object)}return jsErrors},getAjaxFormErrors:function(object){jsErrors=validateForm(object);if(typeof frmThemeOverride_jsErrors==="function"){action=
41
+ jQuery(object).find('input[name="frm_action"]').val();var customErrors=frmThemeOverride_jsErrors(action,object);if(Object.keys(customErrors).length)for(var key in customErrors)jsErrors[key]=customErrors[key]}return jsErrors},addAjaxFormErrors:function(object){removeAllErrors();for(var key in jsErrors){var $fieldCont=jQuery(object).find("#frm_field_"+key+"_container");if($fieldCont.length)addFieldError($fieldCont,key,jsErrors);else delete jsErrors[key]}scrollToFirstField(object)},checkFormErrors:function(object,
42
+ action){getFormErrors(object,action)},checkRequiredField:function(field,errors){return checkRequiredField(field,errors)},showSubmitLoading:function($object){showSubmitLoading($object)},removeSubmitLoading:function($object,enable,processesRunning){removeSubmitLoading($object,enable,processesRunning)},scrollToID:function(id){var object=jQuery(document.getElementById(id));frmFrontForm.scrollMsg(object,false)},scrollMsg:function(id,object,animate){var scrollObj="";if(typeof object==="undefined"){scrollObj=
43
+ jQuery(document.getElementById("frm_form_"+id+"_container"));if(scrollObj.length<1)return}else if(typeof id==="string")scrollObj=jQuery(object).find("#frm_field_"+id+"_container");else scrollObj=id;var newPos=scrollObj.offset().top;if(!newPos)return;newPos=newPos-frm_js.offset;var m=jQuery("html").css("margin-top");var b=jQuery("body").css("margin-top");if(m||b)newPos=newPos-parseInt(m)-parseInt(b);if(newPos&&window.innerHeight){var screenTop=document.documentElement.scrollTop||document.body.scrollTop;
44
+ var screenBottom=screenTop+window.innerHeight;if(newPos>screenBottom||newPos<screenTop){if(typeof animate==="undefined")jQuery(window).scrollTop(newPos);else jQuery("html,body").animate({scrollTop:newPos},500);return false}}},fieldValueChanged:function(e){var field_id=frmFrontForm.getFieldId(this,false);if(!field_id||typeof field_id==="undefined")return;if(e.frmTriggered&&e.frmTriggered==field_id)return;jQuery(document).trigger("frmFieldChanged",[this,field_id,e]);if(e.selfTriggered!==true)maybeValidateChange(field_id,
45
+ this)},savingDraft:function(object){console.warn("DEPRECATED: function frmFrontForm.savingDraft in v3.0 use frmProForm.savingDraft");if(typeof frmProForm!=="undefined")return frmProForm.savingDraft(object)},goingToPreviousPage:function(object){console.warn("DEPRECATED: function frmFrontForm.goingToPreviousPage in v3.0 use frmProForm.goingToPreviousPage");if(typeof frmProForm!=="undefined")return frmProForm.goingToPreviousPage(object)},hideOrShowFields:function(ids,event){console.warn("DEPRECATED: function frmFrontForm.hideOrShowFields in v3.0 use frmProForm.hideOrShowFields");
46
+ if(typeof frmProForm!=="undefined")frmProForm.hideOrShowFields()},hidePreviouslyHiddenFields:function(){console.warn("DEPRECATED: function frmFrontForm.hidePreviouslyHiddenFields in v3.0 use frmProForm.hidePreviouslyHiddenFields");if(typeof frmProForm!=="undefined")frmProForm.hidePreviouslyHiddenFields()},checkDependentDynamicFields:function(ids){console.warn("DEPRECATED: function frmFrontForm.checkDependentDynamicFields in v3.0 use frmProForm.checkDependentDynamicFields");if(typeof frmProForm!==
47
+ "undefined")frmProForm.checkDependentDynamicFields(ids)},checkDependentLookupFields:function(ids){console.warn("DEPRECATED: function frmFrontForm.checkDependentLookupFields in v3.0 use frmProForm.checkDependentLookupFields");if(typeof frmProForm!=="undefined")frmProForm.checkDependentLookupFields(ids)},loadGoogle:function(){console.warn("DEPRECATED: function frmFrontForm.loadGoogle in v3.0 use frmProForm.loadGoogle");frmProForm.loadGoogle()},removeUsedTimes:function(obj,timeField){console.warn("DEPRECATED: function frmFrontForm.removeUsedTimes in v3.0 use frmProForm.removeUsedTimes");
48
+ if(typeof frmProForm!=="undefined")frmProForm.removeUsedTimes()},escapeHtml:function(text){return text.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")},invisible:function(classes){jQuery(classes).css("visibility","hidden")},visible:function(classes){jQuery(classes).css("visibility","visible")}}}var frmFrontForm=frmFrontFormJS();jQuery(document).ready(function($){frmFrontForm.init()});
49
+ function frmRecaptcha(){var captchas=jQuery(".frm-g-recaptcha");for(var c=0,cl=captchas.length;c<cl;c++)frmFrontForm.renderRecaptcha(captchas[c])}function frmAfterRecaptcha(token){frmFrontForm.afterSingleRecaptcha(token)}
50
  function frmUpdateField(entry_id,field_id,value,message,num){jQuery(document.getElementById("frm_update_field_"+entry_id+"_"+field_id+"_"+num)).html('<span class="frm-loading-img"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_update_field_ajax",entry_id:entry_id,field_id:field_id,value:value,nonce:frm_js.nonce},success:function(){if(message.replace(/^\s+|\s+$/g,"")==="")jQuery(document.getElementById("frm_update_field_"+entry_id+"_"+field_id+"_"+num)).fadeOut("slow");
51
  else jQuery(document.getElementById("frm_update_field_"+entry_id+"_"+field_id+"_"+num)).replaceWith(message)}})}
52
  function frmDeleteEntry(entry_id,prefix){console.warn("DEPRECATED: function frmDeleteEntry in v2.0.13 use frmFrontForm.deleteEntry");jQuery(document.getElementById("frm_delete_"+entry_id)).replaceWith('<span class="frm-loading-img" id="frm_delete_'+entry_id+'"></span>');jQuery.ajax({type:"POST",url:frm_js.ajax_url,data:{action:"frm_entries_destroy",entry:entry_id,nonce:frm_js.nonce},success:function(html){if(html.replace(/^\s+|\s+$/g,"")==="success")jQuery(document.getElementById(prefix+entry_id)).fadeOut("slow");
js/formidable_admin.js CHANGED
@@ -1875,29 +1875,20 @@ function frmAdminBuildJS() {
1875
  //Add new option or "Other" option to radio/checkbox/dropdown
1876
  function addFieldOption() {
1877
  /*jshint validthis:true */
1878
- var field_id = jQuery( this ).closest( '.frm-single-settings' ).data( 'fid' ),
1879
- newOption = jQuery( '#frm_field_' + field_id + '_opts .frm_option_template' ).prop('outerHTML'),
1880
  opt_type = jQuery( this ).data( 'opttype' ),
1881
  optKey = 0,
1882
- lastKey = 0,
1883
  oldKey = '000',
1884
- lastOpt = jQuery( '#frm_field_' + field_id + '_opts li:last' );
1885
-
1886
- if ( lastOpt.length ) {
1887
- optKey = lastOpt.data( 'optkey');
1888
- lastKey = parseInt( optKey );
1889
- if ( isNaN( lastKey ) ) {
1890
- lastKey = jQuery( '#frm_field_' + field_id + '_opts li' ).length;
1891
- if ( document.getElementById( 'frm_delete_field_' + field_id + '-' + ( lastKey + 1 ) + '_container' ) !== null ) {
1892
- lastKey = lastKey + 2;
1893
- }
1894
- }
1895
  optKey = lastKey + 1;
1896
  }
1897
 
1898
  //Update hidden field
1899
  if ( opt_type === 'other' ) {
1900
- document.getElementById( 'other_input_' + field_id ).value = 1;
1901
 
1902
  //Hide "Add Other" option now if this is radio field
1903
  var ftype = jQuery( this ).data( 'ftype' );
@@ -1906,13 +1897,15 @@ function frmAdminBuildJS() {
1906
  }
1907
 
1908
  var data = {
1909
- action: 'frm_add_field_option', field_id: field_id,
 
1910
  opt_key: optKey,
1911
- opt_type: opt_type, nonce: frmGlobal.nonce
 
1912
  };
1913
  jQuery.post( ajaxurl, data, function( msg ) {
1914
- jQuery( document.getElementById( 'frm_field_' + field_id + '_opts' ) ).append( msg );
1915
- resetDisplayedOpts( field_id );
1916
  } );
1917
  } else {
1918
  newOption = newOption.replace( new RegExp( 'optkey="' + oldKey + '"', 'g' ), 'optkey="' + optKey + '"' );
@@ -1920,9 +1913,33 @@ function frmAdminBuildJS() {
1920
  newOption = newOption.replace( new RegExp( '-' + oldKey + '"', 'g' ), '-' + optKey + '"' );
1921
  newOption = newOption.replace( new RegExp( '\\[' + oldKey + '\\]', 'g' ), '[' + optKey + ']' );
1922
  newOption = newOption.replace( 'frm_hidden frm_option_template', '' );
1923
- jQuery( document.getElementById( 'frm_field_' + field_id + '_opts' ) ).append( newOption );
1924
- resetDisplayedOpts( field_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1925
  }
 
 
1926
  }
1927
 
1928
  function toggleMultSel() {
@@ -1978,16 +1995,20 @@ function frmAdminBuildJS() {
1978
 
1979
  function deleteFieldOption() {
1980
  /*jshint validthis:true */
1981
- var parentLi = this.parentNode;
1982
- var parentUl = parentLi.parentNode;
1983
- var field_id = this.getAttribute( 'data-fid' );
 
1984
 
1985
  jQuery( parentLi ).fadeOut( 'slow', function() {
1986
  jQuery( parentLi ).remove();
1987
 
1988
  var hasOther = jQuery( parentUl ).find( '.frm_other_option' );
1989
  if ( hasOther.length < 1 ) {
1990
- document.getElementById( 'other_input_' + field_id ).value = 0;
 
 
 
1991
  jQuery( '#other_button_' + field_id ).fadeIn( 'slow' );
1992
  }
1993
  } );
@@ -2970,8 +2991,63 @@ function frmAdminBuildJS() {
2970
 
2971
  function changeInputtedValue() {
2972
  /*jshint validthis:true */
2973
- var action = this.getAttribute( 'data-frmchange' );
2974
- this.value = this.value[ action ]();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2975
  }
2976
 
2977
  function submitBuild() {
@@ -4713,8 +4789,8 @@ function frmAdminBuildJS() {
4713
  if ( response.form ) {
4714
  loader.hide();
4715
  jQuery( '.frm-inline-error' ).remove();
4716
- //proceed.val(monsterinsights_admin.proceed);
4717
- //proceed.after('<span class="frm-inline-error">' + monsterinsights_admin.connect_error + '</span>');
4718
  return;
4719
  }
4720
 
@@ -4739,6 +4815,12 @@ function frmAdminBuildJS() {
4739
  // Proceed with CSS changes
4740
  el.parent().removeClass('frm-addon-not-installed frm-addon-installed').addClass('frm-addon-active');
4741
  button.removeClass('frm_loading_button');
 
 
 
 
 
 
4742
  }
4743
 
4744
  function addonError( response, el, button ) {
@@ -5817,6 +5899,16 @@ function frmAdminBuildJS() {
5817
  jQuery( 'select[name="format"]' ).change( checkExportTypes ).change();
5818
  jQuery( 'input[name="frm_export_forms[]"]' ).click( preventMultipleExport );
5819
  initiateMultiselect();
 
 
 
 
 
 
 
 
 
 
5820
  },
5821
 
5822
  updateOpts: function( field_id, opts, modal ) {
1875
  //Add new option or "Other" option to radio/checkbox/dropdown
1876
  function addFieldOption() {
1877
  /*jshint validthis:true */
1878
+ var fieldId = jQuery( this ).closest( '.frm-single-settings' ).data( 'fid' ),
1879
+ newOption = jQuery( '#frm_field_' + fieldId + '_opts .frm_option_template' ).prop('outerHTML'),
1880
  opt_type = jQuery( this ).data( 'opttype' ),
1881
  optKey = 0,
 
1882
  oldKey = '000',
1883
+ lastKey = getHighestOptKey( fieldId );
1884
+
1885
+ if ( lastKey !== oldKey ) {
 
 
 
 
 
 
 
 
1886
  optKey = lastKey + 1;
1887
  }
1888
 
1889
  //Update hidden field
1890
  if ( opt_type === 'other' ) {
1891
+ document.getElementById( 'other_input_' + fieldId ).value = 1;
1892
 
1893
  //Hide "Add Other" option now if this is radio field
1894
  var ftype = jQuery( this ).data( 'ftype' );
1897
  }
1898
 
1899
  var data = {
1900
+ action: 'frm_add_field_option',
1901
+ field_id: fieldId,
1902
  opt_key: optKey,
1903
+ opt_type: opt_type,
1904
+ nonce: frmGlobal.nonce
1905
  };
1906
  jQuery.post( ajaxurl, data, function( msg ) {
1907
+ jQuery( document.getElementById( 'frm_field_' + fieldId + '_opts' ) ).append( msg );
1908
+ resetDisplayedOpts( fieldId );
1909
  } );
1910
  } else {
1911
  newOption = newOption.replace( new RegExp( 'optkey="' + oldKey + '"', 'g' ), 'optkey="' + optKey + '"' );
1913
  newOption = newOption.replace( new RegExp( '-' + oldKey + '"', 'g' ), '-' + optKey + '"' );
1914
  newOption = newOption.replace( new RegExp( '\\[' + oldKey + '\\]', 'g' ), '[' + optKey + ']' );
1915
  newOption = newOption.replace( 'frm_hidden frm_option_template', '' );
1916
+ jQuery( document.getElementById( 'frm_field_' + fieldId + '_opts' ) ).append( newOption );
1917
+ resetDisplayedOpts( fieldId );
1918
+ }
1919
+ }
1920
+
1921
+ function getHighestOptKey( fieldId ) {
1922
+ var i = 0,
1923
+ optKey = 0,
1924
+ opts = jQuery( '#frm_field_' + fieldId + '_opts li' ),
1925
+ lastKey = 0;
1926
+
1927
+ for ( i; i < opts.length; i ++ ) {
1928
+ optKey = opts[i].getAttribute( 'data-optkey' );
1929
+ if ( opts.length === 1 ) {
1930
+ return optKey;
1931
+ }
1932
+ if ( optKey != '000' ) {
1933
+ optKey = optKey.replace( 'other_', '' );
1934
+ optKey = parseInt( optKey );
1935
+ }
1936
+
1937
+ if ( ! isNaN( lastKey ) && ( optKey > lastKey || lastKey === '000' ) ) {
1938
+ lastKey = optKey;
1939
+ }
1940
  }
1941
+
1942
+ return lastKey;
1943
  }
1944
 
1945
  function toggleMultSel() {
1995
 
1996
  function deleteFieldOption() {
1997
  /*jshint validthis:true */
1998
+ var otherInput,
1999
+ parentLi = this.parentNode,
2000
+ parentUl = parentLi.parentNode,
2001
+ field_id = this.getAttribute( 'data-fid' );
2002
 
2003
  jQuery( parentLi ).fadeOut( 'slow', function() {
2004
  jQuery( parentLi ).remove();
2005
 
2006
  var hasOther = jQuery( parentUl ).find( '.frm_other_option' );
2007
  if ( hasOther.length < 1 ) {
2008
+ otherInput = document.getElementById( 'other_input_' + field_id );
2009
+ if ( otherInput !== null ) {
2010
+ otherInput.value = 0;
2011
+ }
2012
  jQuery( '#other_button_' + field_id ).fadeIn( 'slow' );
2013
  }
2014
  } );
2991
 
2992
  function changeInputtedValue() {
2993
  /*jshint validthis:true */
2994
+ var i,
2995
+ action = this.getAttribute( 'data-frmchange' ).split( ',' );
2996
+
2997
+ for ( i = 0; i < action.length; i ++ ) {
2998
+ if ( action[i] == 'updateOption' ) {
2999
+ changeHiddenSeparateValue( this );
3000
+ } else if ( action[i] == 'updateDefault' ) {
3001
+ changeDefaultRadioValue( this );
3002
+ } else {
3003
+ this.value = this.value[ action[i] ]();
3004
+ }
3005
+ }
3006
+ }
3007
+
3008
+ /**
3009
+ * When the saved value is changed, update the default value radio.
3010
+ */
3011
+ function changeDefaultRadioValue( input ) {
3012
+ var parentLi = getOptionParent( input ),
3013
+ key = parentLi.getAttribute( 'data-optkey' ),
3014
+ fieldId = getOptionFieldId( parentLi, key ),
3015
+ defaultRadio = parentLi.querySelector( 'input[name="default_value_' + fieldId + '"]' );
3016
+
3017
+ defaultRadio.value = input.value;
3018
+ }
3019
+
3020
+ /**
3021
+ * If separate values are not enabled, change the saved value when
3022
+ * the displayed value is changed.
3023
+ */
3024
+ function changeHiddenSeparateValue( input ) {
3025
+ var savedVal,
3026
+ parentLi = getOptionParent( input ),
3027
+ key = parentLi.getAttribute( 'data-optkey' ),
3028
+ fieldId = getOptionFieldId( parentLi, key ),
3029
+ sep = document.getElementById( 'separate_value_' + fieldId );
3030
+
3031
+ if ( sep.checked === false ) {
3032
+ // If separate values are not turned on.
3033
+ savedVal = document.getElementById( 'field_key_' + fieldId + '-' + key );
3034
+ savedVal.value = input.value;
3035
+ changeDefaultRadioValue( savedVal );
3036
+ }
3037
+ }
3038
+
3039
+ function getOptionParent( input ) {
3040
+ var parentLi = input.parentNode;
3041
+ if ( parentLi.tagName !== 'LI' ) {
3042
+ parentLi = parentLi.parentNode;
3043
+ }
3044
+ return parentLi;
3045
+ }
3046
+
3047
+ function getOptionFieldId( li, key ) {
3048
+ var liId = li.id;
3049
+
3050
+ return liId.replace( 'frm_delete_field_', '' ).replace( '-' + key + '_container', '' );
3051
  }
3052
 
3053
  function submitBuild() {
4789
  if ( response.form ) {
4790
  loader.hide();
4791
  jQuery( '.frm-inline-error' ).remove();
4792
+ //proceed.val(admin.proceed);
4793
+ //proceed.after('<span class="frm-inline-error">' + admin.connect_error + '</span>');
4794
  return;
4795
  }
4796
 
4815
  // Proceed with CSS changes
4816
  el.parent().removeClass('frm-addon-not-installed frm-addon-installed').addClass('frm-addon-active');
4817
  button.removeClass('frm_loading_button');
4818
+
4819
+ // Maybe refresh import and SMTP pages
4820
+ var refreshPage = document.querySelectorAll( '.frm-admin-page-import, #frm-admin-smtp' );
4821
+ if ( refreshPage.length > 0 ) {
4822
+ window.location.reload();
4823
+ }
4824
  }
4825
 
4826
  function addonError( response, el, button ) {
5899
  jQuery( 'select[name="format"]' ).change( checkExportTypes ).change();
5900
  jQuery( 'input[name="frm_export_forms[]"]' ).click( preventMultipleExport );
5901
  initiateMultiselect();
5902
+
5903
+ jQuery( '.frm-feature-banner .dismiss' ).click( function( event ) {
5904
+ event.preventDefault();
5905
+ jQuery.post( ajaxurl, {
5906
+ action: 'frm_dismiss_migrator',
5907
+ plugin: this.id,
5908
+ nonce: frmGlobal.nonce
5909
+ } );
5910
+ this.parentElement.remove();
5911
+ } );
5912
  },
5913
 
5914
  updateOpts: function( field_id, opts, modal ) {
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 4.04.03\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: 2020-04-23T22:49:02+02:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.1.0\n"
15
  "X-Domain: formidable\n"
@@ -599,7 +599,7 @@ msgid "Installed"
599
  msgstr ""
600
 
601
  #: classes/controllers/FrmAddonsController.php:484
602
- #: classes/helpers/FrmAppHelper.php:2272
603
  msgid "Active"
604
  msgstr ""
605
 
@@ -631,11 +631,11 @@ msgid "Settings"
631
  msgstr ""
632
 
633
  #: classes/controllers/FrmAppController.php:158
634
- #: classes/controllers/FrmXMLController.php:133
635
  #: classes/controllers/FrmFormsController.php:729
636
  #: classes/controllers/FrmEntriesController.php:8
637
  #: classes/controllers/FrmEntriesController.php:90
638
- #: classes/views/xml/import_form.php:115
639
  msgid "Entries"
640
  msgstr ""
641
 
@@ -653,43 +653,43 @@ msgstr ""
653
  msgid "Build a Form"
654
  msgstr ""
655
 
656
- #: classes/controllers/FrmXMLController.php:6
657
  #: classes/views/xml/import_form.php:5
658
  msgid "Import/Export"
659
  msgstr ""
660
 
661
- #: classes/controllers/FrmXMLController.php:48
662
  msgid "There was an error reading the form template"
663
  msgstr ""
664
 
665
- #: classes/controllers/FrmXMLController.php:68
666
  msgid "There was an error importing form"
667
  msgstr ""
668
 
669
- #: classes/controllers/FrmXMLController.php:132
670
  #: classes/controllers/FrmFormsController.php:6
671
  #: classes/controllers/FrmFormsController.php:739
672
  #: classes/views/frm-forms/list.php:5
673
  msgid "Forms"
674
  msgstr ""
675
 
676
- #: classes/controllers/FrmXMLController.php:168
677
  msgid "Oops, you didn't select a file."
678
  msgstr ""
679
 
680
- #: classes/controllers/FrmXMLController.php:179
681
  msgid "The file does not exist, please try again."
682
  msgstr ""
683
 
684
- #: classes/controllers/FrmXMLController.php:208
685
  msgid "XML import is not enabled on your server with the libxml_disable_entity_loader function."
686
  msgstr ""
687
 
688
- #: classes/controllers/FrmXMLController.php:416
689
  msgid "Please select a form"
690
  msgstr ""
691
 
692
- #: classes/controllers/FrmXMLController.php:473
693
  msgid "There are no entries for that form."
694
  msgstr ""
695
 
@@ -807,6 +807,98 @@ msgstr ""
807
  msgid "Analyze form data with graphs & stats"
808
  msgstr ""
809