| @@ -163,9 +163,9 @@ | ||
| 163 | 163 | if ( ! $this->is_current_plugin() ) { |
| 164 | 164 | return; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - delete_transient( FrmOnboardingWizardController::TRANSIENT_NAME ); | |
| 167 | + delete_transient( 'frm_activation_redirect' ); | |
| 168 | 168 | |
| 169 | 169 | // Initial install. |
| 170 | 170 | wp_safe_redirect( $this->settings_link() ); |
| 171 | 171 | exit; |
| @@ -217,9 +217,9 @@ | ||
| 217 | 217 | if ( $steps['complete']['current'] ) { |
| 218 | 218 | // Always show this step in settings. |
| 219 | 219 | $step['current'] = true; |
| 220 | 220 | |
| 221 | - $new_class = $all_imported ? ' button frm_hidden' : ''; | |
| 221 | + $new_class = $all_imported ? ' button frm_hidden' : ''; | |
| 222 | 222 | $step['button_class'] = str_replace( 'frm_grey disabled', $new_class, $step['button_class'] ); |
| 223 | 223 | } |
| 224 | 224 | if ( $all_imported ) { |
| 225 | 225 | $step['description'] = __( 'The following form(s) have been created.', 'formidable' ); |
| @@ -226,10 +226,10 @@ | ||
| 226 | 226 | } |
| 227 | 227 | $this->show_app_install( $step ); |
| 228 | 228 | |
| 229 | 229 | if ( ! $all_imported ) { |
| 230 | - $step = $steps['complete']; | |
| 231 | - $step['current'] = false; | |
| 230 | + $step = $steps['complete']; | |
| 231 | + $step['current'] = false; | |
| 232 | 232 | $step['button_class'] .= ' frm_grey disabled'; |
| 233 | 233 | $this->show_page_links( $step ); |
| 234 | 234 | } |
| 235 | 235 | } |
| @@ -309,37 +309,37 @@ | ||
| 309 | 309 | protected function get_steps_data() { |
| 310 | 310 | $pro_installed = FrmAppHelper::pro_is_connected(); |
| 311 | 311 | |
| 312 | 312 | $steps = array( |
| 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, | |
| 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, | |
| 320 | 320 | ), |
| 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, | |
| 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, | |
| 328 | 328 | ), |
| 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, | |
| 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, | |
| 335 | 335 | ), |
| 336 | 336 | 'complete' => array( |
| 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, | |
| 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, | |
| 342 | 342 | ), |
| 343 | 343 | ); |
| 344 | 344 | |
| 345 | 345 | $this->adjust_plugin_install_step( $steps ); |
| @@ -351,9 +351,9 @@ | ||
| 351 | 351 | if ( $step['complete'] ) { |
| 352 | 352 | $steps[ $k ]['current'] = false; |
| 353 | 353 | } else { |
| 354 | 354 | $steps[ $k ]['current'] = ! $has_current; |
| 355 | - $has_current = true; | |
| 355 | + $has_current = true; | |
| 356 | 356 | } |
| 357 | 357 | } elseif ( $step['current'] ) { |
| 358 | 358 | $has_current = true; |
| 359 | 359 | } |
| @@ -358,9 +358,9 @@ | ||
| 358 | 358 | $has_current = true; |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | // Set disabled buttons. |
| 362 | - $class = $step['button_class'] ?? ''; | |
| 362 | + $class = isset( $step['button_class'] ) ? $step['button_class'] : ''; | |
| 363 | 363 | $class .= ' button-primary frm-button-primary'; |
| 364 | 364 | if ( ! $steps[ $k ]['current'] ) { |
| 365 | 365 | $class .= ' frm_grey disabled'; |
| 366 | 366 | } |
| @@ -390,8 +390,9 @@ | ||
| 390 | 390 | $plugin = FrmAddonsController::install_link( $plugin_key ); |
| 391 | 391 | if ( $plugin['status'] === 'active' ) { |
| 392 | 392 | continue; |
| 393 | 393 | } |
| 394 | + $links[ $plugin_key ] = $plugin; | |
| 394 | 395 | if ( isset( $plugin['url'] ) ) { |
| 395 | 396 | $rel[] = $plugin['url']; |
| 396 | 397 | } else { |
| 397 | 398 | // Add-on is required but not allowed. |
| @@ -406,9 +407,9 @@ | ||
| 406 | 407 | esc_html__( 'You need permission to download the Formidable %1$s plugin', 'formidable' ), |
| 407 | 408 | implode( ', ', $missing ) |
| 408 | 409 | ); |
| 409 | 410 | } else { |
| 410 | - $steps['plugin']['links'] = $rel; | |
| 411 | + $steps['plugin']['links'] = $rel; | |
| 411 | 412 | $steps['plugin']['button_class'] = 'frm-solution-multiple '; |
| 412 | 413 | } |
| 413 | 414 | |
| 414 | 415 | if ( $steps['license']['complete'] && ! $steps['plugin']['complete'] ) { |
| @@ -419,9 +420,9 @@ | ||
| 419 | 420 | /** |
| 420 | 421 | * @return void |
| 421 | 422 | */ |
| 422 | 423 | protected function step_top( $step ) { |
| 423 | - $section_class = empty( $step['current'] ) ? 'frm_grey' : ''; | |
| 424 | + $section_class = ( ! isset( $step['current'] ) || ! $step['current'] ) ? 'frm_grey' : ''; | |
| 424 | 425 | |
| 425 | 426 | ?> |
| 426 | 427 | <section class="step step-install <?php echo esc_attr( $section_class ); ?>"> |
| 427 | 428 | <aside class="num"> |
| @@ -491,9 +492,9 @@ | ||
| 491 | 492 | protected function show_plugin_install( $step ) { |
| 492 | 493 | $this->step_top( $step ); |
| 493 | 494 | |
| 494 | 495 | if ( ! isset( $step['error'] ) ) { |
| 495 | - $rel = $step['links'] ?? array(); | |
| 496 | + $rel = isset( $step['links'] ) ? $step['links'] : array(); | |
| 496 | 497 | |
| 497 | 498 | ?> |
| 498 | 499 | <a rel="<?php echo esc_attr( implode( ',', $rel ) ); ?>" class="<?php echo esc_attr( $step['button_class'] ); ?>"> |
| 499 | 500 | <?php echo esc_html( $step['button_label'] ); ?> |
| @@ -517,9 +518,9 @@ | ||
| 517 | 518 | |
| 518 | 519 | $api = new FrmFormApi(); |
| 519 | 520 | $addons = $api->get_api_info(); |
| 520 | 521 | |
| 521 | - $id = $this->download_id(); | |
| 522 | + $id = $this->download_id(); | |
| 522 | 523 | $has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] ); |
| 523 | 524 | |
| 524 | 525 | if ( ! $step['current'] ) { |
| 525 | 526 | ?> |
| @@ -613,9 +614,9 @@ | ||
| 613 | 614 | $count = count( $options ); |
| 614 | 615 | foreach ( $options as $info ) { |
| 615 | 616 | // Count the number of options displayed for css. |
| 616 | 617 | if ( $count > 1 && ! isset( $info['img'] ) ) { |
| 617 | - --$count; | |
| 618 | + $count --; | |
| 618 | 619 | } |
| 619 | 620 | } |
| 620 | 621 | $width = floor( ( 533 - ( ( $count - 1 ) * 20 ) ) / $count ); |
| 621 | 622 | unset( $count ); |
| @@ -621,9 +622,9 @@ | ||
| 621 | 622 | unset( $count ); |
| 622 | 623 | |
| 623 | 624 | $selected = false; |
| 624 | 625 | |
| 625 | - include FrmAppHelper::plugin_path() . '/classes/views/solutions/_import.php'; | |
| 626 | + include( FrmAppHelper::plugin_path() . '/classes/views/solutions/_import.php' ); | |
| 626 | 627 | } |
| 627 | 628 | |
| 628 | 629 | /** |
| 629 | 630 | * @return void |
| @@ -671,9 +672,9 @@ | ||
| 671 | 672 | * |
| 672 | 673 | * @return bool |
| 673 | 674 | */ |
| 674 | 675 | protected function is_current_plugin() { |
| 675 | - $to_redirect = get_transient( FrmOnboardingWizardController::TRANSIENT_NAME ); | |
| 676 | + $to_redirect = get_transient( 'frm_activation_redirect' ); | |
| 676 | 677 | return $to_redirect === $this->plugin_slug && empty( $this->is_complete() ); |
| 677 | 678 | } |
| 678 | 679 | |
| 679 | 680 | /** |
| @@ -784,8 +785,10 @@ | ||
| 784 | 785 | wp_enqueue_style( 'formidable-pro-fields' ); |
| 785 | 786 | ?> |
| 786 | 787 | <style> |
| 787 | 788 | #frm-welcome *, #frm-welcome *::before, #frm-welcome *::after { |
| 789 | + -webkit-box-sizing: border-box; | |
| 790 | + -moz-box-sizing: border-box; | |
| 788 | 791 | box-sizing: border-box; |
| 789 | 792 | } |
| 790 | 793 | #frm-welcome{ |
| 791 | 794 | width: 700px; |
| @@ -844,8 +847,10 @@ | ||
| 844 | 847 | border-radius: 3px; |
| 845 | 848 | } |
| 846 | 849 | #frm-welcome .step, |
| 847 | 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); | |
| 848 | 853 | box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05); |
| 849 | 854 | } |
| 850 | 855 | #frm-welcome .step { |
| 851 | 856 | background-color: #F9F9F9; |
| @@ -888,5 +893,6 @@ | ||
| 888 | 893 | } |
| 889 | 894 | </style> |
| 890 | 895 | <?php |
| 891 | 896 | } |
| 897 | + | |
| 892 | 898 | } |