diff --git a/classes/controllers/FrmHooksController.php b/classes/controllers/FrmHooksController.php
index ac9c3ed118..e11b496219 100644
--- a/classes/controllers/FrmHooksController.php
+++ b/classes/controllers/FrmHooksController.php
@@ -218,7 +218,7 @@ public static function load_ajax_hooks() {
add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' );
// Onboarding Wizard Controller.
- add_action( 'wp_ajax_frm_onboarding_setup_email_step', 'FrmOnboardingWizardController::ajax_setup_email_step' );
+ add_action( 'wp_ajax_frm_onboarding_consent_tracking', 'FrmOnboardingWizardController::ajax_consent_tracking' );
add_action( 'wp_ajax_frm_onboarding_setup_usage_data', 'FrmOnboardingWizardController::setup_usage_data' );
// Addons.
diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php
index 3cc3332ea1..5ad5cd5c86 100644
--- a/classes/controllers/FrmOnboardingWizardController.php
+++ b/classes/controllers/FrmOnboardingWizardController.php
@@ -79,7 +79,7 @@ class FrmOnboardingWizardController {
*
* @var string
*/
- const INITIAL_STEP = 'welcome';
+ const INITIAL_STEP = 'consent-tracking';
/**
* Option name to store usage data.
@@ -279,49 +279,72 @@ public static function render() {
// Note: Add step parts in order.
$step_parts = array(
- 'welcome' => 'steps/welcome-step.php',
- 'install-formidable-pro' => 'steps/install-formidable-pro-step.php',
- 'license-management' => 'steps/license-management-step.php',
- 'default-email-address' => 'steps/default-email-address-step.php',
- 'install-addons' => 'steps/install-addons-step.php',
- 'success' => 'steps/success-step.php',
+ 'consent-tracking' => 'steps/consent-tracking-step.php',
+ 'install-addons' => 'steps/install-addons-step.php',
+ 'success' => 'steps/success-step.php',
+ 'unsuccessful' => 'steps/unsuccessful-step.php',
);
include $view_path . 'index.php';
}
/**
- * Handle AJAX request to setup the "Default Email Address" step.
+ * Handle AJAX request to setup the "Never miss an important update" step.
*
* @since 6.9
*
* @return void
*/
- public static function ajax_setup_email_step() {
+ public static function ajax_consent_tracking() {
// Check permission and nonce.
FrmAppHelper::permission_check( self::REQUIRED_CAPABILITY );
check_ajax_referer( 'frm_ajax', 'nonce' );
- // Get posted data.
- $from_email = FrmAppHelper::get_post_param( 'from_email', '', 'sanitize_email' );
- $default_email = FrmAppHelper::get_post_param( 'default_email', '', 'sanitize_email' );
- $allows_tracking = FrmAppHelper::get_post_param( 'allows_tracking', '', 'rest_sanitize_boolean' );
- $summary_emails = FrmAppHelper::get_post_param( 'summary_emails', '', 'rest_sanitize_boolean' );
-
// Update Settings.
$frm_settings = FrmAppHelper::get_settings();
- $frm_settings->update_setting( 'from_email', $from_email, 'sanitize_text_field' );
- $frm_settings->update_setting( 'default_email', $default_email, 'sanitize_text_field' );
- $frm_settings->update_setting( 'tracking', $allows_tracking, 'rest_sanitize_boolean' );
- $frm_settings->update_setting( 'summary_emails', $summary_emails, 'rest_sanitize_boolean' );
+ $frm_settings->update_setting( 'tracking', true, 'rest_sanitize_boolean' );
+
// Remove the 'FrmProSettingsController::store' action to avoid PHP errors during AJAX call.
remove_action( 'frm_store_settings', 'FrmProSettingsController::store' );
$frm_settings->store();
+ self::subscribe_to_active_campaign();
+
// Send response.
wp_send_json_success();
}
+ /**
+ * When the user consents to receiving news of updates, subscribe their email to ActiveCampaign.
+ *
+ * @since x.x
+ *
+ * @return void
+ */
+ private static function subscribe_to_active_campaign() {
+ $user = wp_get_current_user();
+ if ( empty( $user->user_email ) ) {
+ return;
+ }
+
+ wp_remote_post(
+ 'https://sandbox.formidableforms.com/api/wp-admin/admin-ajax.php?action=frm_forms_preview&form=subscribe-onboarding',
+ array(
+ 'body' => http_build_query(
+ array(
+ 'form_key' => 'subscribe-onboarding',
+ 'frm_action' => 'create',
+ 'form_id' => 5,
+ 'item_key' => '',
+ 'item_meta[0]' => '',
+ 'item_meta[15]' => $user->user_email,
+ 'item_meta[17]' => 'Source - FF Lite Plugin Onboarding',
+ )
+ ),
+ )
+ );
+ }
+
/**
* Handle AJAX request to set up usage data for the Onboarding Wizard.
*
@@ -338,10 +361,7 @@ public static function setup_usage_data() {
$usage_data = self::get_usage_data();
$fields_to_update = array(
- 'default_email' => 'sanitize_email',
- 'is_subscribed' => 'rest_sanitize_boolean',
'allows_tracking' => 'rest_sanitize_boolean',
- 'summary_emails' => 'rest_sanitize_boolean',
'installed_addons' => 'sanitize_text_field',
'processed_steps' => 'sanitize_text_field',
'completed_steps' => 'rest_sanitize_boolean',
@@ -406,8 +426,7 @@ public static function enqueue_assets() {
*/
private static function get_js_variables() {
return array(
- 'INITIAL_STEP' => self::INITIAL_STEP,
- 'proIsIncluded' => FrmAppHelper::pro_is_included(),
+ 'INITIAL_STEP' => self::INITIAL_STEP,
);
}
@@ -545,7 +564,9 @@ public static function get_available_addons() {
*/
private static function set_available_addons() {
$pro_is_installed = FrmAppHelper::pro_is_installed();
+ $plugins = get_plugins();
+ // Base add-ons always included.
self::$available_addons['spam-protection'] = array(
'title' => esc_html__( 'Spam Protection', 'formidable' ),
'is-checked' => true,
@@ -558,6 +579,8 @@ private static function set_available_addons() {
'is-disabled' => true,
'help-text' => esc_html__( 'Collect donations and payments with your forms. Offer physical products, digital goods, services, and more.', 'formidable' ),
);
+
+ // Add-ons included when Pro is not installed.
if ( ! $pro_is_installed ) {
self::$available_addons['visual-styler'] = array(
'title' => esc_html__( 'Visual Styler', 'formidable' ),
@@ -572,79 +595,91 @@ private static function set_available_addons() {
'help-text' => esc_html__( 'Save form submissions to your database for future reference and analysis.', 'formidable' ),
);
}
+
+ // SMTP add-on if wp_mail_smtp is not installed.
if ( ! function_exists( 'wp_mail_smtp' ) ) {
+ $wp_mail_smtp_plugin = 'wp-mail-smtp/wp_mail_smtp.php';
+ $is_installed_wp_mail_smtp = array_key_exists( $wp_mail_smtp_plugin, $plugins );
+
self::$available_addons['wp-mail-smtp'] = array(
- 'title' => esc_html__( 'SMTP', 'formidable' ),
- 'rel' => 'wp-mail-smtp',
- 'is-checked' => false,
- 'is-vendor' => true,
- 'help-text' => esc_html__( 'Improve email deliverability by routing WordPress emails through SMTP.', 'formidable' ),
+ 'title' => esc_html__( 'SMTP', 'formidable' ),
+ 'rel' => $is_installed_wp_mail_smtp ? $wp_mail_smtp_plugin : 'wp-mail-smtp',
+ 'is-checked' => false,
+ 'is-vendor' => true,
+ 'is-installed' => $is_installed_wp_mail_smtp,
+ 'help-text' => esc_html__( 'Improve email deliverability by routing WordPress emails through SMTP.', 'formidable' ),
);
}
+
+ // Add-ons available when Pro is installed.
if ( $pro_is_installed ) {
- $views_addon = FrmAddonsController::get_addon( 'views' );
- $mailchimp_addon = FrmAddonsController::get_addon( 'mailchimp' );
- $registration_addon = FrmAddonsController::get_addon( 'registration' );
- $api_addon = FrmAddonsController::get_addon( 'api' );
- $acf_addon = FrmAddonsController::get_addon( 'acf' );
- $signature_addon = FrmAddonsController::get_addon( 'signature' );
-
- if ( ! is_plugin_active( 'formidable-views/formidable-views.php' ) && isset( $views_addon['url'] ) ) {
- self::$available_addons['formidable-views'] = array(
- 'title' => esc_html__( 'Views', 'formidable' ),
- 'rel' => $views_addon['url'],
- 'is-checked' => false,
- 'help-text' => $views_addon['excerpt'],
- );
- }
- if ( ! is_plugin_active( 'formidable-mailchimp/formidable-mailchimp.php' ) && isset( $mailchimp_addon['url'] ) ) {
- self::$available_addons['formidable-mailchimp'] = array(
- 'title' => esc_html__( 'Mailchimp', 'formidable' ),
- 'rel' => $mailchimp_addon['url'],
- 'is-checked' => false,
- 'help-text' => $mailchimp_addon['excerpt'],
- );
- }
- if ( ! is_plugin_active( 'formidable-registration/formidable-registration.php' ) && isset( $registration_addon['url'] ) ) {
- self::$available_addons['formidable-registration'] = array(
- 'title' => esc_html__( 'User Registration', 'formidable' ),
- 'rel' => $registration_addon['url'],
- 'is-checked' => false,
- 'help-text' => $registration_addon['excerpt'],
- );
- }
- if ( ! is_plugin_active( 'formidable-api/formidable-api.php' ) && isset( $api_addon['url'] ) ) {
- self::$available_addons['formidable-api'] = array(
- 'title' => esc_html__( 'Form Rest API', 'formidable' ),
- 'rel' => $api_addon['url'],
- 'is-checked' => false,
- 'help-text' => $api_addon['excerpt'],
- );
- }
- if ( class_exists( 'ACF' ) && ! is_plugin_active( 'formidable-acf/formidable-acf.php' ) && isset( $acf_addon['url'] ) ) {
- self::$available_addons['formidable-acf'] = array(
- 'title' => esc_html__( 'ACF Forms', 'formidable' ),
- 'rel' => $acf_addon['url'],
- 'is-checked' => false,
- 'help-text' => $acf_addon['excerpt'],
+ $available_pro_addons = array(
+ 'formidable-views' => array(
+ 'addon_key' => 'views',
+ 'title' => __( 'Views', 'formidable' ),
+ 'plugin_file' => 'formidable-views/formidable-views.php',
+ ),
+ 'formidable-mailchimp' => array(
+ 'addon_key' => 'mailchimp',
+ 'title' => __( 'Mailchimp', 'formidable' ),
+ 'plugin_file' => 'formidable-mailchimp/formidable-mailchimp.php',
+ ),
+ 'formidable-registration' => array(
+ 'addon_key' => 'registration',
+ 'title' => __( 'User Registration', 'formidable' ),
+ 'plugin_file' => 'formidable-registration/formidable-registration.php',
+ ),
+ 'formidable-api' => array(
+ 'addon_key' => 'api',
+ 'title' => __( 'Form Rest API', 'formidable' ),
+ 'plugin_file' => 'formidable-api/formidable-api.php',
+ ),
+ 'formidable-signature' => array(
+ 'addon_key' => 'signature',
+ 'title' => __( 'Signature Forms', 'formidable' ),
+ 'plugin_file' => 'formidable-signature/signature.php',
+ ),
+ );
+
+ // Include ACF Forms add-on if ACF is installed.
+ if ( class_exists( 'ACF' ) ) {
+ $available_pro_addons['formidable-acf'] = array(
+ 'addon_key' => 'acf',
+ 'title' => __( 'ACF Forms', 'formidable' ),
+ 'plugin_file' => 'formidable-acf/formidable-acf.php',
);
}
- if ( ! is_plugin_active( 'formidable-signature/signature.php' ) && isset( $signature_addon['url'] ) ) {
- self::$available_addons['formidable-signature'] = array(
- 'title' => esc_html__( 'Signature Forms', 'formidable' ),
- 'rel' => $signature_addon['url'],
- 'is-checked' => false,
- 'help-text' => $signature_addon['excerpt'],
- );
+
+ foreach ( $available_pro_addons as $key => $data ) {
+ $addon = FrmAddonsController::get_addon( $data['addon_key'] );
+ $plugin_file = $data['plugin_file'];
+
+ if ( ! is_plugin_active( $plugin_file ) && isset( $addon['url'] ) ) {
+ $is_installed = array_key_exists( $plugin_file, $plugins );
+
+ self::$available_addons[ $key ] = array(
+ 'title' => $data['title'],
+ 'rel' => $is_installed ? $plugin_file : $addon['url'],
+ 'is-checked' => false,
+ 'is-installed' => $is_installed,
+ 'help-text' => $addon['excerpt'],
+ );
+ }
}
}//end if
- if ( class_exists( 'GFForms' ) && ! is_plugin_active( 'formidable-gravity-forms-importer/formidable-gravity-forms-importer.php' ) ) {
+
+ // Gravity Forms Migrator add-on.
+ $gravity_forms_plugin = 'formidable-gravity-forms-importer/formidable-gravity-forms-importer.php';
+ if ( class_exists( 'GFForms' ) && ! is_plugin_active( $gravity_forms_plugin ) ) {
+ $is_installed_gravity_forms = array_key_exists( $gravity_forms_plugin, $plugins );
+
self::$available_addons['formidable-gravity-forms-importer'] = array(
- 'title' => esc_html__( 'Gravity Forms Migrator', 'formidable' ),
- 'rel' => 'formidable-gravity-forms-importer',
- 'is-checked' => false,
- 'is-vendor' => true,
- 'help-text' => esc_html__( 'Easily migrate your forms from Gravity Forms to Formidable.', 'formidable' ),
+ 'title' => esc_html__( 'Gravity Forms Migrator', 'formidable' ),
+ 'rel' => $is_installed_gravity_forms ? $gravity_forms_plugin : 'formidable-gravity-forms-importer',
+ 'is-checked' => false,
+ 'is-vendor' => true,
+ 'is-installed' => $is_installed_gravity_forms,
+ 'help-text' => esc_html__( 'Easily migrate your forms from Gravity Forms to Formidable.', 'formidable' ),
);
}
}
diff --git a/classes/helpers/FrmOnboardingWizardHelper.php b/classes/helpers/FrmOnboardingWizardHelper.php
index f3fdcfccf3..dc5f49be42 100644
--- a/classes/helpers/FrmOnboardingWizardHelper.php
+++ b/classes/helpers/FrmOnboardingWizardHelper.php
@@ -45,6 +45,9 @@ public static function add_addon_label_attributes( $addon_key, $addon ) {
if ( ! empty( $addon['is-vendor'] ) ) {
$attributes['data-is-vendor'] = 'true';
}
+ if ( ! empty( $addon['is-installed'] ) ) {
+ $attributes['data-is-installed'] = 'true';
+ }
FrmAppHelper::array_to_html_params( $attributes, true );
}
@@ -87,12 +90,13 @@ public static function add_addon_input_attributes( $addon_key, $addon ) {
public static function print_footer( $args = array() ) {
$defaults = array(
'footer-class' => '',
- 'display-back-button' => true,
+ 'display-back-button' => false,
// Primary Button Args.
'primary-button-text' => esc_html__( 'Next Step', 'formidable' ),
'primary-button-class' => '',
'primary-button-href' => '#',
'primary-button-role' => 'button',
+ 'primary-button-with-icon' => false,
// Secondary Button Args.
'secondary-button-text' => esc_html__( 'Skip', 'formidable' ),
'secondary-button-class' => '',
@@ -106,7 +110,7 @@ public static function print_footer( $args = array() ) {
$primary_button_attributes = array(
'href' => $args['primary-button-href'],
);
- $primary_button_attributes['class'] = trim( 'button button-primary frm-button-primary ' . $args['primary-button-class'] );
+ $primary_button_attributes['class'] = trim( 'button button-primary frm-button-primary frm-sharp frm_large ' . $args['primary-button-class'] );
if ( ! empty( $args['primary-button-id'] ) ) {
$primary_button_attributes['id'] = $args['primary-button-id'];
}
@@ -121,7 +125,7 @@ public static function print_footer( $args = array() ) {
$secondary_button_attributes = array(
'href' => $args['secondary-button-href'],
);
- $secondary_button_attributes['class'] = trim( 'button button-secondary frm-button-secondary ' . $args['secondary-button-class'] );
+ $secondary_button_attributes['class'] = trim( 'button button-secondary frm-button-secondary frm-sharp frm_large ' . $args['secondary-button-class'] );
if ( $args['secondary-button-skip-step'] ) {
$secondary_button_attributes['class'] .= ' frm-onboarding-skip-step';
}
diff --git a/classes/models/FrmInstallPlugin.php b/classes/models/FrmInstallPlugin.php
index c8e7bdc581..43efc0f6f5 100644
--- a/classes/models/FrmInstallPlugin.php
+++ b/classes/models/FrmInstallPlugin.php
@@ -82,38 +82,43 @@ public static function ajax_install_plugin() {
// Get posted data.
$plugin_slug = FrmAppHelper::get_post_param( 'plugin', '', 'sanitize_text_field' );
- // Include necessary files for plugin installation.
- require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
- require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
-
- // Get the plugin information.
- $api = plugins_api(
- 'plugin_information',
- array(
- 'slug' => $plugin_slug,
- 'fields' => array(
- 'sections' => false,
- ),
- )
- );
- if ( is_wp_error( $api ) ) {
- wp_send_json_error( $api->get_error_message() );
- }
- if ( ! FrmAddonsController::url_is_allowed( $api->versions['trunk'] ) ) {
- wp_send_json_error( 'This download is not allowed' );
- }
-
- // Set up the Plugin Upgrader.
- $upgrader = new Plugin_Upgrader( new WP_Ajax_Upgrader_Skin() );
-
- // Install the plugin.
- $result = $upgrader->install( $api->versions['trunk'] );
- if ( is_wp_error( $result ) ) {
- wp_send_json_error( $result->get_error_message() );
- }
+ if ( ! empty( get_plugins()[ $plugin_slug ] ) ) {
+ $activate = activate_plugin( $plugin_slug );
+ } else {
+ // Include necessary files for plugin installation.
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
+ require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
+
+ // Get the plugin information.
+ $api = plugins_api(
+ 'plugin_information',
+ array(
+ 'slug' => $plugin_slug,
+ 'fields' => array(
+ 'sections' => false,
+ ),
+ )
+ );
+ if ( is_wp_error( $api ) ) {
+ wp_send_json_error( $api->get_error_message() );
+ }
+ if ( ! FrmAddonsController::url_is_allowed( $api->versions['trunk'] ) ) {
+ wp_send_json_error( 'This download is not allowed' );
+ }
+
+ // Set up the Plugin Upgrader.
+ $upgrader = new Plugin_Upgrader( new WP_Ajax_Upgrader_Skin() );
+
+ // Install the plugin.
+ $result = $upgrader->install( $api->versions['trunk'] );
+ if ( is_wp_error( $result ) ) {
+ wp_send_json_error( $result->get_error_message() );
+ }
+
+ // Activate the plugin.
+ $activate = activate_plugin( $upgrader->plugin_info() );
+ }//end if
- // Activate the plugin.
- $activate = activate_plugin( $upgrader->plugin_info() );
if ( is_wp_error( $activate ) ) {
wp_send_json_error( $activate->get_error_message() );
}
@@ -148,4 +153,16 @@ public static function ajax_check_plugin_activation() {
wp_send_json_error();
}
}
+
+ /**
+ * Check if a plugin is installed.
+ *
+ * @since x.x
+ *
+ * @param string $plugin_file
+ * @return bool
+ */
+ private static function is_plugin_installed( $plugin_file ) {
+ return isset( get_plugins()[ $plugin_file ] );
+ }
}
diff --git a/classes/views/onboarding-wizard/footer.php b/classes/views/onboarding-wizard/footer.php
index 4287fc057e..0f6100bc2a 100644
--- a/classes/views/onboarding-wizard/footer.php
+++ b/classes/views/onboarding-wizard/footer.php
@@ -11,7 +11,7 @@
?>
diff --git a/classes/views/onboarding-wizard/index.php b/classes/views/onboarding-wizard/index.php
index 4df9005152..ca01580c9e 100644
--- a/classes/views/onboarding-wizard/index.php
+++ b/classes/views/onboarding-wizard/index.php
@@ -9,12 +9,20 @@
die( 'You are not allowed to call this page directly.' );
}
?>
-
-
-
 . '/images/onboarding-wizard/onboarding-bg.svg' ); ?>)
-
-
+
+
+ -
+ 'true' ) ); ?>
+
+ -
+ 'true' ) ); ?>
+
+ -
+ 'true' ) ); ?>
+
+
+
$file ) {
require $view_path . $file;
@@ -22,7 +30,7 @@
?>
-
+
diff --git a/classes/views/onboarding-wizard/steps/consent-tracking-step.php b/classes/views/onboarding-wizard/steps/consent-tracking-step.php
new file mode 100644
index 0000000000..9d3c3e30af
--- /dev/null
+++ b/classes/views/onboarding-wizard/steps/consent-tracking-step.php
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+ __( 'Allow & Continue', 'formidable' ),
+ 'primary-button-id' => 'frm-onboarding-consent-tracking',
+ 'primary-button-with-icon' => true,
+ 'secondary-button-text' => __( 'Skip', 'formidable' ),
+ 'footer-class' => 'frm-justify-center',
+ 'display-back-button' => false,
+ )
+ );
+ ?>
+
+
+
+
+
+
+
+ 'true' ) ); ?>
+
+
+
+
+
diff --git a/classes/views/onboarding-wizard/steps/default-email-address-step.php b/classes/views/onboarding-wizard/steps/default-email-address-step.php
deleted file mode 100644
index f25ddd1651..0000000000
--- a/classes/views/onboarding-wizard/steps/default-email-address-step.php
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
-
- 'frm-onboarding-setup-email-step-button' ) ); ?>
-
diff --git a/classes/views/onboarding-wizard/steps/install-addons-step.php b/classes/views/onboarding-wizard/steps/install-addons-step.php
index bff95f1850..955e677bb5 100644
--- a/classes/views/onboarding-wizard/steps/install-addons-step.php
+++ b/classes/views/onboarding-wizard/steps/install-addons-step.php
@@ -11,9 +11,7 @@
?>
@@ -45,7 +43,7 @@
-
+
+
+
+
+
+
esc_html__( 'Install & Finish Setup', 'formidable' ),
+ 'primary-button-text' => __( 'Install & Finish Setup', 'formidable' ),
'primary-button-id' => 'frm-onboarding-install-addons-button',
)
);
diff --git a/classes/views/onboarding-wizard/steps/install-formidable-pro-step.php b/classes/views/onboarding-wizard/steps/install-formidable-pro-step.php
deleted file mode 100644
index d604df42b3..0000000000
--- a/classes/views/onboarding-wizard/steps/install-formidable-pro-step.php
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
diff --git a/classes/views/onboarding-wizard/steps/license-management-step.php b/classes/views/onboarding-wizard/steps/license-management-step.php
deleted file mode 100644
index 925f496bdc..0000000000
--- a/classes/views/onboarding-wizard/steps/license-management-step.php
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
- esc_html__( 'Activate & Continue', 'formidable' ),
- 'primary-button-id' => 'frm-onboarding-save-license-button',
- 'primary-button-class' => 'frm_authorize_link',
- 'primary-button-plugin' => 'formidable_pro',
- )
- );
- ?>
-
-
-
diff --git a/classes/views/onboarding-wizard/steps/success-step.php b/classes/views/onboarding-wizard/steps/success-step.php
index 295273bdd7..b7ec34962a 100644
--- a/classes/views/onboarding-wizard/steps/success-step.php
+++ b/classes/views/onboarding-wizard/steps/success-step.php
@@ -11,15 +11,13 @@
?>
@@ -28,10 +26,10 @@
array(
'footer-class' => 'frm-justify-center frm-mt-2xl',
'display-back-button' => false,
- 'primary-button-text' => esc_html__( 'Go to Dashboard', 'formidable' ),
+ 'primary-button-text' => __( 'Go to Dashboard', 'formidable' ),
'primary-button-href' => admin_url( 'admin.php?page=' . FrmDashboardController::PAGE_SLUG ),
'primary-button-role' => false,
- 'secondary-button-text' => esc_html__( 'Create a Form', 'formidable' ),
+ 'secondary-button-text' => __( 'Create a Form', 'formidable' ),
'secondary-button-href' => admin_url( 'admin.php?page=' . FrmFormTemplatesController::PAGE_SLUG ),
'secondary-button-role' => false,
'secondary-button-skip-step' => false,
diff --git a/classes/views/onboarding-wizard/steps/unsuccessful-step.php b/classes/views/onboarding-wizard/steps/unsuccessful-step.php
new file mode 100644
index 0000000000..6307547f19
--- /dev/null
+++ b/classes/views/onboarding-wizard/steps/unsuccessful-step.php
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+ 'frm-justify-center frm-mt-2xl',
+ 'display-back-button' => false,
+ 'primary-button-text' => __( 'Go to Dashboard', 'formidable' ),
+ 'primary-button-href' => admin_url( 'admin.php?page=' . FrmDashboardController::PAGE_SLUG ),
+ 'primary-button-role' => false,
+ 'secondary-button-text' => __( 'Install Manually', 'formidable' ),
+ 'secondary-button-href' => admin_url( 'plugin-install.php' ),
+ 'secondary-button-role' => false,
+ 'secondary-button-skip-step' => false,
+ )
+ );
+ ?>
+
diff --git a/classes/views/onboarding-wizard/steps/welcome-step.php b/classes/views/onboarding-wizard/steps/welcome-step.php
deleted file mode 100644
index 002ce842de..0000000000
--- a/classes/views/onboarding-wizard/steps/welcome-step.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
- 'frm-justify-center',
- 'display-back-button' => false,
- 'primary-button-text' => esc_html__( 'Connect Account', 'formidable' ),
- 'primary-button-id' => 'frm-onboarding-connect-account',
- 'primary-button-href' => FrmAddonsController::connect_link(),
- 'primary-button-role' => false,
- 'secondary-button-text' => esc_html__( 'Proceed without Account', 'formidable' ),
- )
- );
- ?>
-
diff --git a/css/admin/onboarding-wizard.css b/css/admin/onboarding-wizard.css
index 4fa7f2cb6e..291d65e3d3 100644
--- a/css/admin/onboarding-wizard.css
+++ b/css/admin/onboarding-wizard.css
@@ -15,6 +15,7 @@ html.wp-toolbar {
#frm-onboarding-wizard-page {
position: relative;
+ background-color: var(--grey-50);
overflow: hidden;
}
@@ -22,27 +23,10 @@ html.wp-toolbar {
box-sizing: border-box;
}
-#frm-onboarding-bg {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- display: flex;
- justify-content: center;
- align-items: center;
- opacity: 0;
- z-index: 1;
-}
-
-#frm-onboarding-bg img {
- min-height: 80%;
- max-height: 1200px;
-}
-
#frm-onboarding-container {
position: relative;
min-height: 100vh;
+ padding: var(--gap-xl);
opacity: 0;
z-index: 2;
}
@@ -50,7 +34,7 @@ html.wp-toolbar {
#frm-onboarding-return-dashboard {
color: var(--grey-400);
font-weight: 500;
- margin-top: var(--gap-xl);
+ margin-top: var(--gap-lg);
}
#frm-onboarding-return-dashboard:hover {
@@ -61,29 +45,91 @@ html.wp-toolbar {
display: none;
}
+#frm-onboarding-wizard-page .frm-onboarding-logo {
+ width: 60px;
+ height: auto;
+}
+
+#frm-onboarding-wizard-page .frm-dropdown-menu {
+ position: static !important;
+ transform: none !important;
+ border: 0;
+ box-shadow: none;
+ width: 100%;
+ max-height: unset;
+}
+
+.dropdown.show .frm-dropdown-toggle .frmsvg {
+ transform: rotate(180deg);
+}
+
/* NOTE: The changes below were implemented to align with the distinct tooltip style observed in the "Install Formidable Add-ons" step */
.tooltip-inner {
max-width: 295px;
- background-color: #545F6E;
+ background-color: #545f6e;
padding: var(--gap-xs) var(--gap-sm);
border-radius: var(--small-radius);
}
.bs-tooltip-top .arrow::before {
- border-top-color: #545F6E;
+ border-top-color: #545f6e;
}
-/**
- * Welcome Step Styles
- *
- * Provides styles for when the Onboarding Wizard page is displayed Welcome step.
- */
-#frm-onboarding-welcome-step {
- max-width: 445px;
+.bs-tooltip-bottom .arrow::before {
+ border-bottom-color: #545f6e;
+}
+
+/* Rootline */
+.frm-rootline {
+ position: relative;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: calc(3 * var(--gap-xl));
+ padding: 0;
+ margin: 0 0 var(--gap-lg);
}
-.frm-onboarding-logo {
- max-width: 185px;
+.frm-rootline::before {
+ content: '';
+ position: absolute;
+ width: calc(100% - 32px);
+ border: 1px solid var(--grey-300);
+ z-index: 1;
+}
+
+.frm-rootline-item {
+ position: relative;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 16px;
+ height: 16px;
+ background-color: var(--grey-50);
+ border: 2px solid var(--grey-300);
+ outline: 4px solid var(--grey-50);
+ border-radius: 100%;
+ padding: 0;
+ margin: 0;
+ z-index: 2;
+}
+
+.frm-rootline-item.frm-completed-step {
+ background-color: var(--grey-500);
+ border-color: var(--grey-500);
+}
+
+.frm-rootline-item.frm-current {
+ background-color: #fff;
+ border-color: var(--primary-500);
+}
+
+.frm-rootline-item .frmsvg {
+ color: #fff;
+}
+
+.frm-rootline-item:not(.frm-completed-step) .frmsvg {
+ display: none;
}
/**
@@ -103,3 +149,4 @@ html.wp-toolbar {
.frm-cta-green .frm-banner-text a {
text-decoration: underline;
}
+
diff --git a/css/frm_admin.css b/css/frm_admin.css
index 70a8b934cd..95492186ae 100644
--- a/css/frm_admin.css
+++ b/css/frm_admin.css
@@ -1316,6 +1316,11 @@ body.frm-hidden-overflow {
display: inline-block;
}
+.frm-button-primary.frm-sharp,
+.frm-button-secondary.frm-sharp {
+ border-radius: 12px !important;
+}
+
.no-js.wp-core-ui .frm-search .button.hide-if-no-js,
.js.wp-core-ui .frm-search .button.hide-if-js {
display: none;
@@ -1411,10 +1416,10 @@ body.frm-hidden-overflow {
color: #fff !important;
}
-.frm-button-primary.frm_large{
- font-size: var(--text-md) !important;
+.frm-button-primary.frm_large,
+.frm-button-secondary.frm_large {
height: auto !important;
- padding: 9px 18px !important;
+ padding: 12px 16px !important;
}
.frm-button-secondary.frm-small,
@@ -1607,6 +1612,10 @@ input.frm_insert_in_template {
}
/* Generic Classes */
+.frm-text-grey-500 {
+ color: var(--grey-500);
+}
+
.frm-text-grey-700 {
color: var(--grey-700);
}
@@ -1682,6 +1691,14 @@ input.frm_insert_in_template {
margin-bottom: var(--gap-lg) !important;
}
+.frm-ml-2xs {
+ margin-left: var(--gap-2xs) !important;
+}
+
+.frm-ml-xs {
+ margin-left: var(--gap-xs) !important;
+}
+
.frm-ml-auto {
margin-left: auto;
}
@@ -1746,6 +1763,11 @@ input.frm_insert_in_template {
padding-bottom: var(--gap-2xs) !important;
}
+.frm-py-sm {
+ padding-top: var(--gap-sm) !important;
+ padding-bottom: var(--gap-sm) !important;
+}
+
.frm-pt-sm {
padding-top: var(--gap-sm) !important;
}
@@ -1838,6 +1860,10 @@ input.frm_insert_in_template {
display: inline-block !important;
}
+.frm-inline-flex {
+ display: inline-flex;
+}
+
.frm-flex {
display: flex;
}
@@ -1876,6 +1902,10 @@ input.frm_insert_in_template {
gap: 0 !important;
}
+.frm-gap-2xs {
+ gap: var(--gap-2xs);
+}
+
.frm-gap-xs {
gap: var(--gap-xs);
}
@@ -1941,6 +1971,14 @@ input.frm_insert_in_template {
z-index: -1;
}
+.frm-rotate-90 {
+ transform: rotate(90deg);
+}
+
+.frm-cursor-pointer {
+ cursor: pointer;
+}
+
/* End Generic Classes, Start Forced Generic Classes */
.frm-fields p > label.frm_hidden,
@@ -2428,11 +2466,12 @@ h2.frm-h2 + .howto {
}
.frm-card-box {
- max-width: 500px;
+ max-width: 524px;
background-color: #fff;
- border-radius: var(--small-radius);
- padding: var(--gap-lg);
- box-shadow: var(--box-shadow-sm);
+ border-radius: var(--medium-radius);
+ padding: var(--gap-xl);
+ border: 1px solid var(--grey-200);
+ box-shadow: var(--box-shadow-md);
}
.frm-card-box.frm-has-progress-bar {
@@ -7679,6 +7718,11 @@ input[disabled],
height: 13px;
}
+.frmsvg.frm_svg9 {
+ width: 9px;
+ height: 9px;
+}
+
.frmbutton.ui-sortable-helper .frmsvg,
.field_type_list li.frmbutton .frmsvg,
.frmbutton.ui-sortable-helper i,
@@ -9375,6 +9419,18 @@ Responsive Design
border: 1px solid var(--primary-200);
}
+.frm-cta.frm-cta-border .frm-cta-footer {
+ background-color: #fff;
+ padding: 12px var(--gap-sm);
+ border-top: 1px solid var(--primary-200);
+ border-bottom-left-radius: var(--small-radius);
+ border-bottom-right-radius: var(--small-radius);
+ margin-top: 12px;
+ margin-bottom: calc(-1 * var(--gap-sm));
+ margin-left: calc(-1 * var(--gap-sm));
+ margin-right: calc(-1 * var(--gap-sm));
+}
+
.frm-cta h4 {
font-weight: 600;
margin-top: 0;
@@ -9394,6 +9450,10 @@ Responsive Design
border-color: var(--success-100)
}
+.frm-cta-green.frm-cta-border .frm-cta-footer {
+ border-color: var(--success-100);
+}
+
.frm-cta-red {
background-color: var(--error-25);
}
diff --git a/images/icons.svg b/images/icons.svg
index 9f8690dae2..1195f6bbaf 100755
--- a/images/icons.svg
+++ b/images/icons.svg
@@ -793,6 +793,7 @@
+
diff --git a/images/logo.svg b/images/logo.svg
index ba46ca618b..ef3e9a82b2 100644
--- a/images/logo.svg
+++ b/images/logo.svg
@@ -1,7 +1,7 @@
diff --git a/images/onboarding-wizard/onboarding-bg.svg b/images/onboarding-wizard/onboarding-bg.svg
deleted file mode 100644
index d22cc893bb..0000000000
--- a/images/onboarding-wizard/onboarding-bg.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/js/onboarding-wizard.js b/js/onboarding-wizard.js
index 7cc97877f3..5db5b96d93 100644
--- a/js/onboarding-wizard.js
+++ b/js/onboarding-wizard.js
@@ -1,2 +1,2 @@
/*! For license information please see onboarding-wizard.js.LICENSE.txt */
-!function(){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"default";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.elements=e,this.type=r,this.prepareElements()}var r,n;return r=t,n=[{key:"fadeIn",value:function(){var t=this;this.applyStyleToElements((function(e){e.classList.add("frm-fadein-up"),e.addEventListener("animationend",(function(){t.resetOpacity(),e.classList.remove("frm-fadein-up")}),{once:!0})}))}},{key:"cascadeFadeIn",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.03;setTimeout((function(){t.applyStyleToElements((function(t,r){t.classList.remove("frm-animate"),t.style.transitionDelay=(r+1)*e+"s"}))}),200)}},{key:"prepareElements",value:function(){var t=this;this.applyStyleToElements((function(e){"default"===t.type&&(e.style.opacity="0.0"),"cascade"===t.type&&e.classList.add("frm-init-cascade-animation"),"cascade-3d"===t.type&&e.classList.add("frm-init-fadein-3d"),e.classList.add("frm-animate")}))}},{key:"resetOpacity",value:function(){this.applyStyleToElements((function(t){return t.style.opacity="1.0"}))}},{key:"applyStyleToElements",value:function(t){this.elements instanceof Element?t(this.elements,0):02&&void 0!==arguments[2]?arguments[2]:"pushState";if(u.set(t,e),c.search=u.toString(),["pushState","replaceState"].includes(l)){var s=(r={},o=e,i=function(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n=t),(n="symbol"==a(i)?i:String(i))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r);window.history[l](s,"",c)}return c.toString()},h=window.frmGlobal,p=(h.url,h.nonce),y="frm_hidden",d="frm-current",v="frm-checked",m=function(t){return null==t?void 0:t.classList.remove(y)},g=function(t){return null==t?void 0:t.classList.add(y)},b=window.frmDom.span;function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function E(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==I(t)||null===t)throw new Error("createPageState: initialState must be a non-null object");var e=t;return{getState:function(){return e},getSingleState:function(t){var r=Reflect.get(e,t);return void 0===r?null:r},setState:function(t){if("object"!==I(t)||null===t)throw new Error("setState: newState must be a non-null object");e=A(A({},e),t)},setSingleState:function(t,r){Reflect.has(e,t)&&Reflect.set(e,t,r)}}}({processedSteps:[],installedAddons:[],emailStepData:{}}),N=T.getState,F=(T.getSingleState,T.setState,T.setSingleState),D=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==S(t)||null===t)throw new Error("createPageElements: initialElements must be a non-null object");var e=t;return{getElements:function(){return e},addElements:function(t){if("object"!==S(t)||null===t)throw new Error("addElements: newElements must be a non-null object");e=E(E({},e),t)}}}({onboardingWizardPage:document.getElementById("".concat(O,"-wizard-page")),pageBackground:document.getElementById("".concat(O,"-bg")),container:document.getElementById("".concat(O,"-container")),steps:document.querySelectorAll(".".concat(O,"-step")),skipStepButtons:document.querySelectorAll(".".concat(O,"-skip-step")),backButtons:document.querySelectorAll(".".concat(O,"-back-button")),hiddenLicenseKeyInput:document.getElementById("frm-license-key"),installFormidableProStep:document.getElementById("".concat(O,"-install-formidable-pro-step")),checkProInstallationButton:document.getElementById("".concat(O,"-check-pro-installation-button")),skipProInstallationButton:document.getElementById("".concat(O,"-skip-pro-installation-button")),checkProInstallationError:document.getElementById("".concat(O,"-check-pro-installation-error")),licenseManagementStep:document.getElementById("".concat(O,"-license-management-step")),licenseKeyInput:document.getElementById("edd_formidable_pro_license_key"),saveLicenseButton:document.getElementById("".concat(O,"-save-license-button")),welcomeStep:document.getElementById(j),setupEmailStepButton:document.getElementById("".concat(O,"-setup-email-step-button")),defaultEmailField:document.getElementById("".concat(O,"-default-email-field")),defaultFromEmailField:document.getElementById("".concat(O,"-from-email")),subscribeCheckbox:document.getElementById("".concat(O,"-subscribe")),summaryEmailsCheckbox:document.getElementById("".concat(O,"-summary-emails")),allowTrackingCheckbox:document.getElementById("".concat(O,"-allow-tracking")),installAddonsButton:document.getElementById("".concat(O,"-install-addons-button")),successStep:document.getElementById("".concat(O,"-success-step"))}),B=D.getElements;function G(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&(a.includes(k.SUCCESS)||a.push(k.SUCCESS),(r=new FormData).append("processed_steps",a.join(",")),r.append("completed_steps",!0))}if(k.DEFAULT_EMAIL_ADDRESS===t){var c=N().emailStepData;if(i=c,0!==Object.keys(i).length||i.constructor!==Object){var u;r=null!==(u=r)&&void 0!==u?u:new FormData;for(var l=0,s=Object.entries(c);l0&&(r=null!==(y=r)&&void 0!==y?y:new FormData).append("installed_addons",d.join(","))}return r}(t,e);r&&(0,frmDom.ajax.doJsonPost)("onboarding_setup_usage_data",r)},M=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pushState",r=document.querySelector(".".concat(O,'-step[data-step-name="').concat(t,'"]'));if(r){var o=document.querySelector(".".concat(O,"-step.").concat(d));o&&(o.classList.remove(d),g(o)),r.classList.add(d),m(r),new n(r).fadeIn(),B().onboardingWizardPage.setAttribute("data-current-step",t),f("step",t,e)}},R=function(){var t=document.querySelector(".".concat(O,"-step.").concat(d)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,o=N().processedSteps;o.includes(r)||(o.push(r),F("processedSteps",o)),C(r,n),M(n)}};function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function V(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var Z=function(t){var e=!0;return t.forEach((function(t){var r;"string"==typeof(r=t.value.trim())&&/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i.test(r)||(function(t,e){!function(t,e,r,n){var o=document.querySelector(t),i=document.querySelector(e);o&&i?(i.setAttribute("frm-error",r),m(i),o.addEventListener("keyup",(function(){g(i)}),{once:!0})):console.warn("showFormError: Unable to find input or error element.")}("#".concat(e.id),"#".concat(e.nextElementSibling.id),t)}("invalid",t),e=!1)})),e},H=function(){var t,e=(t=J().mark((function t(){var e,r,n,o,i,a,c,u,l,s,f;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=B(),r=e.defaultEmailField,n=e.defaultFromEmailField,Z([n,r])){t.next=3;break}return t.abrupt("return");case 3:o=B(),i=o.subscribeCheckbox,a=o.summaryEmailsCheckbox,c=o.allowTrackingCheckbox,u=r.value.trim(),null!=i&&i.checked&&(u&&(document.getElementById("frm_leave_email").value=u),frmAdminBuild.addMyEmailAddress(),wp.hooks.addFilter("frm_thank_you_on_signup","frmOnboardingWizard",(function(){return!1}))),l=N(),(s=l.emailStepData).default_email=u,s.from_email=n.value.trim(),s.allows_tracking=c.checked,s.summary_emails=a.checked,i&&(s.is_subscribed=i.checked),F("emailStepData",s),(f=new FormData).append("default_email",u),f.append("from_email",n.value.trim()),f.append("allows_tracking",c.checked),f.append("summary_emails",a.checked),(0,frmDom.ajax.doJsonPost)("onboarding_setup_email_step",f).then(R);case 20:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){V(i,n,o,a,c,"next",t)}function c(t){V(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function Q(t){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(t)}function X(){X=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new A(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Q(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function tt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return et(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?et(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function et(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function lt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var st=function(){var t,e=(t=ut().mark((function t(){var e,r,n,o,i;return ut().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(e=new FormData).append("action","frm_check_plugin_activation"),e.append("nonce",p),e.append("plugin_path","formidable-pro/formidable-pro.php"),t.prev=4,t.next=7,fetch(ajaxurl,{method:"POST",body:e});case 7:return n=t.sent,t.next=10,n.json();case 10:r=t.sent,t.next=17;break;case 13:return t.prev=13,t.t0=t.catch(4),console.error("An error occurred:",t.t0),t.abrupt("return");case 17:if(!r.success){t.next=20;break}return R(),t.abrupt("return");case 20:o=B(),i=o.checkProInstallationError,m(i);case 22:case"end":return t.stop()}}),t,null,[[4,13]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){lt(i,n,o,a,c,"next",t)}function c(t){lt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function ft(t){return ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ft(t)}function ht(){ht=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new A(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==ft(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function pt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var yt=function(){var t,e=(t=ht().mark((function t(){return ht().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:M(k.DEFAULT_EMAIL_ADDRESS);case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){pt(i,n,o,a,c,"next",t)}function c(t){pt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function dt(t){return dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dt(t)}function vt(){vt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new A(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==dt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function mt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var gt=function(){var t,e=(t=vt().mark((function t(){return vt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:wp.hooks.addAction("frm_after_authorize","frmOnboardingWizard",(function(t){return!0===t.success&&(window.location.href=f("step",k.DEFAULT_EMAIL_ADDRESS,"replaceState")),t}));case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){mt(i,n,o,a,c,"next",t)}function c(t){mt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function bt(){var t,e,r,n,o;B().skipStepButtons.forEach((function(t){i(t,W)})),B().backButtons.forEach((function(t){i(t,K)})),o=B().setupEmailStepButton,i(o,H),n=B().saveLicenseButton,i(n,gt),r=B().installAddonsButton,i(r,ot),document.querySelectorAll(Y).forEach((function(t){t.addEventListener("click",z)})),e=B().checkProInstallationButton,i(e,st),t=B().skipProInstallationButton,i(t,yt)}window.addEventListener("popstate",(function(t){var e,r=(null===(e=t.state)||void 0===e?void 0:e.step)||l("step");M(r,"replaceState")}));var wt;wt=function(){q(),bt()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",wt):wt())}();
\ No newline at end of file
+!function(){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"default";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.elements=e,this.type=r,this.prepareElements()},r=[{key:"fadeIn",value:function(){var t=this;this.applyStyleToElements((function(e){e.classList.add("frm-fadein-up"),e.addEventListener("animationend",(function(){t.resetOpacity(),e.classList.remove("frm-fadein-up")}),{once:!0})}))}},{key:"cascadeFadeIn",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.03;setTimeout((function(){t.applyStyleToElements((function(t,r){t.classList.remove("frm-animate"),t.style.transitionDelay=(r+1)*e+"s"}))}),200)}},{key:"prepareElements",value:function(){var t=this;this.applyStyleToElements((function(e){"default"===t.type&&(e.style.opacity="0.0"),"cascade"===t.type&&e.classList.add("frm-init-cascade-animation"),"cascade-3d"===t.type&&e.classList.add("frm-init-fadein-3d"),e.classList.add("frm-animate")}))}},{key:"resetOpacity",value:function(){this.applyStyleToElements((function(t){return t.style.opacity="1.0"}))}},{key:"applyStyleToElements",value:function(t){this.elements instanceof Element?t(this.elements,0):00&&void 0!==arguments[0]?arguments[0]:{};if("object"!==O(t)||null===t)throw new Error("createPageState: initialState must be a non-null object");var e=t;return{getState:function(){return e},getSingleState:function(t){var r=Reflect.get(e,t);return void 0===r?null:r},setState:function(t){if("object"!==O(t)||null===t)throw new Error("setState: newState must be a non-null object");e=L(L({},e),t)},setSingleState:function(t,r){Reflect.has(e,t)&&Reflect.set(e,t,r)}}}({processedSteps:[],installedAddons:[]}),P=x.getState,_=(x.getSingleState,x.setState,x.setSingleState),k=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==g(t)||null===t)throw new Error("createPageElements: initialElements must be a non-null object");var e=t;return{getElements:function(){return e},addElements:function(t){if("object"!==g(t)||null===t)throw new Error("addElements: newElements must be a non-null object");e=v(v({},e),t)}}}({onboardingWizardPage:document.getElementById("".concat(w,"-wizard-page")),container:document.getElementById("".concat(w,"-container")),rootline:document.getElementById("".concat(w,"-rootline")),steps:document.querySelectorAll(".".concat(w,"-step")),skipStepButtons:document.querySelectorAll(".".concat(w,"-skip-step")),backButtons:document.querySelectorAll(".".concat(w,"-back-button")),consentTrackingButton:document.getElementById("".concat(w,"-consent-tracking")),installAddonsButton:document.getElementById("".concat(w,"-install-addons-button")),hiddenLicenseKeyInput:document.getElementById("frm-license-key")}),T=k.getElements;k.addElements;var A=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pushState",o=document.querySelector(".".concat(w,'-step[data-step-name="').concat(t,'"]'));if(o){var i=document.querySelector(".".concat(w,"-step.").concat(y));i&&(i.classList.remove(y),null==(e=i)||e.classList.add(h)),o.classList.add(y),function(t){null==t||t.classList.remove(h)}(o),new n(o).fadeIn(),T().onboardingWizardPage.setAttribute("data-current-step",t),function(t,e){var r,n,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"pushState";if(u.set(t,e),c.search=u.toString(),["pushState","replaceState"].includes(i)){var l=(r={},o=e,(n=function(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}(n=t))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r);window.history[i](l,"",c)}c.toString()}("step",t,r),function(t){t===S.UNSUCCESSFUL&&(t=S.SUCCESS);var e=T().rootline,r=e.querySelector('.frm-rootline-item[data-step="'.concat(t,'"]'));e.querySelectorAll(".frm-rootline-item").forEach((function(t){t.classList.remove(N),t.classList.remove(y)}));var n=r.previousElementSibling;if(n)for(;n;)n.classList.add(N),n=n.previousElementSibling;t===S.SUCCESS?r.classList.add(N):r.classList.add(y)}(t)}},I=function(){var t=document.querySelector(".".concat(w,"-step.").concat(y)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,o=P().processedSteps;o.includes(r)||(o.push(r),_("processedSteps",o)),function(t,e){var r=function(t,e){var r;if(S.SUCCESS===e||S.UNSUCCESSFUL===e){var n=P().processedSteps;n.length>1&&(n.includes(e)||n.push(e),(r=new FormData).append("processed_steps",n.join(",")),r.append("completed_steps",!0))}if(S.INSTALL_ADDONS===t){var o,i=P().installedAddons;i.length>0&&(r=null!==(o=r)&&void 0!==o?o:new FormData).append("installed_addons",i.join(","))}return r}(t,e);r&&(0,frmDom.ajax.doJsonPost)("onboarding_setup_usage_data",r)}(r,n),A(n)}};var N="frm-completed-step",D=".frm-option-box";function C(t){"input"===t.target.tagName.toLowerCase()&&t.currentTarget.closest(D).classList.toggle("frm-checked")}var F=function(){I()},U=function(){var t,e;(e=null==(t=document.querySelector(".".concat(w,"-step.").concat(y)))?void 0:t.previousElementSibling)&&A(e.dataset.stepName)};function G(t){return G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G(t)}function B(){B=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new T(n||[]);return o(a,"_invoke",{value:x(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(A([])));E&&E!==r&&n.call(E,a)&&(w=E);var L=b.prototype=m.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==G(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function x(e,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function q(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var Y=function(){var t,e=(t=B().mark((function t(){return B().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(0,frmDom.ajax.doJsonPost)("onboarding_consent_tracking",new FormData).then(I);case 2:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){q(i,n,o,a,c,"next",t)}function c(t){q(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function R(){R=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new T(n||[]);return o(a,"_invoke",{value:x(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(A([])));E&&E!==r&&n.call(E,a)&&(w=E);var L=b.prototype=m.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==z(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function x(e,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function W(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return J(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?J(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r 1 ) {
- if ( ! processedSteps.includes( STEPS.SUCCESS ) ) {
- processedSteps.push( STEPS.SUCCESS );
+ if ( ! processedSteps.includes( nextStepName ) ) {
+ processedSteps.push( nextStepName );
}
+
formData = new FormData();
formData.append( 'processed_steps', processedSteps.join( ',' ) );
formData.append( 'completed_steps', true );
}
}
- // Append email step data for the email step
- if ( STEPS.DEFAULT_EMAIL_ADDRESS === processedStep ) {
- const { emailStepData } = getState();
- if ( ! isEmptyObject( emailStepData ) ) {
- formData = formData ?? new FormData();
- for ( const [ key, value ] of Object.entries( emailStepData ) ) {
- formData.append( key, value );
- }
- }
- }
-
// Append installed addons for the addon installation step
if ( STEPS.INSTALL_ADDONS === processedStep ) {
const { installedAddons } = getState();
+
if ( installedAddons.length > 0 ) {
formData = formData ?? new FormData();
formData.append( 'installed_addons', installedAddons.join( ',' ) );
diff --git a/js/src/onboarding-wizard/elements/elements.js b/js/src/onboarding-wizard/elements/elements.js
index 17f5bc1142..5bd720b3a3 100644
--- a/js/src/onboarding-wizard/elements/elements.js
+++ b/js/src/onboarding-wizard/elements/elements.js
@@ -6,43 +6,19 @@ import { createPageElements } from 'core/factory';
/**
* Internal dependencies
*/
-import { PREFIX, WELCOME_STEP_ID } from '../shared';
+import { PREFIX } from '../shared';
export const { getElements, addElements } = createPageElements({
- // Body Elements
onboardingWizardPage: document.getElementById( `${PREFIX}-wizard-page` ),
- pageBackground: document.getElementById( `${PREFIX}-bg` ),
container: document.getElementById( `${PREFIX}-container` ),
+
+ rootline: document.getElementById( `${PREFIX}-rootline` ),
steps: document.querySelectorAll( `.${PREFIX}-step` ),
skipStepButtons: document.querySelectorAll( `.${PREFIX}-skip-step` ),
backButtons: document.querySelectorAll( `.${PREFIX}-back-button` ),
- hiddenLicenseKeyInput: document.getElementById( 'frm-license-key' ),
-
- // Install Formidable Pro Step Elements
- installFormidableProStep: document.getElementById( `${PREFIX}-install-formidable-pro-step` ),
- checkProInstallationButton: document.getElementById( `${PREFIX}-check-pro-installation-button` ),
- skipProInstallationButton: document.getElementById( `${PREFIX}-skip-pro-installation-button` ),
- checkProInstallationError: document.getElementById( `${PREFIX}-check-pro-installation-error` ),
-
- // License Management Step Elements
- licenseManagementStep: document.getElementById( `${PREFIX}-license-management-step` ),
- licenseKeyInput: document.getElementById( 'edd_formidable_pro_license_key' ),
- saveLicenseButton: document.getElementById( `${PREFIX}-save-license-button` ),
- // Welcome Step Elements
- welcomeStep: document.getElementById( WELCOME_STEP_ID ),
-
- // Default Email Address Step Elements
- setupEmailStepButton: document.getElementById( `${PREFIX}-setup-email-step-button` ),
- defaultEmailField: document.getElementById( `${PREFIX}-default-email-field` ),
- defaultFromEmailField: document.getElementById( `${PREFIX}-from-email` ),
- subscribeCheckbox: document.getElementById( `${PREFIX}-subscribe` ),
- summaryEmailsCheckbox: document.getElementById( `${PREFIX}-summary-emails` ),
- allowTrackingCheckbox: document.getElementById( `${PREFIX}-allow-tracking` ),
-
- // Install Formidable Add-ons Step Elements
+ consentTrackingButton: document.getElementById( `${PREFIX}-consent-tracking` ),
installAddonsButton: document.getElementById( `${PREFIX}-install-addons-button` ),
- // Success Step Elements
- successStep: document.getElementById( `${PREFIX}-success-step` )
+ hiddenLicenseKeyInput: document.getElementById( 'frm-license-key' ),
});
diff --git a/js/src/onboarding-wizard/events/backButtonListener.js b/js/src/onboarding-wizard/events/backButtonListener.js
index 3d16a487df..93d941b5b2 100644
--- a/js/src/onboarding-wizard/events/backButtonListener.js
+++ b/js/src/onboarding-wizard/events/backButtonListener.js
@@ -27,7 +27,6 @@ function addBackButtonEvents() {
* Handles the click event on a "Back" button.
*
* @private
- * @param {Event} event The click event object.
* @return {void}
*/
const onBackButtonClick = () => {
diff --git a/js/src/onboarding-wizard/events/checkProInstallationButtonListener.js b/js/src/onboarding-wizard/events/checkProInstallationButtonListener.js
deleted file mode 100644
index 3e572dfe7b..0000000000
--- a/js/src/onboarding-wizard/events/checkProInstallationButtonListener.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * External dependencies
- */
-import { nonce } from 'core/constants';
-import { onClickPreventDefault, show } from 'core/utils';
-
-/**
- * Internal dependencies
- */
-import { getElements } from '../elements';
-import { navigateToNextStep } from '../utils';
-
-/**
- * Manages event handling for the "Continue" button in the "Install Formidable Pro" step.
- *
- * @return {void}
- */
-function addCheckProInstallationButtonEvents() {
- const { checkProInstallationButton } = getElements();
-
- // Attach click event listener
- onClickPreventDefault( checkProInstallationButton, onCheckProInstallationButtonClick );
-}
-
-/**
- * Handles the click event on the "Continue" button in the "Install Formidable Pro" setup.
- *
- * @private
- * @param {Event} event The click event object.
- * @return {void}
- */
-const onCheckProInstallationButtonClick = async() => {
- // Prepare FormData for the POST request
- const formData = new FormData();
- formData.append( 'action', 'frm_check_plugin_activation' );
- formData.append( 'nonce', nonce );
- formData.append( 'plugin_path', 'formidable-pro/formidable-pro.php' );
-
- let data;
-
- try {
- const response = await fetch( ajaxurl, {
- method: 'POST',
- body: formData
- });
- data = await response.json();
- } catch ( error ) {
- console.error( 'An error occurred:', error );
- return;
- }
-
- if ( data.success ) {
- navigateToNextStep();
- return;
- }
-
- const { checkProInstallationError } = getElements();
- show( checkProInstallationError );
-};
-
-export default addCheckProInstallationButtonEvents;
diff --git a/js/src/onboarding-wizard/events/consentTrackingButtonListener.js b/js/src/onboarding-wizard/events/consentTrackingButtonListener.js
new file mode 100644
index 0000000000..f96c602ed9
--- /dev/null
+++ b/js/src/onboarding-wizard/events/consentTrackingButtonListener.js
@@ -0,0 +1,35 @@
+/**
+ * External dependencies
+ */
+import { onClickPreventDefault } from 'core/utils';
+
+/**
+ * Internal dependencies
+ */
+import { getElements } from '../elements';
+import { navigateToNextStep } from '../utils';
+
+/**
+ * Manages event handling for the "Allow & Continue" button in the "Never miss an important update" step.
+ *
+ * @return {void}
+ */
+function addConsentTrackingButtonEvents() {
+ const { consentTrackingButton } = getElements();
+
+ // Attach click event listener
+ onClickPreventDefault( consentTrackingButton, onConsentTrackingButtonClick );
+}
+
+/**
+ * Handles the click event on the "Allow & Continue" button in the "Never miss an important update" step.
+ *
+ * @private
+ * @return {void}
+ */
+const onConsentTrackingButtonClick = async() => {
+ const { doJsonPost } = frmDom.ajax;
+ doJsonPost( 'onboarding_consent_tracking', new FormData() ).then( navigateToNextStep );
+};
+
+export default addConsentTrackingButtonEvents;
diff --git a/js/src/onboarding-wizard/events/index.js b/js/src/onboarding-wizard/events/index.js
index e50528382f..4f0fe84be0 100644
--- a/js/src/onboarding-wizard/events/index.js
+++ b/js/src/onboarding-wizard/events/index.js
@@ -9,11 +9,8 @@ import { getQueryParam } from 'core/utils';
*/
import addSkipStepButtonEvents from './skipStepButtonListener';
import addBackButtonEvents from './backButtonListener';
-import addSetupEmailStepButtonEvents from './setupEmailStepButtonListener';
+import addConsentTrackingButtonEvents from './consentTrackingButtonListener';
import addInstallAddonsButtonEvents from './installAddonsButtonListener';
-import addCheckProInstallationButtonEvents from './checkProInstallationButtonListener';
-import addSkipProInstallationButtonEvents from './skipProInstallationButtonListener';
-import addSaveLicenseButtonEvents from './saveLicenseButtonListener';
import { navigateToStep } from '../utils';
/**
@@ -26,20 +23,12 @@ export function addEventListeners() {
addSkipStepButtonEvents();
addBackButtonEvents();
- // Add event handling for the "Next Step" button in the "Default Email Address" step
- addSetupEmailStepButtonEvents();
-
- // Add event handling for the "Active & continue" button in the "License Management" step.
- addSaveLicenseButtonEvents();
+ addConsentTrackingButtonEvents();
// Add event handling for the "Install & Finish Setup" button in the "Install Formidable Add-ons" step
addInstallAddonsButtonEvents();
// Add event handling for an option-box
addOptionBoxEvents();
-
- // Add event handling for the "Continue" and "Skip" buttons in the "Install Formidable Pro" step
- addCheckProInstallationButtonEvents();
- addSkipProInstallationButtonEvents();
}
/**
diff --git a/js/src/onboarding-wizard/events/installAddonsButtonListener.js b/js/src/onboarding-wizard/events/installAddonsButtonListener.js
index e7fbd6215b..ce8b7b0f5a 100644
--- a/js/src/onboarding-wizard/events/installAddonsButtonListener.js
+++ b/js/src/onboarding-wizard/events/installAddonsButtonListener.js
@@ -61,18 +61,21 @@ const onInstallAddonsButtonClick = async( event ) => {
* Installs an add-on or plugin based on the provided plugin name and vendor status.
*
* @private
- * @param {string} plugin The unique identifier or name of the plugin or add-on to be installed.
- * @param {Object} options An object containing additional options for the installation.
- * @param {boolean} options.isVendor Indicates whether the plugin is a vendor plugin (true) or a regular add-on (false).
+ * @param {string} plugin The unique identifier or name of the plugin or add-on to be installed.
+ * @param {Object} options An object containing additional options for the installation.
+ * @param {boolean} options.isInstalled Indicates whether the plugin is already installed.
+ * @param {boolean} options.isVendor Indicates whether the plugin is a vendor plugin (true) or a regular add-on (false).
* @return {Promise} A promise that resolves with the JSON response from the server after the installation request is completed.
*/
-async function installAddon( plugin, {isVendor}) {
+async function installAddon( plugin, {isVendor, isInstalled}) {
// Prepare FormData for the POST request
const formData = new FormData();
- formData.append( 'action', isVendor ? 'frm_install_plugin' : 'frm_install_addon' );
formData.append( 'nonce', nonce );
formData.append( 'plugin', plugin );
+ const addonAction = isInstalled ? 'frm_activate_addon' : 'frm_install_addon';
+ formData.append( 'action', isVendor ? 'frm_install_plugin' : addonAction );
+
try {
// Perform the POST request
const response = await fetch( ajaxurl, {
diff --git a/js/src/onboarding-wizard/events/saveLicenseButtonListener.js b/js/src/onboarding-wizard/events/saveLicenseButtonListener.js
deleted file mode 100644
index a3b81df048..0000000000
--- a/js/src/onboarding-wizard/events/saveLicenseButtonListener.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * External dependencies
- */
-import { onClickPreventDefault, setQueryParam } from 'core/utils';
-
-/**
- * Internal dependencies
- */
-import { getElements } from '../elements';
-import { STEPS } from '../shared';
-
-/**
- * Manages event handling for the "Active & continue" button in the "License Management" step.
- *
- * @return {void}
- */
-function addSaveLicenseButtonEvents() {
- const { saveLicenseButton } = getElements();
-
- // Attach click event listener
- onClickPreventDefault( saveLicenseButton, onSaveLicenseButtonClick );
-}
-
-/**
- * Handles the click event on the "Active & continue" button in the "License Management" step.
- *
- * @private
- * @param {Event} event The click event object.
- * @return {void}
- */
-const onSaveLicenseButtonClick = async() => {
- wp.hooks.addAction( 'frm_after_authorize', 'frmOnboardingWizard', data => {
- if ( true === data.success ) {
- // After authorization, update URL to "Default Email Address" step and reload the page
- window.location.href = setQueryParam( 'step', STEPS.DEFAULT_EMAIL_ADDRESS, 'replaceState' );
- }
-
- return data;
- });
-};
-
-export default addSaveLicenseButtonEvents;
diff --git a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js b/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js
deleted file mode 100644
index a8b0fdb659..0000000000
--- a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * External dependencies
- */
-import { onClickPreventDefault, isValidEmail } from 'core/utils';
-
-/**
- * Internal dependencies
- */
-import { getElements } from '../elements';
-import { getState, setSingleState } from '../shared';
-import { showEmailAddressError } from '../ui';
-import { navigateToNextStep } from '../utils';
-
-/**
- * Manages event handling for the "Next Step" button in the "Default Email Address" step.
- *
- * @return {void}
- */
-function addSetupEmailStepButtonEvents() {
- const { setupEmailStepButton } = getElements();
-
- // Attach click event listener
- onClickPreventDefault( setupEmailStepButton, onSetupEmailStepButtonClick );
-}
-
-const validateEmails = emailInputs => {
- let isValid = true;
- emailInputs.forEach( input => {
- const emailAddress = input.value.trim();
- if ( ! isValidEmail( emailAddress ) ) {
- showEmailAddressError( 'invalid', input );
- isValid = false;
- }
- });
- return isValid;
-};
-
-/**
- * Handles the click event on the "Next Step" button in the "Default Email Address" step.
- *
- * @private
- *
- * @return {void}
- */
-const onSetupEmailStepButtonClick = async() => {
- const { defaultEmailField, defaultFromEmailField } = getElements();
-
- // Check if the emails are valid
- if ( ! validateEmails( [ defaultFromEmailField, defaultEmailField ] ) ) {
- return;
- }
-
- const { subscribeCheckbox, summaryEmailsCheckbox, allowTrackingCheckbox } = getElements();
- const email = defaultEmailField.value.trim();
-
- // Check if the 'subscribe' checkbox is selected. If so, proceed to add the user's email to the active campaign
- if ( subscribeCheckbox?.checked ) {
- // Assign default email to 'leave email' input if provided; otherwise, use administrator's email
- if ( email ) {
- const emailInput = document.getElementById( 'frm_leave_email' );
- emailInput.value = email;
- }
-
- frmAdminBuild.addMyEmailAddress();
- // Avoid replacing `#frm_leave_email_wrapper` content with a success message after email setup to prevent errors during modifications.
- wp.hooks.addFilter( 'frm_thank_you_on_signup', 'frmOnboardingWizard', () => false );
- }
-
- // Capture usage data
- const { emailStepData } = getState();
- emailStepData.default_email = email;
- emailStepData.from_email = defaultFromEmailField.value.trim();
- emailStepData.allows_tracking = allowTrackingCheckbox.checked;
- emailStepData.summary_emails = summaryEmailsCheckbox.checked;
- if ( subscribeCheckbox ) {
- emailStepData.is_subscribed = subscribeCheckbox.checked;
- }
- setSingleState( 'emailStepData', emailStepData );
-
- // Prepare FormData for the POST request
- const formData = new FormData();
- formData.append( 'default_email', email );
- formData.append( 'from_email', defaultFromEmailField.value.trim() );
- formData.append( 'allows_tracking', allowTrackingCheckbox.checked );
- formData.append( 'summary_emails', summaryEmailsCheckbox.checked );
-
- // Send the POST request
- const { doJsonPost } = frmDom.ajax;
- doJsonPost( 'onboarding_setup_email_step', formData ).then( navigateToNextStep );
-};
-
-export default addSetupEmailStepButtonEvents;
diff --git a/js/src/onboarding-wizard/events/skipProInstallationButtonListener.js b/js/src/onboarding-wizard/events/skipProInstallationButtonListener.js
deleted file mode 100644
index f8f81a2cb2..0000000000
--- a/js/src/onboarding-wizard/events/skipProInstallationButtonListener.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * External dependencies
- */
-import { onClickPreventDefault } from 'core/utils';
-
-/**
- * Internal dependencies
- */
-import { getElements } from '../elements';
-import { STEPS } from '../shared';
-import { navigateToStep } from '../utils';
-
-/**
- * Manages event handling for the "Skip" button in the "Install Formidable Pro" step.
- *
- * @return {void}
- */
-function addSkipProInstallationButtonEvents() {
- const { skipProInstallationButton } = getElements();
-
- // Attach click event listener
- onClickPreventDefault( skipProInstallationButton, onSkipProInstallationButtonClick );
-}
-
-/**
- * Handles the click event on the "Skip" button in the "Install Formidable Pro" setup.
- *
- * @private
- * @param {Event} event The click event object.
- * @return {void}
- */
-const onSkipProInstallationButtonClick = async() => {
- navigateToStep( STEPS.DEFAULT_EMAIL_ADDRESS );
-};
-
-export default addSkipProInstallationButtonEvents;
diff --git a/js/src/onboarding-wizard/events/skipStepButtonListener.js b/js/src/onboarding-wizard/events/skipStepButtonListener.js
index 6294f685b5..b4e11eb1b8 100644
--- a/js/src/onboarding-wizard/events/skipStepButtonListener.js
+++ b/js/src/onboarding-wizard/events/skipStepButtonListener.js
@@ -27,7 +27,6 @@ function addSkipStepButtonEvents() {
* Handles the click event on a "Skip" step button.
*
* @private
- * @param {Event} event The click event object.
* @return {void}
*/
const onSkipStepButtonClick = () => {
diff --git a/js/src/onboarding-wizard/index.js b/js/src/onboarding-wizard/index.js
index eb33d0e833..ac4f5a113b 100644
--- a/js/src/onboarding-wizard/index.js
+++ b/js/src/onboarding-wizard/index.js
@@ -9,6 +9,5 @@ import domReady from '@wordpress/dom-ready';
import initializeOnboardingWizard from './initializeOnboardingWizard';
domReady( () => {
- // Initialize the Onboarding Wizard
initializeOnboardingWizard();
});
diff --git a/js/src/onboarding-wizard/shared/constants.js b/js/src/onboarding-wizard/shared/constants.js
index 686db848bb..50ccbf3e4c 100644
--- a/js/src/onboarding-wizard/shared/constants.js
+++ b/js/src/onboarding-wizard/shared/constants.js
@@ -1,13 +1,10 @@
-export const { INITIAL_STEP, proIsIncluded } = window.frmOnboardingWizardVars;
+export const { INITIAL_STEP } = window.frmOnboardingWizardVars;
export const PREFIX = 'frm-onboarding';
-export const WELCOME_STEP_ID = `${PREFIX}-welcome-step`;
export const STEPS = {
INITIAL: INITIAL_STEP,
- DEFAULT_EMAIL_ADDRESS: 'default-email-address',
- INSTALL_FORMIDABLE_PRO: 'install-formidable-pro',
- LICENSE_MANAGEMENT: 'license-management',
INSTALL_ADDONS: 'install-addons',
- SUCCESS: 'success'
+ SUCCESS: 'success',
+ UNSUCCESSFUL: 'unsuccessful'
};
diff --git a/js/src/onboarding-wizard/shared/pageState.js b/js/src/onboarding-wizard/shared/pageState.js
index 9df38b9a69..b1b221270c 100644
--- a/js/src/onboarding-wizard/shared/pageState.js
+++ b/js/src/onboarding-wizard/shared/pageState.js
@@ -6,5 +6,4 @@ import { createPageState } from 'core/factory';
export const { getState, getSingleState, setState, setSingleState } = createPageState({
processedSteps: [],
installedAddons: [],
- emailStepData: {},
});
diff --git a/js/src/onboarding-wizard/ui/index.js b/js/src/onboarding-wizard/ui/index.js
index fbf18552a5..e54a5688f1 100644
--- a/js/src/onboarding-wizard/ui/index.js
+++ b/js/src/onboarding-wizard/ui/index.js
@@ -1,2 +1,2 @@
export { default as setupInitialView } from './setupInitialView';
-export * from './showError';
+export * from './rootline';
diff --git a/js/src/onboarding-wizard/ui/rootline.js b/js/src/onboarding-wizard/ui/rootline.js
new file mode 100644
index 0000000000..fe9f4fe6fa
--- /dev/null
+++ b/js/src/onboarding-wizard/ui/rootline.js
@@ -0,0 +1,49 @@
+/**
+ * External dependencies
+ */
+import { CURRENT_CLASS } from 'core/constants';
+
+/**
+ * Internal dependencies
+ */
+import { getElements } from "../elements";
+import { STEPS } from '../shared';
+
+const COMPLETED_STEP_CLASS = 'frm-completed-step';
+
+/**
+ * Updates the rootline to reflect the current and completed steps.
+ *
+ * - Applies COMPLETED_STEP_CLASS to steps before the current one.
+ * - Applies CURRENT_CLASS to the current step, unless it is the success step.
+ *
+ * @param {string} currentStep The current step in the process.
+ * @return {void}
+ */
+export function updateRootline( currentStep ) {
+ if ( currentStep === STEPS.UNSUCCESSFUL ) {
+ currentStep = STEPS.SUCCESS;
+ }
+
+ const { rootline } = getElements();
+ const currentItem = rootline.querySelector( `.frm-rootline-item[data-step="${currentStep}"]` );
+
+ rootline.querySelectorAll( '.frm-rootline-item' ).forEach( item => {
+ item.classList.remove( COMPLETED_STEP_CLASS );
+ item.classList.remove( CURRENT_CLASS );
+ });
+
+ let prevItem = currentItem.previousElementSibling;
+ if ( prevItem ) {
+ while ( prevItem ) {
+ prevItem.classList.add( COMPLETED_STEP_CLASS );
+ prevItem = prevItem.previousElementSibling; // move to the previous sibling
+ }
+ }
+
+ if ( currentStep === STEPS.SUCCESS ) {
+ currentItem.classList.add( COMPLETED_STEP_CLASS );
+ } else {
+ currentItem.classList.add( CURRENT_CLASS );
+ }
+}
diff --git a/js/src/onboarding-wizard/ui/setupInitialView.js b/js/src/onboarding-wizard/ui/setupInitialView.js
index 338288a83c..73c9f42ed5 100644
--- a/js/src/onboarding-wizard/ui/setupInitialView.js
+++ b/js/src/onboarding-wizard/ui/setupInitialView.js
@@ -2,13 +2,12 @@
* External dependencies
*/
import { frmAnimate, getQueryParam, removeQueryParam, hasQueryParam } from 'core/utils';
-import { addProgressToCardBoxes } from 'core/ui';
/**
* Internal dependencies
*/
import { getElements } from '../elements';
-import { STEPS, WELCOME_STEP_ID, proIsIncluded } from '../shared';
+import { STEPS } from '../shared';
import { navigateToStep } from '../utils';
/**
@@ -19,11 +18,7 @@ import { navigateToStep } from '../utils';
*/
export default function setupInitialView() {
navigateToInitialStep();
- enhanceStepsWithProgress();
fadeInPageElements();
-
- // Load the email form from the server for the "Default Email Address" step
- loadApiEmailForm();
}
/**
@@ -35,6 +30,7 @@ export default function setupInitialView() {
*/
function navigateToInitialStep() {
const initialStepName = determineInitialStep();
+
clearOnboardingQueryParams();
navigateToStep( initialStepName, 'replaceState' );
}
@@ -47,56 +43,19 @@ function navigateToInitialStep() {
* @return {string} The name of the initial step to navigate to.
*/
function determineInitialStep() {
- const { hiddenLicenseKeyInput, installFormidableProStep, licenseManagementStep } = getElements();
-
- if ( hiddenLicenseKeyInput ) {
- return handleLicenseKeyInput( hiddenLicenseKeyInput, installFormidableProStep, licenseManagementStep ); // Steps are conditionally removed inside handleLicenseKeyInput based on proIsIncluded
- }
-
- if ( hasQueryParam( 'success' ) ) {
- // Handle the case where 'success' query parameter is present
- installFormidableProStep.remove();
- licenseManagementStep.remove();
- return STEPS.DEFAULT_EMAIL_ADDRESS;
- }
-
- const stepQueryParam = getQueryParam( 'step' ) || STEPS.INITIAL;
+ const isConnectedAccount = getQueryParam( 'success' );
- switch ( stepQueryParam ) {
- case STEPS.LICENSE_MANAGEMENT:
- installFormidableProStep.remove();
- break;
- case STEPS.INSTALL_FORMIDABLE_PRO:
- break;
- default:
- // Remove both steps as they are not needed
- installFormidableProStep.remove();
- licenseManagementStep.remove();
+ if ( isConnectedAccount === '0' ) {
+ return STEPS.UNSUCCESSFUL;
}
- return stepQueryParam;
-}
+ const { hiddenLicenseKeyInput } = getElements();
-/**
- * Handles the presence of a hidden license key input, determining the next step based on whether Formidable Pro is installed.
- * Removes unnecessary steps based on the determined next step.
- *
- * @private
- * @param {HTMLElement} hiddenLicenseKeyInput The hidden input element containing the license key.
- * @param {HTMLElement} installFormidableProStep The step element for installing Formidable Pro.
- * @param {HTMLElement} licenseManagementStep The step element for license management.
- * @return {string} The name of the next step to navigate to.
- */
-function handleLicenseKeyInput( hiddenLicenseKeyInput, installFormidableProStep, licenseManagementStep ) {
- const { licenseKeyInput } = getElements();
- licenseKeyInput.value = hiddenLicenseKeyInput.value;
-
- if ( proIsIncluded ) {
- installFormidableProStep.remove(); // Remove install Pro step if Pro is installed
- return STEPS.LICENSE_MANAGEMENT;
+ if ( hiddenLicenseKeyInput || isConnectedAccount ) {
+ return STEPS.INSTALL_ADDONS;
}
- return STEPS.INSTALL_FORMIDABLE_PRO;
+ return getQueryParam( 'step' ) || STEPS.INITIAL;
}
/**
@@ -110,17 +69,6 @@ function clearOnboardingQueryParams() {
removeQueryParam( 'success' );
}
-/**
- * Adds a progress bar to each step except the welcome step.
- *
- * @private
- * @return {void}
- */
-function enhanceStepsWithProgress() {
- const { steps } = getElements();
- addProgressToCardBoxes([ ...steps ].filter( step => step.id !== WELCOME_STEP_ID ) );
-}
-
/**
* Smoothly fades in the background and container elements of the page for a more pleasant user experience.
*
@@ -128,18 +76,7 @@ function enhanceStepsWithProgress() {
* @return {void}
*/
function fadeInPageElements() {
- const { pageBackground, container } = getElements();
- new frmAnimate( pageBackground ).fadeIn();
- new frmAnimate( container ).fadeIn();
-}
+ const { container } = getElements();
-/**
- * Loads the email form from the server for the "Default Email Address" step in the Onboarding Wizard.
- * This involves making a server request to fetch the form and then injecting it into the appropriate part of the DOM.
- *
- * @private
- * @return {void}
- */
-function loadApiEmailForm() {
- frmAdminBuild.loadApiEmailForm();
+ new frmAnimate( container ).fadeIn();
}
diff --git a/js/src/onboarding-wizard/ui/showError.js b/js/src/onboarding-wizard/ui/showError.js
deleted file mode 100644
index 78a47b8fd4..0000000000
--- a/js/src/onboarding-wizard/ui/showError.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * External dependencies
- */
-import { showFormError } from 'core/utils';
-
-/**
- * Displays errors related to the email address field.
- *
- * @since 6.15 Added the `input` param.
- *
- * @param {string} type The categorization of the error (e.g., "invalid", "empty").
- * @param {HTMLInputElement} input The input element to which the error is related.
- * @return {void}
- */
-export const showEmailAddressError = ( type, input ) => {
- showFormError( `#${input.id}`, `#${input.nextElementSibling.id}`, type );
-};
diff --git a/js/src/onboarding-wizard/utils/navigateToStep.js b/js/src/onboarding-wizard/utils/navigateToStep.js
index 38858bbd49..3fb4379bb8 100644
--- a/js/src/onboarding-wizard/utils/navigateToStep.js
+++ b/js/src/onboarding-wizard/utils/navigateToStep.js
@@ -10,6 +10,7 @@ import { frmAnimate, setQueryParam, hide, show } from 'core/utils';
import { setupUsageData } from '../dataUtils';
import { getElements } from '../elements';
import { getState, PREFIX, setSingleState } from '../shared';
+import { updateRootline } from '../ui';
/**
* Navigates to the given step in the onboarding sequence.
@@ -38,12 +39,14 @@ export const navigateToStep = ( stepName, updateMethod = 'pushState' ) => {
show( targetStep );
new frmAnimate( targetStep ).fadeIn();
- const { onboardingWizardPage } = getElements();
// Update the onboarding wizard's current step attribute
+ const { onboardingWizardPage } = getElements();
onboardingWizardPage.setAttribute( 'data-current-step', stepName );
// Update the URL query parameter, with control over history update method
setQueryParam( 'step', stepName, updateMethod );
+
+ updateRootline( stepName );
};
/**
@@ -70,8 +73,8 @@ export const navigateToNextStep = () => {
processedSteps.push( processedStep );
setSingleState( 'processedSteps', processedSteps );
}
-
setupUsageData( processedStep, nextStepName );
+
navigateToStep( nextStepName );
};