/home/techb158/public_html/wp-content/plugins/wpforms-lite/includes/admin
Edit: /home/techb158/public_html/wp-content/plugins/wpforms-lite/includes/admin/class-welcome.php (18646B)
is_setup_wizard_disabled() ) {
return;
}
// The Setup Wizard owns the first-run experience. Defer to it when it
// auto-launches on this request and stands down entirely once it has finished.
// This page is only the fallback when the wizard cannot run.
if ( $this->setup_wizard_handles_first_run() ) {
return;
}
// Check if this is an update or first install.
$upgrade = get_option( MigrationsBase::PREVIOUS_CORE_VERSION_OPTION_NAME );
if ( ! $upgrade ) {
// Initial install.
wp_safe_redirect( admin_url( 'index.php?page=' . self::SLUG ) );
exit;
}
}
/**
* Whether the Setup Wizard, not this page, owns the first-run experience.
*
* True when the wizard will auto-launch on this request or has already
* finished. Guarded so the page degrades to its legacy behaviour if the
* wizard class is unavailable (e.g. filtered out).
*
* @since 2.0.0
*
* @return bool
* @noinspection ClassConstantCanBeUsedInspection
*/
private function setup_wizard_handles_first_run(): bool {
$wizard = '\WPForms\SetupWizard\SetupWizard';
if ( ! class_exists( $wizard ) || ! method_exists( $wizard, 'will_auto_launch' ) ) {
return false;
}
// Already finished: never bounce the user to the getting-started screen.
if ( get_option( $wizard::OPTION_COMPLETED ) ) {
return true;
}
return $wizard::will_auto_launch();
}
/**
* Whether the Setup Wizard kill switch suppresses this redirect too.
*
* The `wpforms_setup_wizard_disabled` option, the
* `WPFORMS_SETUP_WIZARD_DISABLED` constant, and the
* `wpforms_setup_wizard_setup_wizard_is_disabled` filter disable the whole
* first-run experience, not only the wizard, so provisioning flows get zero
* unintended screens from a single switch. Guarded so the page degrades to
* its legacy behaviour if the wizard class is unavailable.
*
* @since 2.0.1
*
* @return bool
* @noinspection ClassConstantCanBeUsedInspection
*/
private function is_setup_wizard_disabled(): bool {
$wizard = '\WPForms\SetupWizard\SetupWizard';
if ( ! class_exists( $wizard ) || ! method_exists( $wizard, 'is_disabled' ) ) {
return false;
}
return $wizard::is_disabled();
}
/**
* Output a notice offering to launch the Setup Wizard manually.
*
* Shown on the Welcome page so users who landed here as the wizard fallback
* can still start the guided setup on demand. Hidden when the wizard class is
* unavailable (e.g. filtered out).
*
* @since 2.0.0
*/
private function output_setup_wizard_notice(): void {
$wizard = '\WPForms\SetupWizard\SetupWizard';
if ( ! class_exists( $wizard ) || ! method_exists( $wizard, 'get_manual_launch_url' ) ) {
return;
}
$url = $wizard::get_manual_launch_url();
?>
is_pro() ? 'pro' : 'lite';
?>