PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.8
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.8
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/FrmSolution.php +69 -140 6.296.8 View file →
@@ -3,9 +3,8 @@
3 3 * Handles the installation of a solution and any dependencies.
4 4 * This page is shown when a Formidable plugin is activated.
5 5 *
6 6 * @since 4.06.02
7 - *
8 7 * @package Formidable
9 8 */
10 9
11 10 if ( ! defined( 'ABSPATH' ) ) {
@@ -13,16 +12,10 @@
13 12 }
14 13
15 14 class FrmSolution {
16 15
17 - /**
18 - * @var string
19 - */
20 16 protected $plugin_slug = '';
21 17
22 - /**
23 - * @var string
24 - */
25 18 protected $plugin_file = '';
26 19
27 20 /**
28 21 * Hidden welcome page slug.
@@ -27,23 +20,16 @@
27 20 /**
28 21 * Hidden welcome page slug.
29 22 *
30 23 * @since 4.06.02
31 - *
32 24 * @var string
33 25 */
34 26 protected $page = '';
35 27
36 - /**
37 - * @var string
38 - */
39 - protected $icon = 'frmfont frm_settings_icon';
28 + protected $icon = 'frm_icon_font frm_settings_icon';
40 29
41 - /**
42 - * @param array $atts
43 - */
44 30 public function __construct( $atts = array() ) {
45 - if ( ! $this->plugin_slug ) {
31 + if ( empty( $this->plugin_slug ) ) {
46 32 return;
47 33 }
48 34
49 35 add_action( 'plugins_loaded', array( $this, 'load_hooks' ), 50 );
@@ -48,9 +34,9 @@
48 34
49 35 add_action( 'plugins_loaded', array( $this, 'load_hooks' ), 50 );
50 36 add_action( 'admin_init', array( $this, 'redirect' ), 9999 );
51 37
52 - if ( ! $this->plugin_file ) {
38 + if ( empty( $this->plugin_file ) ) {
53 39 $this->plugin_file = $this->plugin_slug . '.php';
54 40 }
55 41 }
56 42
@@ -82,16 +68,11 @@
82 68 add_action( 'admin_menu', array( $this, 'register' ) );
83 69 add_action( 'admin_head', array( $this, 'hide_menu' ) );
84 70 }
85 71
86 - /**
87 - * @param array $links
88 - *
89 - * @return array
90 - */
91 72 public function plugin_links( $links ) {
92 73 if ( ! $this->is_complete() ) {
93 - $settings = '<a href="' . esc_url( $this->settings_link() ) . '">' . esc_html__( 'Setup', 'formidable' ) . '</a>';
74 + $settings = '<a href="' . esc_url( $this->settings_link() ) . '">' . __( 'Setup', 'formidable' ) . '</a>';
94 75 array_unshift( $links, $settings );
95 76 }
96 77
97 78 return $links;
@@ -107,8 +88,9 @@
107 88 *
108 89 * @return void
109 90 */
110 91 public function register() {
92 +
111 93 // Getting started - shows after installation.
112 94 add_dashboard_page(
113 95 esc_html( $this->page_title() ),
114 96 esc_html( $this->page_title() ),
@@ -164,10 +146,10 @@
164 146 *
165 147 * @return void
166 148 */
167 149 public function redirect() {
150 +
168 151 $current_page = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
169 -
170 152 if ( $current_page === $this->page ) {
171 153 // Prevent endless loop.
172 154 return;
173 155 }
@@ -181,9 +163,9 @@
181 163 if ( ! $this->is_current_plugin() ) {
182 164 return;
183 165 }
184 166
185 - delete_transient( FrmOnboardingWizardController::TRANSIENT_NAME );
167 + delete_transient( 'frm_activation_redirect' );
186 168
187 169 // Initial install.
188 170 wp_safe_redirect( $this->settings_link() );
189 171 exit;
@@ -197,12 +179,8 @@
197 179 }
198 180
199 181 /**
200 182 * Add page to global settings.
201 - *
202 - * @param array $sections Sections.
203 - *
204 - * @return array
205 183 */
206 184 public function add_settings( $sections ) {
207 185 wp_enqueue_style( 'formidable-pro-fields' );
208 186 $sections[ $this->plugin_slug ] = array(
@@ -222,9 +200,8 @@
222 200 * @return void
223 201 */
224 202 public function settings_page() {
225 203 $steps = $this->get_steps_data();
226 -
227 204 if ( ! $steps['license']['complete'] || ( isset( $steps['plugin'] ) && ! $steps['plugin']['complete'] ) ) {
228 205 // Redirect to the welcome page if install hasn't been done.
229 206 $url = $this->settings_link();
230 207 echo '<script>window.location.replace("' . esc_url_raw( $url ) . '");</script>';
@@ -230,9 +207,10 @@
230 207 echo '<script>window.location.replace("' . esc_url_raw( $url ) . '");</script>';
231 208 return;
232 209 }
233 210
234 - $all_imported = $this->is_complete( 'all' );
211 + $all_imported = $this->is_complete( 'all' );
212 +
235 213 $step = $steps['import'];
236 214 $step['label'] = '';
237 215 $step['nested'] = true;
238 216
@@ -239,27 +217,22 @@
239 217 if ( $steps['complete']['current'] ) {
240 218 // Always show this step in settings.
241 219 $step['current'] = true;
242 220
243 - $new_class = $all_imported ? ' button frm_hidden' : '';
221 + $new_class = $all_imported ? ' button frm_hidden' : '';
244 222 $step['button_class'] = str_replace( 'frm_grey disabled', $new_class, $step['button_class'] );
245 223 }
246 -
247 224 if ( $all_imported ) {
248 225 $step['description'] = __( 'The following form(s) have been created.', 'formidable' );
249 226 }
250 -
251 227 $this->show_app_install( $step );
252 228
253 - if ( $all_imported ) {
254 - return;
229 + if ( ! $all_imported ) {
230 + $step = $steps['complete'];
231 + $step['current'] = false;
232 + $step['button_class'] .= ' frm_grey disabled';
233 + $this->show_page_links( $step );
255 234 }
256 -
257 - $step = $steps['complete'];
258 - $step['current'] = false;
259 - $step['button_class'] .= ' frm_grey disabled';
260 -
261 - $this->show_page_links( $step );
262 235 }
263 236
264 237 /**
265 238 * Getting Started screen. Shows after first install.
@@ -289,9 +262,8 @@
289 262 'height' => 90,
290 263 'width' => 90,
291 264 );
292 265
293 - // phpcs:disable Generic.WhiteSpace.ScopeIndent
294 266 ?>
295 267 <section class="top">
296 268 <div class="frm-smtp-logos">
297 269 <?php FrmAppHelper::show_logo( $size ); ?>
@@ -315,9 +287,8 @@
315 287 <h1><?php echo esc_html( $this->page_title() ); ?></h1>
316 288 <p><?php echo esc_html( $this->page_description() ); ?></p>
317 289 </section>
318 290 <?php
319 - // phpcs:enable Generic.WhiteSpace.ScopeIndent
320 291 }
321 292
322 293 /**
323 294 * This is the welcome page content.
@@ -327,9 +298,8 @@
327 298 */
328 299 protected function main_content() {
329 300 $steps = $this->get_steps_data();
330 301 $this->license_box( $steps['license'] );
331 -
332 302 if ( isset( $steps['plugin'] ) ) {
333 303 $this->show_plugin_install( $steps['plugin'] );
334 304 }
335 305 $this->show_app_install( $steps['import'] );
@@ -335,44 +305,41 @@
335 305 $this->show_app_install( $steps['import'] );
336 306 $this->show_page_links( $steps['complete'] );
337 307 }
338 308
339 - /**
340 - * @return array
341 - */
342 309 protected function get_steps_data() {
343 310 $pro_installed = FrmAppHelper::pro_is_connected();
344 311
345 312 $steps = array(
346 - 'license' => array(
347 - 'label' => __( 'Connect to FormidableForms.com', 'formidable' ),
348 - 'description' => __( 'Create a connection to get plugin downloads.', 'formidable' ),
349 - 'button_label' => __( 'Connect an Account', 'formidable' ),
350 - 'current' => ! $pro_installed,
351 - 'complete' => $pro_installed,
352 - 'num' => 1,
313 + 'license' => array(
314 + 'label' => __( 'Connect to FormidableForms.com', 'formidable' ),
315 + 'description' => __( 'Create a connection to get plugin downloads.', 'formidable' ),
316 + 'button_label' => __( 'Connect an Account', 'formidable' ),
317 + 'current' => empty( $pro_installed ),
318 + 'complete' => $pro_installed,
319 + 'num' => 1,
353 320 ),
354 - 'plugin' => array(
355 - 'label' => __( 'Install and Activate Add-Ons', 'formidable' ),
356 - 'description' => __( 'Install any required add-ons from FormidableForms.com.', 'formidable' ),
357 - 'button_label' => __( 'Install & Activate', 'formidable' ),
358 - 'current' => false,
359 - 'complete' => false,
360 - 'num' => 2,
321 + 'plugin' => array(
322 + 'label' => __( 'Install and Activate Add-Ons', 'formidable' ),
323 + 'description' => __( 'Install any required add-ons from FormidableForms.com.', 'formidable' ),
324 + 'button_label' => __( 'Install & Activate', 'formidable' ),
325 + 'current' => false,
326 + 'complete' => false,
327 + 'num' => 2,
361 328 ),
362 - 'import' => array(
363 - 'label' => __( 'Setup Forms, Views, and Pages', 'formidable' ),
364 - 'description' => __( 'Build the forms, views, and pages automatically.', 'formidable' ),
365 - 'button_label' => __( 'Create Now', 'formidable' ),
366 - 'complete' => $this->is_complete(),
367 - 'num' => 3,
329 + 'import' => array(
330 + 'label' => __( 'Setup Forms, Views, and Pages', 'formidable' ),
331 + 'description' => __( 'Build the forms, views, and pages automatically.', 'formidable' ),
332 + 'button_label' => __( 'Create Now', 'formidable' ),
333 + 'complete' => $this->is_complete(),
334 + 'num' => 3,
368 335 ),
369 336 'complete' => array(
370 - 'label' => __( 'Customize Your New Pages', 'formidable' ),
371 - 'description' => __( 'Make any required changes and publish the page.', 'formidable' ),
372 - 'button_label' => __( 'View Page', 'formidable' ),
373 - 'complete' => false,
374 - 'num' => 4,
337 + 'label' => __( 'Customize Your New Pages', 'formidable' ),
338 + 'description' => __( 'Make any required changes and publish the page.', 'formidable' ),
339 + 'button_label' => __( 'View Page', 'formidable' ),
340 + 'complete' => false,
341 + 'num' => 4,
375 342 ),
376 343 );
377 344
378 345 $this->adjust_plugin_install_step( $steps );
@@ -377,9 +344,8 @@
377 344
378 345 $this->adjust_plugin_install_step( $steps );
379 346
380 347 $has_current = false;
381 -
382 348 foreach ( $steps as $k => $step ) {
383 349 // Set the current step.
384 350 if ( ! isset( $step['current'] ) ) {
385 351 if ( $step['complete'] ) {
@@ -385,9 +351,9 @@
385 351 if ( $step['complete'] ) {
386 352 $steps[ $k ]['current'] = false;
387 353 } else {
388 354 $steps[ $k ]['current'] = ! $has_current;
389 - $has_current = true;
355 + $has_current = true;
390 356 }
391 357 } elseif ( $step['current'] ) {
392 358 $has_current = true;
393 359 }
@@ -392,11 +358,10 @@
392 358 $has_current = true;
393 359 }
394 360
395 361 // Set disabled buttons.
396 - $class = $step['button_class'] ?? '';
362 + $class = isset( $step['button_class'] ) ? $step['button_class'] : '';
397 363 $class .= ' button-primary frm-button-primary';
398 -
399 364 if ( ! $steps[ $k ]['current'] ) {
400 365 $class .= ' frm_grey disabled';
401 366 }
402 367 $steps[ $k ]['button_class'] = $class;
@@ -411,10 +376,9 @@
411 376 * @return void
412 377 */
413 378 protected function adjust_plugin_install_step( &$steps ) {
414 379 $plugins = $this->required_plugins();
415 -
416 - if ( ! $plugins ) {
380 + if ( empty( $plugins ) ) {
417 381 unset( $steps['plugin'] );
418 382 $steps['import']['num'] = 2;
419 383 $steps['complete']['num'] = 3;
420 384 return;
@@ -421,16 +385,14 @@
421 385 }
422 386
423 387 $missing = array();
424 388 $rel = array();
425 -
426 389 foreach ( $plugins as $plugin_key ) {
427 390 $plugin = FrmAddonsController::install_link( $plugin_key );
428 -
429 391 if ( $plugin['status'] === 'active' ) {
430 392 continue;
431 393 }
432 -
394 + $links[ $plugin_key ] = $plugin;
433 395 if ( isset( $plugin['url'] ) ) {
434 396 $rel[] = $plugin['url'];
435 397 } else {
436 398 // Add-on is required but not allowed.
@@ -436,12 +398,11 @@
436 398 // Add-on is required but not allowed.
437 399 $missing[] = $plugin_key;
438 400 }
439 401 }
440 -
441 - if ( ! $rel && ! $missing ) {
402 + if ( empty( $rel ) && empty( $missing ) ) {
442 403 $steps['plugin']['complete'] = true;
443 - } elseif ( $missing ) {
404 + } elseif ( ! empty( $missing ) ) {
444 405 $steps['plugin']['error'] = sprintf(
445 406 /* translators: %1$s: Plugin name */
446 407 esc_html__( 'You need permission to download the Formidable %1$s plugin', 'formidable' ),
447 408 implode( ', ', $missing )
@@ -446,9 +407,9 @@
446 407 esc_html__( 'You need permission to download the Formidable %1$s plugin', 'formidable' ),
447 408 implode( ', ', $missing )
448 409 );
449 410 } else {
450 - $steps['plugin']['links'] = $rel;
411 + $steps['plugin']['links'] = $rel;
451 412 $steps['plugin']['button_class'] = 'frm-solution-multiple ';
452 413 }
453 414
454 415 if ( $steps['license']['complete'] && ! $steps['plugin']['complete'] ) {
@@ -456,21 +417,18 @@
456 417 }
457 418 }
458 419
459 420 /**
460 - * @param array $step Step.
461 - *
462 421 * @return void
463 422 */
464 423 protected function step_top( $step ) {
465 - $section_class = ! empty( $step['current'] ) ? '' : 'frm_grey';
424 + $section_class = ( ! isset( $step['current'] ) || ! $step['current'] ) ? 'frm_grey' : '';
466 425
467 - // phpcs:disable Generic.WhiteSpace.ScopeIndent
468 426 ?>
469 427 <section class="step step-install <?php echo esc_attr( $section_class ); ?>">
470 428 <aside class="num">
471 429 <?php
472 - if ( ! empty( $step['complete'] ) ) {
430 + if ( isset( $step['complete'] ) && $step['complete'] ) {
473 431 FrmAppHelper::icon_by_class(
474 432 'frmfont frm_step_complete_icon',
475 433 array(
476 434 /* translators: %1$s: Step number */
@@ -479,9 +437,9 @@
479 437 )
480 438 );
481 439 } else {
482 440 ?>
483 - <svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 100 100"><circle cx="50" cy="50" r="50" fill="#ccc"/><text x="50%" y="50%" text-anchor="middle" fill="#fff" stroke="#fff" stroke-width="2px" dy=".3em" font-size="3.7em"><?php echo esc_html( $step['num'] ); ?></text></svg><?php // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ?>
441 + <svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 100 100"><circle cx="50" cy="50" r="50" fill="#ccc"/><text x="50%" y="50%" text-anchor="middle" fill="#fff" stroke="#fff" stroke-width="2px" dy=".3em" font-size="3.7em"><?php echo esc_html( $step['num'] ); ?></text></svg>
484 442 <?php
485 443 }
486 444 ?>
487 445 <i class="loader hidden"></i>
@@ -494,30 +452,23 @@
494 452 <?php if ( isset( $step['error'] ) ) { ?>
495 453 <p class="frm_error"><?php echo esc_html( $step['error'] ); ?></p>
496 454 <?php } ?>
497 455 <?php
498 - // phpcs:enable Generic.WhiteSpace.ScopeIndent
499 456 }
500 457
501 458 /**
502 - * @param array $step Step.
503 - *
504 459 * @return void
505 460 */
506 461 protected function step_bottom( $step ) {
507 - // phpcs:disable Generic.WhiteSpace.ScopeIndent
508 462 ?>
509 463 </div>
510 464 </section>
511 465 <?php
512 - // phpcs:enable Generic.WhiteSpace.ScopeIndent
513 466 }
514 467
515 468 /**
516 469 * Generate and output Connect step section HTML.
517 470 *
518 - * @param array $step Step.
519 - *
520 471 * @return void
521 472 */
522 473 protected function license_box( $step ) {
523 474 $this->step_top( $step );
@@ -522,15 +473,13 @@
522 473 protected function license_box( $step ) {
523 474 $this->step_top( $step );
524 475
525 476 if ( $step['complete'] ) {
526 - // phpcs:disable Generic.WhiteSpace.ScopeIndent
527 477 ?>
528 478 <a href="#" class="<?php echo esc_attr( $step['button_class'] ); ?>">
529 479 <?php echo esc_html( $step['button_label'] ); ?>
530 480 </a>
531 481 <?php
532 - // phpcs:enable Generic.WhiteSpace.ScopeIndent
533 482 } else {
534 483 FrmSettingsController::license_box();
535 484 }
536 485
@@ -537,10 +486,8 @@
537 486 $this->step_bottom( $step );
538 487 }
539 488
540 489 /**
541 - * @param array $step Step.
542 - *
543 490 * @return void
544 491 */
545 492 protected function show_plugin_install( $step ) {
546 493 $this->step_top( $step );
@@ -545,17 +492,15 @@
545 492 protected function show_plugin_install( $step ) {
546 493 $this->step_top( $step );
547 494
548 495 if ( ! isset( $step['error'] ) ) {
549 - $rel = $step['links'] ?? array();
496 + $rel = isset( $step['links'] ) ? $step['links'] : array();
550 497
551 - // phpcs:disable Generic.WhiteSpace.ScopeIndent
552 498 ?>
553 499 <a rel="<?php echo esc_attr( implode( ',', $rel ) ); ?>" class="<?php echo esc_attr( $step['button_class'] ); ?>">
554 500 <?php echo esc_html( $step['button_label'] ); ?>
555 501 </a>
556 502 <?php
557 - // phpcs:enable Generic.WhiteSpace.ScopeIndent
558 503 }
559 504
560 505 $this->step_bottom( $step );
561 506 }
@@ -560,27 +505,24 @@
560 505 $this->step_bottom( $step );
561 506 }
562 507
563 508 /**
564 - * @param array $step Step.
565 - *
566 509 * @return void
567 510 */
568 511 protected function show_app_install( $step ) {
569 512 $is_complete = $step['complete'];
570 -
571 - if ( $this->form_options() && ! $is_complete ) {
513 + if ( ! empty( $this->form_options() ) && ! $is_complete ) {
572 514 $step['description'] = __( 'Select the form or view you would like to create.', 'formidable' );
573 515 }
574 516
575 517 $this->step_top( $step );
576 518
577 - $api = new FrmFormApi();
578 - $addons = $api->get_api_info();
579 - $id = $this->download_id();
519 + $api = new FrmFormApi();
520 + $addons = $api->get_api_info();
521 +
522 + $id = $this->download_id();
580 523 $has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] );
581 524
582 - // phpcs:disable Generic.WhiteSpace.ScopeIndent
583 525 if ( ! $step['current'] ) {
584 526 ?>
585 527 <a href="#" class="<?php echo esc_attr( $step['button_class'] ); ?>">
586 528 <?php echo esc_html( $step['button_label'] ); ?>
@@ -593,12 +535,11 @@
593 535
594 536 if ( ! $has_file ) {
595 537 echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>';
596 538 } elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) {
597 - echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>'; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
539 + echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>';
598 540 } else {
599 541 $xml = $addons[ $id ]['beta']['package'];
600 -
601 542 if ( is_array( $xml ) ) {
602 543 $xml = reset( $xml );
603 544 }
604 545
@@ -636,16 +577,13 @@
636 577 } else {
637 578 echo '</form>';
638 579 }
639 580 }//end if
640 - // phpcs:enable Generic.WhiteSpace.ScopeIndent
641 581
642 582 $this->step_bottom( $step );
643 583 }
644 584
645 585 /**
646 - * @param string $xml
647 - *
648 586 * @return void
649 587 */
650 588 protected function show_form_options( $xml ) {
651 589 $this->show_import_options( $this->form_options(), 'form', $xml );
@@ -667,28 +605,26 @@
667 605 *
668 606 * @return void
669 607 */
670 608 protected function show_import_options( $options, $importing, $xml = '' ) {
671 - if ( ! $options ) {
609 + if ( empty( $options ) ) {
672 610 return;
673 611 }
674 612
675 613 $imported = $this->previously_imported_forms();
676 614 $count = count( $options );
677 -
678 615 foreach ( $options as $info ) {
679 616 // Count the number of options displayed for css.
680 617 if ( $count > 1 && ! isset( $info['img'] ) ) {
681 - --$count;
618 + $count --;
682 619 }
683 620 }
684 -
685 621 $width = floor( ( 533 - ( ( $count - 1 ) * 20 ) ) / $count );
686 622 unset( $count );
687 623
688 624 $selected = false;
689 625
690 - include FrmAppHelper::plugin_path() . '/classes/views/solutions/_import.php';
626 + include( FrmAppHelper::plugin_path() . '/classes/views/solutions/_import.php' );
691 627 }
692 628
693 629 /**
694 630 * @return void
@@ -694,32 +630,26 @@
694 630 * @return void
695 631 */
696 632 protected function show_page_options() {
697 633 $pages = $this->needed_pages();
698 -
699 - if ( ! $pages ) {
634 + if ( empty( $pages ) ) {
700 635 return;
701 636 }
702 637
703 638 echo '<h3>Choose New Page Title</h3>';
704 -
705 639 foreach ( $pages as $page ) {
706 - // phpcs:disable Generic.WhiteSpace.ScopeIndent
707 640 ?>
708 641 <p>
709 642 <label for="pages_<?php echo esc_html( $page['type'] ); ?>">
710 643 <?php echo esc_html( $page['label'] ); ?>
711 644 </label>
712 - <input type="text" name="pages[<?php echo esc_html( $page['type'] ); ?>]" value="<?php echo esc_attr( $page['name'] ); ?>" id="pages_<?php echo esc_html( $page['type'] ); ?>" required /><?php // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ?>
645 + <input type="text" name="pages[<?php echo esc_html( $page['type'] ); ?>]" value="<?php echo esc_attr( $page['name'] ); ?>" id="pages_<?php echo esc_html( $page['type'] ); ?>" required />
713 646 </p>
714 647 <?php
715 - // phpcs:enable Generic.WhiteSpace.ScopeIndent
716 648 }
717 649 }
718 650
719 651 /**
720 - * @param array $step
721 - *
722 652 * @return void
723 653 */
724 654 protected function show_page_links( $step ) {
725 655 if ( $step['current'] ) {
@@ -727,15 +657,13 @@
727 657 }
728 658
729 659 $this->step_top( $step );
730 660
731 - // phpcs:disable Generic.WhiteSpace.ScopeIndent
732 661 ?>
733 662 <a href="#" target="_blank" rel="noopener" id="frm-redirect-link" class="<?php echo esc_attr( $step['button_class'] ); ?>">
734 663 <?php echo esc_html( $step['button_label'] ); ?>
735 664 </a>
736 665 <?php
737 - // phpcs:enable Generic.WhiteSpace.ScopeIndent
738 666
739 667 $this->step_bottom( $step );
740 668 }
741 669
@@ -744,10 +672,10 @@
744 672 *
745 673 * @return bool
746 674 */
747 675 protected function is_current_plugin() {
748 - $to_redirect = get_transient( FrmOnboardingWizardController::TRANSIENT_NAME );
749 - return $to_redirect === $this->plugin_slug && ! $this->is_complete();
676 + $to_redirect = get_transient( 'frm_activation_redirect' );
677 + return $to_redirect === $this->plugin_slug && empty( $this->is_complete() );
750 678 }
751 679
752 680 /**
753 681 * Override this function to indicate when install is complete.
@@ -759,13 +687,11 @@
759 687 * @return bool
760 688 */
761 689 protected function is_complete( $count = 1 ) {
762 690 $imported = $this->previously_imported_forms();
763 -
764 691 if ( $count === 'all' ) {
765 692 return count( $imported ) >= count( $this->form_options() );
766 693 }
767 -
768 694 return ! empty( $imported );
769 695 }
770 696
771 697 /**
@@ -775,12 +701,10 @@
775 701 */
776 702 protected function previously_imported_forms() {
777 703 $imported = array();
778 704 $forms = $this->form_options();
779 -
780 705 foreach ( $forms as $form ) {
781 706 $was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false;
782 -
783 707 if ( $was_imported ) {
784 708 $imported[ $form['form'] ] = $was_imported;
785 709 }
786 710 }
@@ -861,8 +785,10 @@
861 785 wp_enqueue_style( 'formidable-pro-fields' );
862 786 ?>
863 787 <style>
864 788 #frm-welcome *, #frm-welcome *::before, #frm-welcome *::after {
789 + -webkit-box-sizing: border-box;
790 + -moz-box-sizing: border-box;
865 791 box-sizing: border-box;
866 792 }
867 793 #frm-welcome{
868 794 width: 700px;
@@ -921,8 +847,10 @@
921 847 border-radius: 3px;
922 848 }
923 849 #frm-welcome .step,
924 850 #frm-welcome .screenshot .cont {
851 + -webkit-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05);
852 + -moz-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05);
925 853 box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05);
926 854 }
927 855 #frm-welcome .step {
928 856 background-color: #F9F9F9;
@@ -965,5 +893,6 @@
965 893 }
966 894 </style>
967 895 <?php
968 896 }
897 +
969 898 }