From f4356bb84689b7fefc886dd7fc306ed56248c6bb Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 2 Feb 2026 15:17:59 +0800 Subject: [PATCH 1/7] Setup Wizard: Use Named Steps --- admin/class-convertkit-admin-setup-wizard.php | 54 ++++++++++++++++--- ...s-convertkit-admin-setup-wizard-plugin.php | 38 ++++++------- ...ontent-2.php => content-configuration.php} | 0 .../{content-3.php => content-finish.php} | 0 .../{content-1.php => content-start.php} | 0 views/backend/setup-wizard/header.php | 10 ++-- 6 files changed, 73 insertions(+), 29 deletions(-) rename views/backend/setup-wizard/convertkit-setup/{content-2.php => content-configuration.php} (100%) rename views/backend/setup-wizard/convertkit-setup/{content-3.php => content-finish.php} (100%) rename views/backend/setup-wizard/convertkit-setup/{content-1.php => content-start.php} (100%) diff --git a/admin/class-convertkit-admin-setup-wizard.php b/admin/class-convertkit-admin-setup-wizard.php index 4e3096048..64868ad8e 100644 --- a/admin/class-convertkit-admin-setup-wizard.php +++ b/admin/class-convertkit-admin-setup-wizard.php @@ -51,9 +51,9 @@ class ConvertKit_Admin_Setup_Wizard { * * @since 1.9.8.4 * - * @var int + * @var string */ - public $step = 1; + public $step = 'start'; /** * The programmatic name of the setup screen. @@ -170,7 +170,7 @@ public function maybe_load_setup_screen() { } // Define the step the user is on in the setup process. - $this->step = ( filter_has_var( INPUT_GET, 'step' ) ? absint( filter_input( INPUT_GET, 'step', FILTER_SANITIZE_NUMBER_INT ) ) : 1 ); + $this->step = ( filter_has_var( INPUT_GET, 'step' ) ? filter_input( INPUT_GET, 'step', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) : 'start' ); // Process any posted form data. $this->process_form(); @@ -193,6 +193,46 @@ public function maybe_load_setup_screen() { } + /** + * Get the number of the current step. + * + * @since 3.1.7 + * + * @return int Step number. + */ + public function get_current_step_number() { + + return array_search( $this->step, array_keys( $this->steps ), true ) + 1; + + } + + /** + * Get the step by number. + * + * @since 3.1.7 + * + * @param int $number Step number (1 based index). + * @return string Step name/key. + */ + public function get_step_key_by_number( $number ) { + + return array_keys( $this->steps )[ $number - 1 ]; + + } + + /** + * Get the total number of steps. + * + * @since 3.1.7 + * + * @return int Total steps. + */ + public function get_total_steps() { + + return count( $this->steps ); + + } + /** * Process submitted form data for the given setup wizard name and current step. * @@ -231,24 +271,24 @@ private function define_step_urls() { ); // Define the previous step URL if we're not on the first or last step. - if ( $this->step > 1 && $this->step < count( $this->steps ) ) { + if ( $this->get_current_step_number() > 1 && $this->get_current_step_number() < $this->get_total_steps() ) { $this->previous_step_url = add_query_arg( array( 'page' => $this->page_name, 'convertkit-modal' => $this->is_modal(), - 'step' => ( $this->step - 1 ), + 'step' => $this->get_step_key_by_number( $this->get_current_step_number() - 1 ), ), admin_url( 'options.php' ) ); } // Define the next step URL if we're not on the last page. - if ( $this->step < count( $this->steps ) ) { + if ( $this->get_current_step_number() < $this->get_total_steps() ) { $this->next_step_url = add_query_arg( array( 'page' => $this->page_name, 'convertkit-modal' => $this->is_modal(), - 'step' => ( $this->step + 1 ), + 'step' => $this->get_step_key_by_number( $this->get_current_step_number() + 1 ), ), admin_url( 'options.php' ) ); diff --git a/admin/setup-wizard/class-convertkit-admin-setup-wizard-plugin.php b/admin/setup-wizard/class-convertkit-admin-setup-wizard-plugin.php index 6df21be86..154f0dd9c 100644 --- a/admin/setup-wizard/class-convertkit-admin-setup-wizard-plugin.php +++ b/admin/setup-wizard/class-convertkit-admin-setup-wizard-plugin.php @@ -105,20 +105,20 @@ public function __construct() { // Define details for each step in the setup process. $this->steps = array( - 1 => array( + 'start' => array( 'name' => __( 'Connect', 'convertkit' ), 'next_button' => array( 'label' => __( 'Connect', 'convertkit' ), - 'link' => $this->api->get_oauth_url( admin_url( 'options.php?page=convertkit-setup&step=2' ), get_site_url() ), + 'link' => $this->api->get_oauth_url( admin_url( 'options.php?page=convertkit-setup&step=configuration' ), get_site_url() ), ), ), - 2 => array( + 'configuration' => array( 'name' => __( 'Configuration', 'convertkit' ), 'next_button' => array( 'label' => __( 'Finish Setup', 'convertkit' ), ), ), - 3 => array( + 'finish' => array( 'name' => __( 'Done', 'convertkit' ), ), ); @@ -210,11 +210,11 @@ public function process_form( $step ) { // Depending on the step, process the form data. switch ( $step ) { - case 2: + case 'configuration': // If an error occured from OAuth i.e. the user did not authorize, show it now. if ( array_key_exists( 'error', $_REQUEST ) && array_key_exists( 'error_description', $_REQUEST ) ) { // Decrement the step. - $this->step = ( $this->step - 1 ); + $this->step = 'start'; $this->error = sanitize_text_field( wp_unslash( $_REQUEST['error_description'] ) ); return; } @@ -233,7 +233,7 @@ public function process_form( $step ) { // Show an error message if we could not fetch the access token. if ( is_wp_error( $result ) ) { // Decrement the step. - $this->step = ( $this->step - 1 ); + $this->step = 'start'; $this->error = $result->get_error_message(); return; } @@ -248,12 +248,14 @@ public function process_form( $step ) { ); break; - case 3: + case 'finish': // Run security checks. if ( ! isset( $_REQUEST['_wpnonce'] ) ) { return; } if ( ! wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ), $this->page_name ) ) { + // Decrement the step. + $this->step = 'configuration'; $this->error = __( 'Invalid nonce specified.', 'convertkit' ); return; } @@ -284,7 +286,7 @@ public function load_screen_data( $step ) { // If this wizard is being served in a modal window, change the flow. if ( $this->is_modal() ) { switch ( $step ) { - case 1: + case 'start': // Setup API. $api = new ConvertKit_API_V4( CONVERTKIT_OAUTH_CLIENT_ID, CONVERTKIT_OAUTH_CLIENT_REDIRECT_URI ); @@ -304,10 +306,10 @@ function ( $hosts ) { ); // Redirect to OAuth. - wp_safe_redirect( $api->get_oauth_url( admin_url( 'options.php?page=convertkit-setup&step=2&convertkit-modal=1' ), get_site_url() ) ); + wp_safe_redirect( $api->get_oauth_url( admin_url( 'options.php?page=convertkit-setup&step=configuration&convertkit-modal=1' ), get_site_url() ) ); die(); - case 2: + case 'configuration': // Close modal. $this->maybe_close_modal(); break; @@ -315,7 +317,7 @@ function ( $hosts ) { } switch ( $step ) { - case 2: + case 'configuration': // Re-load settings class now that the Access and Refresh Tokens have been defined. $this->settings = new ConvertKit_Settings(); @@ -326,11 +328,11 @@ function ( $hosts ) { // Bail if an error occured. if ( is_wp_error( $result ) ) { // Change the next button label and make it a link to reload the screen. - $this->steps[2]['next_button']['label'] = __( 'I\'ve created a form in Kit', 'convertkit' ); - $this->steps[2]['next_button']['link'] = add_query_arg( + $this->steps['configuration']['next_button']['label'] = __( 'I\'ve created a form in Kit', 'convertkit' ); + $this->steps['configuration']['next_button']['link'] = add_query_arg( array( 'page' => $this->page_name, - 'step' => 2, + 'step' => 'configuration', ), admin_url( 'options.php' ) ); @@ -340,11 +342,11 @@ function ( $hosts ) { // If no Forms exist in ConvertKit, change the next button label and make it a link to reload // the screen. if ( ! $this->forms->exist() ) { - $this->steps[2]['next_button']['label'] = __( 'I\'ve created a form in Kit', 'convertkit' ); - $this->steps[2]['next_button']['link'] = add_query_arg( + $this->steps['configuration']['next_button']['label'] = __( 'I\'ve created a form in Kit', 'convertkit' ); + $this->steps['configuration']['next_button']['link'] = add_query_arg( array( 'page' => $this->page_name, - 'step' => 2, + 'step' => 'configuration', ), admin_url( 'options.php' ) ); diff --git a/views/backend/setup-wizard/convertkit-setup/content-2.php b/views/backend/setup-wizard/convertkit-setup/content-configuration.php similarity index 100% rename from views/backend/setup-wizard/convertkit-setup/content-2.php rename to views/backend/setup-wizard/convertkit-setup/content-configuration.php diff --git a/views/backend/setup-wizard/convertkit-setup/content-3.php b/views/backend/setup-wizard/convertkit-setup/content-finish.php similarity index 100% rename from views/backend/setup-wizard/convertkit-setup/content-3.php rename to views/backend/setup-wizard/convertkit-setup/content-finish.php diff --git a/views/backend/setup-wizard/convertkit-setup/content-1.php b/views/backend/setup-wizard/convertkit-setup/content-start.php similarity index 100% rename from views/backend/setup-wizard/convertkit-setup/content-1.php rename to views/backend/setup-wizard/convertkit-setup/content-start.php diff --git a/views/backend/setup-wizard/header.php b/views/backend/setup-wizard/header.php index 5194c20b6..6598dab8a 100644 --- a/views/backend/setup-wizard/header.php +++ b/views/backend/setup-wizard/header.php @@ -41,10 +41,12 @@
    steps as $step_count => $step ) { + $step_count = 1; + foreach ( $this->steps as $step_name => $step ) { ?> -
  1. +
@@ -75,8 +77,8 @@ printf( /* translators: %1$s: Current Step, %2$s: Total Steps */ esc_html__( 'Step %1$s of %2$s', 'convertkit' ), - esc_html( $this->step ), - esc_html( count( $this->steps ) ) + esc_html( $this->get_current_step_number() ), + esc_html( $this->get_total_steps() ) ); ?>
From 35f2c2e002b393ef15adfda45be62ccb843cdbd3 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 2 Feb 2026 15:20:55 +0800 Subject: [PATCH 2/7] Update Landing Page Wizard --- ...vertkit-admin-setup-wizard-landing-page.php | 18 +++++++++--------- .../plugin-screens/PluginSetupWizardCest.php | 16 ++++++++-------- .../{content-2.php => content-finish.php} | 0 .../{content-1.php => content-start.php} | 0 4 files changed, 17 insertions(+), 17 deletions(-) rename views/backend/setup-wizard/convertkit-landing-page-setup/{content-2.php => content-finish.php} (100%) rename views/backend/setup-wizard/convertkit-landing-page-setup/{content-1.php => content-start.php} (100%) diff --git a/admin/setup-wizard/class-convertkit-admin-setup-wizard-landing-page.php b/admin/setup-wizard/class-convertkit-admin-setup-wizard-landing-page.php index 351a4d65d..50097542a 100644 --- a/admin/setup-wizard/class-convertkit-admin-setup-wizard-landing-page.php +++ b/admin/setup-wizard/class-convertkit-admin-setup-wizard-landing-page.php @@ -86,13 +86,13 @@ public function __construct() { // Define details for each step in the setup process. $this->steps = array( - 1 => array( + 'start' => array( 'name' => __( 'Setup', 'convertkit' ), 'next_button' => array( 'label' => __( 'Create', 'convertkit' ), ), ), - 2 => array( + 'finish' => array( 'name' => __( 'Done', 'convertkit' ), ), ); @@ -124,7 +124,7 @@ public function process_form( $step ) { } // Don't process form data if we're not on the second step. - if ( $step !== 2 ) { + if ( $step !== 'finish' ) { return; } @@ -144,7 +144,7 @@ public function process_form( $step ) { // If an error occured creating the Page, go back a step to show the error. if ( is_wp_error( $this->result ) ) { - $this->step = ( $this->step - 1 ); + $this->step = $this->get_step_key_by_number( $this->get_current_step_number() - 1 ); $this->error = $this->result->get_error_message(); } @@ -198,7 +198,7 @@ public function load_screen_data( $step ) { ); // Don't load data if not on the first step. - if ( $step !== 1 ) { + if ( $step !== 'start' ) { return; } @@ -211,12 +211,12 @@ public function load_screen_data( $step ) { // Bail if an error occured. if ( is_wp_error( $result ) ) { // Change the next button label and make it a link to reload the screen. - unset( $this->steps[1]['next_button'] ); + unset( $this->steps['start']['next_button'] ); $this->current_url = add_query_arg( array( 'page' => $this->page_name, 'ck_post_type' => $this->post_type, - 'step' => 1, + 'step' => 'start', ), admin_url( 'options.php' ) ); @@ -226,12 +226,12 @@ public function load_screen_data( $step ) { // If no Landing Pages exist in ConvertKit, change the next button label and make it a link to reload // the screen. if ( ! $this->landing_pages->exist() ) { - unset( $this->steps[1]['next_button'] ); + unset( $this->steps['start']['next_button'] ); $this->current_url = add_query_arg( array( 'page' => $this->page_name, 'ck_post_type' => $this->post_type, - 'step' => 1, + 'step' => 'start', ), admin_url( 'options.php' ) ); diff --git a/tests/EndToEnd/general/plugin-screens/PluginSetupWizardCest.php b/tests/EndToEnd/general/plugin-screens/PluginSetupWizardCest.php index 9b7f9b7c3..ffed85af0 100644 --- a/tests/EndToEnd/general/plugin-screens/PluginSetupWizardCest.php +++ b/tests/EndToEnd/general/plugin-screens/PluginSetupWizardCest.php @@ -147,7 +147,7 @@ public function testSetupWizardSetupScreenConnectButton(EndToEndTester $I) // Act as if we completed OAuth. $I->setupKitPluginNoDefaultForms($I); - $I->amOnAdminPage('options.php?page=convertkit-setup&step=2'); + $I->amOnAdminPage('options.php?page=convertkit-setup&step=configuration'); // Confirm expected setup wizard screen is displayed. $this->_seeExpectedSetupWizardScreen($I, 2, 'Display an email capture form'); @@ -181,7 +181,7 @@ public function testSetupWizardConnectAccountScreenWithInvalidCredentials(EndToE $I->seeInSource('oauth/authorize?client_id=' . $_ENV['CONVERTKIT_OAUTH_CLIENT_ID']); // Act as if OAuth failed i.e. the user didn't authenticate. - $I->amOnAdminPage('options.php?page=convertkit-setup&step=2&error=' . $error . '&error_description=' . urlencode($errorDescription)); + $I->amOnAdminPage('options.php?page=convertkit-setup&step=configuration&error=' . $error . '&error_description=' . urlencode($errorDescription)); // Confirm expected setup wizard screen is still displayed. $this->_seeExpectedSetupWizardScreen($I, 1, 'Welcome to the Kit Setup Wizard'); @@ -233,7 +233,7 @@ public function testSetupWizardFormConfigurationScreen(EndToEndTester $I) ); // Load Step 2/3. - $I->amOnAdminPage('options.php?page=convertkit-setup&step=2'); + $I->amOnAdminPage('options.php?page=convertkit-setup&step=configuration'); // Confirm expected setup wizard screen is displayed. $this->_seeExpectedSetupWizardScreen($I, 2, 'Display an email capture form'); @@ -334,7 +334,7 @@ public function testSetupWizardUsageTrackingSetting(EndToEndTester $I) ); // Load Step 2/3. - $I->amOnAdminPage('options.php?page=convertkit-setup&step=2'); + $I->amOnAdminPage('options.php?page=convertkit-setup&step=configuration'); // Confirm expected setup wizard screen is displayed. $this->_seeExpectedSetupWizardScreen($I, 2, 'Display an email capture form'); @@ -358,7 +358,7 @@ public function testSetupWizardUsageTrackingSetting(EndToEndTester $I) $I->dontSeeCheckboxIsChecked('#usage_tracking'); // Load Step 2/3 on the Setup Wizard screen again. - $I->amOnAdminPage('options.php?page=convertkit-setup&step=2'); + $I->amOnAdminPage('options.php?page=convertkit-setup&step=configuration'); // Confirm expected setup wizard screen is displayed. $this->_seeExpectedSetupWizardScreen($I, 2, 'Display an email capture form'); @@ -403,7 +403,7 @@ public function testSetupWizardFormConfigurationScreenWhenNoFormsExist(EndToEndT $I->setupKitPluginCredentialsNoData($I); // Load Step 2/3. - $I->amOnAdminPage('options.php?page=convertkit-setup&step=2'); + $I->amOnAdminPage('options.php?page=convertkit-setup&step=configuration'); // Confirm expected setup wizard screen is displayed. $this->_seeExpectedSetupWizardScreen($I, 2, 'Create your first Kit Form', true); @@ -449,7 +449,7 @@ public function testSetupWizardFormConfigurationScreenWhenNoPostsOrPagesExist(En $I->setupKitPluginNoDefaultForms($I); // Load Step 2/3. - $I->amOnAdminPage('options.php?page=convertkit-setup&step=2'); + $I->amOnAdminPage('options.php?page=convertkit-setup&step=configuration'); // Confirm expected setup wizard screen is displayed. $this->_seeExpectedSetupWizardScreen($I, 2, 'Display an email capture form'); @@ -607,7 +607,7 @@ public function testSetupWizardModal(EndToEndTester $I) // Act as if we completed OAuth. $I->setupKitPluginNoDefaultForms($I); - $I->amOnAdminPage('options.php?page=convertkit-setup&step=2&convertkit-modal=1'); + $I->amOnAdminPage('options.php?page=convertkit-setup&step=configuration&convertkit-modal=1'); // Confirm the close modal view was loaded, which includes some JS. $I->seeInSource('self.close();'); diff --git a/views/backend/setup-wizard/convertkit-landing-page-setup/content-2.php b/views/backend/setup-wizard/convertkit-landing-page-setup/content-finish.php similarity index 100% rename from views/backend/setup-wizard/convertkit-landing-page-setup/content-2.php rename to views/backend/setup-wizard/convertkit-landing-page-setup/content-finish.php diff --git a/views/backend/setup-wizard/convertkit-landing-page-setup/content-1.php b/views/backend/setup-wizard/convertkit-landing-page-setup/content-start.php similarity index 100% rename from views/backend/setup-wizard/convertkit-landing-page-setup/content-1.php rename to views/backend/setup-wizard/convertkit-landing-page-setup/content-start.php From ecf7c7185e7f31141222e839f421f0983bf50114 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 2 Feb 2026 15:25:17 +0800 Subject: [PATCH 3/7] Member Content Wizard --- ...ertkit-admin-setup-wizard-landing-page.php | 2 +- ...it-admin-setup-wizard-restrict-content.php | 34 +++++++++---------- ...ontent-2.php => content-configuration.php} | 0 .../{content-1.php => content-start.php} | 0 4 files changed, 18 insertions(+), 18 deletions(-) rename views/backend/setup-wizard/convertkit-restrict-content-setup/{content-2.php => content-configuration.php} (100%) rename views/backend/setup-wizard/convertkit-restrict-content-setup/{content-1.php => content-start.php} (100%) diff --git a/admin/setup-wizard/class-convertkit-admin-setup-wizard-landing-page.php b/admin/setup-wizard/class-convertkit-admin-setup-wizard-landing-page.php index 50097542a..351c2b85f 100644 --- a/admin/setup-wizard/class-convertkit-admin-setup-wizard-landing-page.php +++ b/admin/setup-wizard/class-convertkit-admin-setup-wizard-landing-page.php @@ -86,7 +86,7 @@ public function __construct() { // Define details for each step in the setup process. $this->steps = array( - 'start' => array( + 'start' => array( 'name' => __( 'Setup', 'convertkit' ), 'next_button' => array( 'label' => __( 'Create', 'convertkit' ), diff --git a/admin/setup-wizard/class-convertkit-admin-setup-wizard-restrict-content.php b/admin/setup-wizard/class-convertkit-admin-setup-wizard-restrict-content.php index bde73a004..001f77e9a 100644 --- a/admin/setup-wizard/class-convertkit-admin-setup-wizard-restrict-content.php +++ b/admin/setup-wizard/class-convertkit-admin-setup-wizard-restrict-content.php @@ -140,16 +140,16 @@ public function __construct() { // Define details for each step in the setup process. $this->steps = array( - 1 => array( + 'start' => array( 'name' => __( 'Setup', 'convertkit' ), ), - 2 => array( + 'configuration' => array( 'name' => __( 'Configure', 'convertkit' ), 'next_button' => array( 'label' => __( 'Submit', 'convertkit' ), ), ), - 3 => array( + 'finish' => array( 'name' => __( 'Done', 'convertkit' ), ), ); @@ -167,7 +167,7 @@ public function __construct() { * * @since 2.1.0 * - * @param int $step Current step. + * @param string $step Current step. */ public function process_form( $step ) { @@ -182,7 +182,7 @@ public function process_form( $step ) { // Depending on the step, process the form data. switch ( $step ) { - case 3: + case 'finish': // Sanitize configuration. $configuration = array( 'type' => ( isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : 'download' ), @@ -215,7 +215,7 @@ public function process_form( $step ) { // If here, an error occured as create_download() and create_course() perform a redirect on success. // Show an error message if Account Details could not be fetched e.g. API credentials supplied are invalid. // Decrement the step. - $this->step = ( $this->step - 1 ); + $this->step = $this->get_step_key_by_number( $this->get_current_step_number() - 1 ); $this->error = $result->get_error_message(); return; @@ -230,7 +230,7 @@ public function process_form( $step ) { * * @since 2.1.0 * - * @param int $step Current step. + * @param string $step Current step. */ public function load_screen_data( $step ) { @@ -274,7 +274,7 @@ public function load_screen_data( $step ) { // Load data depending on the current step. switch ( $step ) { - case 1: + case 'start': // Fetch Forms, Products and Tags. $this->forms = new ConvertKit_Resource_Forms( 'restrict_content_wizard' ); $this->products = new ConvertKit_Resource_Products( 'restrict_content_wizard' ); @@ -287,12 +287,12 @@ public function load_screen_data( $step ) { // Bail if an error occured. if ( is_wp_error( $result ) ) { // Change the next label and make it a link to reload the screen. - unset( $this->steps[1]['next_button'] ); + unset( $this->steps['start']['next_button'] ); $this->current_url = add_query_arg( array( 'page' => $this->page_name, 'ck_post_type' => $this->post_type, - 'step' => 1, + 'step' => 'start', ), admin_url( 'options.php' ) ); @@ -305,12 +305,12 @@ public function load_screen_data( $step ) { // Bail if an error occured. if ( is_wp_error( $result ) ) { // Change the next label and make it a link to reload the screen. - unset( $this->steps[1]['next_button'] ); + unset( $this->steps['start']['next_button'] ); $this->current_url = add_query_arg( array( 'page' => $this->page_name, 'ck_post_type' => $this->post_type, - 'step' => 1, + 'step' => 'start', ), admin_url( 'options.php' ) ); @@ -323,12 +323,12 @@ public function load_screen_data( $step ) { // Bail if an error occured. if ( is_wp_error( $result ) ) { // Change the next label and make it a link to reload the screen. - unset( $this->steps[1]['next_button'] ); + unset( $this->steps['start']['next_button'] ); $this->current_url = add_query_arg( array( 'page' => $this->page_name, 'ck_post_type' => $this->post_type, - 'step' => 1, + 'step' => 'start', ), admin_url( 'options.php' ) ); @@ -338,12 +338,12 @@ public function load_screen_data( $step ) { // If no Forms, Products and Tags exist in ConvertKit, change the next button label and make it a link to reload // the screen. if ( ! $this->forms->exist() && ! $this->products->exist() && ! $this->tags->exist() ) { - unset( $this->steps[1]['next_button'] ); + unset( $this->steps['start']['next_button'] ); $this->current_url = add_query_arg( array( 'page' => $this->page_name, 'ck_post_type' => $this->post_type, - 'step' => 1, + 'step' => 'start', ), admin_url( 'options.php' ) ); @@ -367,7 +367,7 @@ public function load_screen_data( $step ) { } break; - case 2: + case 'configuration': // Define Member Content Type. if ( filter_has_var( INPUT_GET, 'type' ) ) { $this->type = filter_input( INPUT_GET, 'type', FILTER_SANITIZE_FULL_SPECIAL_CHARS ); diff --git a/views/backend/setup-wizard/convertkit-restrict-content-setup/content-2.php b/views/backend/setup-wizard/convertkit-restrict-content-setup/content-configuration.php similarity index 100% rename from views/backend/setup-wizard/convertkit-restrict-content-setup/content-2.php rename to views/backend/setup-wizard/convertkit-restrict-content-setup/content-configuration.php diff --git a/views/backend/setup-wizard/convertkit-restrict-content-setup/content-1.php b/views/backend/setup-wizard/convertkit-restrict-content-setup/content-start.php similarity index 100% rename from views/backend/setup-wizard/convertkit-restrict-content-setup/content-1.php rename to views/backend/setup-wizard/convertkit-restrict-content-setup/content-start.php From 4983d3299518c72710edceb78a136912504fc414 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 2 Feb 2026 15:38:40 +0800 Subject: [PATCH 4/7] PHPStan compat. --- admin/class-convertkit-admin-setup-wizard.php | 4 ++-- .../class-convertkit-admin-setup-wizard-landing-page.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/class-convertkit-admin-setup-wizard.php b/admin/class-convertkit-admin-setup-wizard.php index 64868ad8e..40c3d8e7d 100644 --- a/admin/class-convertkit-admin-setup-wizard.php +++ b/admin/class-convertkit-admin-setup-wizard.php @@ -245,7 +245,7 @@ private function process_form() { * * @since 1.9.8.4 * - * @param int $step Current step number. + * @param string $step Current step. */ do_action( 'convertkit_admin_setup_wizard_process_form_' . $this->page_name, $this->step ); @@ -308,7 +308,7 @@ private function load_screen_data() { * * @since 1.9.8.4 * - * @param int $step Current step number. + * @param string $step Current step. */ do_action( 'convertkit_admin_setup_wizard_load_screen_data_' . $this->page_name, $this->step ); diff --git a/admin/setup-wizard/class-convertkit-admin-setup-wizard-landing-page.php b/admin/setup-wizard/class-convertkit-admin-setup-wizard-landing-page.php index 351c2b85f..f2db0c670 100644 --- a/admin/setup-wizard/class-convertkit-admin-setup-wizard-landing-page.php +++ b/admin/setup-wizard/class-convertkit-admin-setup-wizard-landing-page.php @@ -110,7 +110,7 @@ public function __construct() { * * @since 2.5.5 * - * @param int $step Current step. + * @param string $step Current step. */ public function process_form( $step ) { @@ -155,7 +155,7 @@ public function process_form( $step ) { * * @since 2.5.5 * - * @param int $step Current step. + * @param string $step Current step. */ public function load_screen_data( $step ) { From e344d6aedc34b303748785bd5d4862072a209f98 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Mon, 2 Feb 2026 15:45:28 +0800 Subject: [PATCH 5/7] =?UTF-8?q?Setup=20Wizard:=20Reinstate=20=E2=80=98Exit?= =?UTF-8?q?=20Wizard=E2=80=99=20in=20Footer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/backend/setup-wizard/footer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/backend/setup-wizard/footer.php b/views/backend/setup-wizard/footer.php index 6ac5eafb9..1858a76ac 100644 --- a/views/backend/setup-wizard/footer.php +++ b/views/backend/setup-wizard/footer.php @@ -50,7 +50,7 @@ step < count( $this->steps ) && ! $this->is_modal() ) { + if ( $this->get_current_step_number() < $this->get_total_steps() && ! $this->is_modal() ) { ?>