← All changes
|
classes/controllers/FrmOnboardingWizardController.php
+105
-155
6.26
→
6.10
View file →
| @@ -45,9 +45,8 @@ | ||
| 45 | 45 | const TRANSIENT_NAME = 'frm_activation_redirect'; |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * Transient value associated with the redirection to the Onboarding Wizard page. |
| 49 | - * Used when activating a single plugin. | |
| 50 | 49 | * |
| 51 | 50 | * @var string |
| 52 | 51 | */ |
| 53 | 52 | const TRANSIENT_VALUE = 'formidable-welcome'; |
| @@ -52,16 +51,8 @@ | ||
| 52 | 51 | */ |
| 53 | 52 | const TRANSIENT_VALUE = 'formidable-welcome'; |
| 54 | 53 | |
| 55 | 54 | /** |
| 56 | - * Transient value associated with the redirection to the Onboarding Wizard page. | |
| 57 | - * Used when activating multiple plugins at once. | |
| 58 | - * | |
| 59 | - * @var string | |
| 60 | - */ | |
| 61 | - const TRANSIENT_MULTI_VALUE = 'formidable-welcome-multi'; | |
| 62 | - | |
| 63 | - /** | |
| 64 | 55 | * Option name for storing the redirect status for the Onboarding Wizard page. |
| 65 | 56 | * |
| 66 | 57 | * @var string |
| 67 | 58 | */ |
| @@ -78,9 +69,9 @@ | ||
| 78 | 69 | * Defines the initial step for redirection within the application flow. |
| 79 | 70 | * |
| 80 | 71 | * @var string |
| 81 | 72 | */ |
| 82 | - const INITIAL_STEP = 'consent-tracking'; | |
| 73 | + const INITIAL_STEP = 'welcome'; | |
| 83 | 74 | |
| 84 | 75 | /** |
| 85 | 76 | * Option name to store usage data. |
| 86 | 77 | * |
| @@ -119,17 +110,15 @@ | ||
| 119 | 110 | /** |
| 120 | 111 | * Initialize hooks for template page only. |
| 121 | 112 | * |
| 122 | 113 | * @since 6.9 |
| 123 | - * | |
| 124 | - * @return void | |
| 125 | 114 | */ |
| 126 | 115 | public static function load_admin_hooks() { |
| 127 | 116 | self::set_page_url(); |
| 128 | - add_action( 'admin_init', self::class . '::do_admin_redirects' ); | |
| 117 | + add_action( 'admin_init', __CLASS__ . '::do_admin_redirects' ); | |
| 129 | 118 | |
| 130 | 119 | if ( self::has_onboarding_been_skipped() ) { |
| 131 | - add_filter( 'option_frm_inbox', self::class . '::add_wizard_to_floating_links' ); | |
| 120 | + add_filter( 'option_frm_inbox', __CLASS__ . '::add_wizard_to_floating_links' ); | |
| 132 | 121 | } |
| 133 | 122 | |
| 134 | 123 | // Load page if admin page is Onboarding Wizard. |
| 135 | 124 | self::maybe_load_page(); |
| @@ -136,10 +125,8 @@ | ||
| 136 | 125 | } |
| 137 | 126 | |
| 138 | 127 | /** |
| 139 | 128 | * Performs a safe redirect to the welcome screen when the plugin is activated. |
| 140 | - * On single activation, we will redirect immediately. | |
| 141 | - * When activating multiple plugins, the redirect is delayed until a Formidable page is loaded. | |
| 142 | 129 | * |
| 143 | 130 | * @return void |
| 144 | 131 | */ |
| 145 | 132 | public static function do_admin_redirects() { |
| @@ -155,32 +142,13 @@ | ||
| 155 | 142 | self::mark_onboarding_as_skipped(); |
| 156 | 143 | return; |
| 157 | 144 | } |
| 158 | 145 | |
| 159 | - if ( self::has_onboarding_been_skipped() || FrmAppHelper::pro_is_connected() ) { | |
| 146 | + // Check if we should consider redirection. | |
| 147 | + if ( ! FrmAppHelper::is_formidable_admin() || ! self::is_onboarding_wizard_displayed() || self::has_onboarding_been_skipped() || FrmAppHelper::pro_is_connected() ) { | |
| 160 | 148 | return; |
| 161 | 149 | } |
| 162 | 150 | |
| 163 | - $transient_value = get_transient( self::TRANSIENT_NAME ); | |
| 164 | - | |
| 165 | - if ( ! in_array( $transient_value, array( self::TRANSIENT_VALUE, self::TRANSIENT_MULTI_VALUE ), true ) ) { | |
| 166 | - return; | |
| 167 | - } | |
| 168 | - | |
| 169 | - if ( isset( $_GET['activate-multi'] ) ) { | |
| 170 | - /** | |
| 171 | - * $_GET['activate-multi'] is set after activating multiple plugins. | |
| 172 | - * In this case, change the transient value so we know for future checks. | |
| 173 | - */ | |
| 174 | - set_transient( self::TRANSIENT_NAME, self::TRANSIENT_MULTI_VALUE, 60 ); | |
| 175 | - return; | |
| 176 | - } | |
| 177 | - | |
| 178 | - if ( self::TRANSIENT_MULTI_VALUE === $transient_value && ! FrmAppHelper::is_formidable_admin() ) { | |
| 179 | - // For multi-activations we want to only redirect when a user loads a Formidable page. | |
| 180 | - return; | |
| 181 | - } | |
| 182 | - | |
| 183 | 151 | set_transient( self::TRANSIENT_NAME, 'no', 60 ); |
| 184 | 152 | |
| 185 | 153 | // Prevent redirect with every activation. |
| 186 | 154 | if ( self::has_already_redirected() ) { |
| @@ -188,9 +156,8 @@ | ||
| 188 | 156 | } |
| 189 | 157 | |
| 190 | 158 | // Redirect to the onboarding wizard's initial step. |
| 191 | 159 | $page_url = add_query_arg( 'step', self::INITIAL_STEP, self::$page_url ); |
| 192 | - | |
| 193 | 160 | if ( wp_safe_redirect( esc_url_raw( $page_url ) ) ) { |
| 194 | 161 | exit; |
| 195 | 162 | } |
| 196 | 163 | } |
| @@ -203,18 +170,14 @@ | ||
| 203 | 170 | * @return void |
| 204 | 171 | */ |
| 205 | 172 | public static function maybe_load_page() { |
| 206 | 173 | if ( self::is_onboarding_wizard_page() ) { |
| 207 | - // Dismiss the onboarding wizard message so it stops appearing after it is clicked. | |
| 208 | - $message = new FrmInbox(); | |
| 209 | - $message->dismiss( 'onboarding_wizard' ); | |
| 174 | + add_action( 'admin_menu', __CLASS__ . '::menu', 99 ); | |
| 175 | + add_action( 'admin_init', __CLASS__ . '::assign_properties' ); | |
| 176 | + add_action( 'admin_enqueue_scripts', __CLASS__ . '::enqueue_assets', 15 ); | |
| 177 | + add_action( 'admin_head', __CLASS__ . '::remove_menu' ); | |
| 210 | 178 | |
| 211 | - add_action( 'admin_menu', self::class . '::menu', 99 ); | |
| 212 | - add_action( 'admin_init', self::class . '::assign_properties' ); | |
| 213 | - add_action( 'admin_enqueue_scripts', self::class . '::enqueue_assets', 15 ); | |
| 214 | - add_action( 'admin_head', self::class . '::remove_menu' ); | |
| 215 | - | |
| 216 | - add_filter( 'admin_body_class', self::class . '::add_admin_body_classes', 999 ); | |
| 179 | + add_filter( 'admin_body_class', __CLASS__ . '::add_admin_body_classes', 999 ); | |
| 217 | 180 | add_filter( 'frm_show_footer_links', '__return_false' ); |
| 218 | 181 | } |
| 219 | 182 | } |
| 220 | 183 | |
| @@ -257,9 +220,9 @@ | ||
| 257 | 220 | 'Formidable | ' . $label, |
| 258 | 221 | $label, |
| 259 | 222 | self::REQUIRED_CAPABILITY, |
| 260 | 223 | self::PAGE_SLUG, |
| 261 | - array( self::class, 'render' ) | |
| 224 | + array( __CLASS__, 'render' ) | |
| 262 | 225 | ); |
| 263 | 226 | } |
| 264 | 227 | |
| 265 | 228 | /** |
| @@ -286,12 +249,14 @@ | ||
| 286 | 249 | $pro_is_installed = FrmAppHelper::pro_is_installed(); |
| 287 | 250 | |
| 288 | 251 | // Note: Add step parts in order. |
| 289 | 252 | $step_parts = array( |
| 290 | - 'consent-tracking' => 'steps/consent-tracking-step.php', | |
| 291 | - 'install-addons' => 'steps/install-addons-step.php', | |
| 292 | - 'success' => 'steps/success-step.php', | |
| 293 | - 'unsuccessful' => 'steps/unsuccessful-step.php', | |
| 253 | + 'welcome' => 'steps/welcome-step.php', | |
| 254 | + 'install-formidable-pro' => 'steps/install-formidable-pro-step.php', | |
| 255 | + 'license-management' => 'steps/license-management-step.php', | |
| 256 | + 'default-email-address' => 'steps/default-email-address-step.php', | |
| 257 | + 'install-addons' => 'steps/install-addons-step.php', | |
| 258 | + 'success' => 'steps/success-step.php', | |
| 294 | 259 | ); |
| 295 | 260 | |
| 296 | 261 | include $view_path . 'index.php'; |
| 297 | 262 | } |
| @@ -296,29 +261,33 @@ | ||
| 296 | 261 | include $view_path . 'index.php'; |
| 297 | 262 | } |
| 298 | 263 | |
| 299 | 264 | /** |
| 300 | - * Handle AJAX request to setup the "Never miss an important update" step. | |
| 265 | + * Handle AJAX request to setup the "Default Email Address" step. | |
| 301 | 266 | * |
| 302 | 267 | * @since 6.9 |
| 303 | 268 | * |
| 304 | 269 | * @return void |
| 305 | 270 | */ |
| 306 | - public static function ajax_consent_tracking() { | |
| 271 | + public static function ajax_setup_email_step() { | |
| 307 | 272 | // Check permission and nonce. |
| 308 | 273 | FrmAppHelper::permission_check( self::REQUIRED_CAPABILITY ); |
| 309 | 274 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
| 310 | 275 | |
| 276 | + // Get posted data. | |
| 277 | + $default_email = FrmAppHelper::get_post_param( 'default_email', '', 'sanitize_text_field' ); | |
| 278 | + $allows_tracking = FrmAppHelper::get_post_param( 'allows_tracking', '', 'rest_sanitize_boolean' ); | |
| 279 | + $summary_emails = FrmAppHelper::get_post_param( 'summary_emails', '', 'rest_sanitize_boolean' ); | |
| 280 | + | |
| 311 | 281 | // Update Settings. |
| 312 | 282 | $frm_settings = FrmAppHelper::get_settings(); |
| 313 | - $frm_settings->update_setting( 'tracking', true, 'rest_sanitize_boolean' ); | |
| 314 | - | |
| 283 | + $frm_settings->update_setting( 'default_email', $default_email, 'sanitize_text_field' ); | |
| 284 | + $frm_settings->update_setting( 'tracking', $allows_tracking, 'rest_sanitize_boolean' ); | |
| 285 | + $frm_settings->update_setting( 'summary_emails', $summary_emails, 'rest_sanitize_boolean' ); | |
| 315 | 286 | // Remove the 'FrmProSettingsController::store' action to avoid PHP errors during AJAX call. |
| 316 | 287 | remove_action( 'frm_store_settings', 'FrmProSettingsController::store' ); |
| 317 | 288 | $frm_settings->store(); |
| 318 | 289 | |
| 319 | - FrmEmailCollectionHelper::subscribe_to_active_campaign(); | |
| 320 | - | |
| 321 | 290 | // Send response. |
| 322 | 291 | wp_send_json_success(); |
| 323 | 292 | } |
| 324 | 293 | |
| @@ -337,9 +306,12 @@ | ||
| 337 | 306 | // Retrieve the current usage data. |
| 338 | 307 | $usage_data = self::get_usage_data(); |
| 339 | 308 | |
| 340 | 309 | $fields_to_update = array( |
| 310 | + 'default_email' => 'sanitize_email', | |
| 311 | + 'is_subscribed' => 'rest_sanitize_boolean', | |
| 341 | 312 | 'allows_tracking' => 'rest_sanitize_boolean', |
| 313 | + 'summary_emails' => 'rest_sanitize_boolean', | |
| 342 | 314 | 'installed_addons' => 'sanitize_text_field', |
| 343 | 315 | 'processed_steps' => 'sanitize_text_field', |
| 344 | 316 | 'completed_steps' => 'rest_sanitize_boolean', |
| 345 | 317 | ); |
| @@ -402,9 +374,10 @@ | ||
| 402 | 374 | * @return array |
| 403 | 375 | */ |
| 404 | 376 | private static function get_js_variables() { |
| 405 | 377 | return array( |
| 406 | - 'INITIAL_STEP' => self::INITIAL_STEP, | |
| 378 | + 'INITIAL_STEP' => self::INITIAL_STEP, | |
| 379 | + 'proIsIncluded' => FrmAppHelper::pro_is_included(), | |
| 407 | 380 | ); |
| 408 | 381 | } |
| 409 | 382 | |
| 410 | 383 | /** |
| @@ -426,9 +399,8 @@ | ||
| 426 | 399 | * |
| 427 | 400 | * @since 6.9 |
| 428 | 401 | * |
| 429 | 402 | * @param string $classes Existing body classes. |
| 430 | - * | |
| 431 | 403 | * @return string Updated list of body classes, including the newly added classes. |
| 432 | 404 | */ |
| 433 | 405 | public static function add_admin_body_classes( $classes ) { |
| 434 | 406 | return $classes . ' frm-admin-full-screen'; |
| @@ -437,9 +409,8 @@ | ||
| 437 | 409 | /** |
| 438 | 410 | * Checks if the Onboarding Wizard was skipped during the plugin's installation. |
| 439 | 411 | * |
| 440 | 412 | * @since 6.9 |
| 441 | - * | |
| 442 | 413 | * @return bool True if the Onboarding Wizard was skipped, false otherwise. |
| 443 | 414 | */ |
| 444 | 415 | public static function has_onboarding_been_skipped() { |
| 445 | 416 | return get_option( self::ONBOARDING_SKIPPED_OPTION, false ); |
| @@ -448,9 +419,8 @@ | ||
| 448 | 419 | /** |
| 449 | 420 | * Marks the Onboarding Wizard as skipped to prevent automatic redirects to the wizard. |
| 450 | 421 | * |
| 451 | 422 | * @since 6.9 |
| 452 | - * | |
| 453 | 423 | * @return void |
| 454 | 424 | */ |
| 455 | 425 | public static function mark_onboarding_as_skipped() { |
| 456 | 426 | update_option( self::ONBOARDING_SKIPPED_OPTION, true, 'no' ); |
| @@ -461,9 +431,8 @@ | ||
| 461 | 431 | * |
| 462 | 432 | * @since 6.9 |
| 463 | 433 | * |
| 464 | 434 | * @param array $inbox_messages The array of existing inbox messages. |
| 465 | - * | |
| 466 | 435 | * @return array Configuration for the onboarding wizard slide-in notification. |
| 467 | 436 | */ |
| 468 | 437 | public static function add_wizard_to_floating_links( $inbox_messages ) { |
| 469 | 438 | $message = __( 'Welcome to Formidable Forms! Click here to run the Onboarding Wizard and it will guide you through the basic settings and get you started in 2 minutes.', 'formidable' ); |
| @@ -491,8 +460,19 @@ | ||
| 491 | 460 | return FrmAppHelper::is_admin_page( self::PAGE_SLUG ); |
| 492 | 461 | } |
| 493 | 462 | |
| 494 | 463 | /** |
| 464 | + * Validates if the Onboarding Wizard page is being displayed. | |
| 465 | + * | |
| 466 | + * @since 6.9 | |
| 467 | + * | |
| 468 | + * @return bool True if the Onboarding Wizard page is displayed, false otherwise. | |
| 469 | + */ | |
| 470 | + public static function is_onboarding_wizard_displayed() { | |
| 471 | + return get_transient( self::TRANSIENT_NAME ) === self::TRANSIENT_VALUE; | |
| 472 | + } | |
| 473 | + | |
| 474 | + /** | |
| 495 | 475 | * Checks if the plugin has already performed a redirect to avoid repeated redirections. |
| 496 | 476 | * |
| 497 | 477 | * @return bool Returns true if already redirected, otherwise false. |
| 498 | 478 | */ |
| @@ -544,11 +524,9 @@ | ||
| 544 | 524 | * @return void |
| 545 | 525 | */ |
| 546 | 526 | private static function set_available_addons() { |
| 547 | 527 | $pro_is_installed = FrmAppHelper::pro_is_installed(); |
| 548 | - $plugins = get_plugins(); | |
| 549 | 528 | |
| 550 | - // Base add-ons always included. | |
| 551 | 529 | self::$available_addons['spam-protection'] = array( |
| 552 | 530 | 'title' => esc_html__( 'Spam Protection', 'formidable' ), |
| 553 | 531 | 'is-checked' => true, |
| 554 | 532 | 'is-disabled' => true, |
| @@ -559,10 +537,8 @@ | ||
| 559 | 537 | 'is-checked' => true, |
| 560 | 538 | 'is-disabled' => true, |
| 561 | 539 | 'help-text' => esc_html__( 'Collect donations and payments with your forms. Offer physical products, digital goods, services, and more.', 'formidable' ), |
| 562 | 540 | ); |
| 563 | - | |
| 564 | - // Add-ons included when Pro is not installed. | |
| 565 | 541 | if ( ! $pro_is_installed ) { |
| 566 | 542 | self::$available_addons['visual-styler'] = array( |
| 567 | 543 | 'title' => esc_html__( 'Visual Styler', 'formidable' ), |
| 568 | 544 | 'is-checked' => true, |
| @@ -575,94 +551,81 @@ | ||
| 575 | 551 | 'is-disabled' => true, |
| 576 | 552 | 'help-text' => esc_html__( 'Save form submissions to your database for future reference and analysis.', 'formidable' ), |
| 577 | 553 | ); |
| 578 | 554 | } |
| 579 | - | |
| 580 | - // SMTP add-on if wp_mail_smtp is not installed. | |
| 581 | 555 | if ( ! function_exists( 'wp_mail_smtp' ) ) { |
| 582 | - $wp_mail_smtp_plugin = 'wp-mail-smtp/wp_mail_smtp.php'; | |
| 583 | - $is_installed_wp_mail_smtp = array_key_exists( $wp_mail_smtp_plugin, $plugins ); | |
| 584 | - | |
| 585 | 556 | self::$available_addons['wp-mail-smtp'] = array( |
| 586 | - 'title' => esc_html__( 'SMTP', 'formidable' ), | |
| 587 | - 'rel' => $is_installed_wp_mail_smtp ? $wp_mail_smtp_plugin : 'wp-mail-smtp', | |
| 588 | - 'is-checked' => false, | |
| 589 | - 'is-vendor' => true, | |
| 590 | - 'is-installed' => $is_installed_wp_mail_smtp, | |
| 591 | - 'help-text' => esc_html__( 'Improve email deliverability by routing WordPress emails through SMTP.', 'formidable' ), | |
| 557 | + 'title' => esc_html__( 'SMTP', 'formidable' ), | |
| 558 | + 'rel' => 'wp-mail-smtp', | |
| 559 | + 'is-checked' => false, | |
| 560 | + 'is-vendor' => true, | |
| 561 | + 'help-text' => esc_html__( 'Improve email deliverability by routing WordPress emails through SMTP.', 'formidable' ), | |
| 592 | 562 | ); |
| 593 | 563 | } |
| 594 | - | |
| 595 | - // Add-ons available when Pro is installed. | |
| 596 | 564 | if ( $pro_is_installed ) { |
| 597 | - $available_pro_addons = array( | |
| 598 | - 'formidable-views' => array( | |
| 599 | - 'addon_key' => 'views', | |
| 600 | - 'title' => __( 'Views', 'formidable' ), | |
| 601 | - 'plugin_file' => 'formidable-views/formidable-views.php', | |
| 602 | - ), | |
| 603 | - 'formidable-mailchimp' => array( | |
| 604 | - 'addon_key' => 'mailchimp', | |
| 605 | - 'title' => __( 'Mailchimp', 'formidable' ), | |
| 606 | - 'plugin_file' => 'formidable-mailchimp/formidable-mailchimp.php', | |
| 607 | - ), | |
| 608 | - 'formidable-registration' => array( | |
| 609 | - 'addon_key' => 'registration', | |
| 610 | - 'title' => __( 'User Registration', 'formidable' ), | |
| 611 | - 'plugin_file' => 'formidable-registration/formidable-registration.php', | |
| 612 | - ), | |
| 613 | - 'formidable-api' => array( | |
| 614 | - 'addon_key' => 'api', | |
| 615 | - 'title' => __( 'Form Rest API', 'formidable' ), | |
| 616 | - 'plugin_file' => 'formidable-api/formidable-api.php', | |
| 617 | - ), | |
| 618 | - 'formidable-signature' => array( | |
| 619 | - 'addon_key' => 'signature', | |
| 620 | - 'title' => __( 'Signature Forms', 'formidable' ), | |
| 621 | - 'plugin_file' => 'formidable-signature/signature.php', | |
| 622 | - ), | |
| 623 | - ); | |
| 565 | + $views_addon = FrmAddonsController::get_addon( 'views' ); | |
| 566 | + $mailchimp_addon = FrmAddonsController::get_addon( 'mailchimp' ); | |
| 567 | + $registration_addon = FrmAddonsController::get_addon( 'registration' ); | |
| 568 | + $api_addon = FrmAddonsController::get_addon( 'api' ); | |
| 569 | + $acf_addon = FrmAddonsController::get_addon( 'acf' ); | |
| 570 | + $signature_addon = FrmAddonsController::get_addon( 'signature' ); | |
| 624 | 571 | |
| 625 | - // Include ACF Forms add-on if ACF is installed. | |
| 626 | - if ( class_exists( 'ACF' ) ) { | |
| 627 | - $available_pro_addons['formidable-acf'] = array( | |
| 628 | - 'addon_key' => 'acf', | |
| 629 | - 'title' => __( 'ACF Forms', 'formidable' ), | |
| 630 | - 'plugin_file' => 'formidable-acf/formidable-acf.php', | |
| 572 | + if ( ! is_plugin_active( 'formidable-views/formidable-views.php' ) ) { | |
| 573 | + self::$available_addons['formidable-views'] = array( | |
| 574 | + 'title' => esc_html__( 'Views', 'formidable' ), | |
| 575 | + 'rel' => $views_addon['url'], | |
| 576 | + 'is-checked' => false, | |
| 577 | + 'help-text' => $views_addon['excerpt'], | |
| 631 | 578 | ); |
| 632 | 579 | } |
| 633 | - | |
| 634 | - foreach ( $available_pro_addons as $key => $data ) { | |
| 635 | - $addon = FrmAddonsController::get_addon( $data['addon_key'] ); | |
| 636 | - $plugin_file = $data['plugin_file']; | |
| 637 | - | |
| 638 | - if ( ! is_plugin_active( $plugin_file ) && isset( $addon['url'] ) ) { | |
| 639 | - $is_installed = array_key_exists( $plugin_file, $plugins ); | |
| 640 | - | |
| 641 | - self::$available_addons[ $key ] = array( | |
| 642 | - 'title' => $data['title'], | |
| 643 | - 'rel' => $is_installed ? $plugin_file : $addon['url'], | |
| 644 | - 'is-checked' => false, | |
| 645 | - 'is-installed' => $is_installed, | |
| 646 | - 'help-text' => $addon['excerpt'], | |
| 647 | - ); | |
| 648 | - } | |
| 580 | + if ( ! is_plugin_active( 'formidable-mailchimp/formidable-mailchimp.php' ) ) { | |
| 581 | + self::$available_addons['formidable-mailchimp'] = array( | |
| 582 | + 'title' => esc_html__( 'Mailchimp', 'formidable' ), | |
| 583 | + 'rel' => $mailchimp_addon['url'], | |
| 584 | + 'is-checked' => false, | |
| 585 | + 'help-text' => $mailchimp_addon['excerpt'], | |
| 586 | + ); | |
| 649 | 587 | } |
| 588 | + if ( ! is_plugin_active( 'formidable-registration/formidable-registration.php' ) ) { | |
| 589 | + self::$available_addons['formidable-registration'] = array( | |
| 590 | + 'title' => esc_html__( 'User Registration', 'formidable' ), | |
| 591 | + 'rel' => $registration_addon['url'], | |
| 592 | + 'is-checked' => false, | |
| 593 | + 'help-text' => $registration_addon['excerpt'], | |
| 594 | + ); | |
| 595 | + } | |
| 596 | + if ( ! is_plugin_active( 'formidable-api/formidable-api.php' ) ) { | |
| 597 | + self::$available_addons['formidable-api'] = array( | |
| 598 | + 'title' => esc_html__( 'Form Rest API', 'formidable' ), | |
| 599 | + 'rel' => $api_addon['url'], | |
| 600 | + 'is-checked' => false, | |
| 601 | + 'help-text' => $api_addon['excerpt'], | |
| 602 | + ); | |
| 603 | + } | |
| 604 | + if ( class_exists( 'ACF' ) && ! is_plugin_active( 'formidable-acf/formidable-acf.php' ) ) { | |
| 605 | + self::$available_addons['formidable-acf'] = array( | |
| 606 | + 'title' => esc_html__( 'ACF Forms', 'formidable' ), | |
| 607 | + 'rel' => $acf_addon['url'], | |
| 608 | + 'is-checked' => false, | |
| 609 | + 'help-text' => $acf_addon['excerpt'], | |
| 610 | + ); | |
| 611 | + } | |
| 612 | + if ( ! is_plugin_active( 'formidable-signature/signature.php' ) ) { | |
| 613 | + self::$available_addons['formidable-signature'] = array( | |
| 614 | + 'title' => esc_html__( 'Signature Forms', 'formidable' ), | |
| 615 | + 'rel' => $signature_addon['url'], | |
| 616 | + 'is-checked' => false, | |
| 617 | + 'help-text' => $signature_addon['excerpt'], | |
| 618 | + ); | |
| 619 | + } | |
| 650 | 620 | }//end if |
| 651 | - | |
| 652 | - // Gravity Forms Migrator add-on. | |
| 653 | - $gravity_forms_plugin = 'formidable-gravity-forms-importer/formidable-gravity-forms-importer.php'; | |
| 654 | - | |
| 655 | - if ( class_exists( 'GFForms' ) && ! is_plugin_active( $gravity_forms_plugin ) ) { | |
| 656 | - $is_installed_gravity_forms = array_key_exists( $gravity_forms_plugin, $plugins ); | |
| 657 | - | |
| 621 | + if ( class_exists( 'GFForms' ) && ! is_plugin_active( 'formidable-gravity-forms-importer/formidable-gravity-forms-importer.php' ) ) { | |
| 658 | 622 | self::$available_addons['formidable-gravity-forms-importer'] = array( |
| 659 | - 'title' => esc_html__( 'Gravity Forms Migrator', 'formidable' ), | |
| 660 | - 'rel' => $is_installed_gravity_forms ? $gravity_forms_plugin : 'formidable-gravity-forms-importer', | |
| 661 | - 'is-checked' => false, | |
| 662 | - 'is-vendor' => true, | |
| 663 | - 'is-installed' => $is_installed_gravity_forms, | |
| 664 | - 'help-text' => esc_html__( 'Easily migrate your forms from Gravity Forms to Formidable.', 'formidable' ), | |
| 623 | + 'title' => esc_html__( 'Gravity Forms Migrator', 'formidable' ), | |
| 624 | + 'rel' => 'formidable-gravity-forms-importer', | |
| 625 | + 'is-checked' => false, | |
| 626 | + 'is-vendor' => true, | |
| 627 | + 'help-text' => esc_html__( 'Easily migrate your forms from Gravity Forms to Formidable.', 'formidable' ), | |
| 665 | 628 | ); |
| 666 | 629 | } |
| 667 | 630 | } |
| 668 | 631 | |
| @@ -696,19 +659,6 @@ | ||
| 696 | 659 | * @return array Current usage data. |
| 697 | 660 | */ |
| 698 | 661 | public static function get_usage_data() { |
| 699 | 662 | return get_option( self::USAGE_DATA_OPTION, array() ); |
| 700 | - } | |
| 701 | - | |
| 702 | - /** | |
| 703 | - * Validates if the Onboarding Wizard page is being displayed. | |
| 704 | - * | |
| 705 | - * @since 6.9 | |
| 706 | - * @deprecated 6.16 | |
| 707 | - * | |
| 708 | - * @return bool True if the Onboarding Wizard page is displayed, false otherwise. | |
| 709 | - */ | |
| 710 | - public static function is_onboarding_wizard_displayed() { | |
| 711 | - _deprecated_function( __METHOD__, '6.16' ); | |
| 712 | - return get_transient( self::TRANSIENT_NAME ) === self::TRANSIENT_VALUE; | |
| 713 | 663 | } |
| 714 | 664 | } |