diff --git a/build/3.1.0/onboarding-design-studio.asset.php b/build/3.1.0/onboarding-design-studio.asset.php index da7dde607..356415d12 100644 --- a/build/3.1.0/onboarding-design-studio.asset.php +++ b/build/3.1.0/onboarding-design-studio.asset.php @@ -1 +1,4 @@ - array('react-jsx-runtime', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-components', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-preferences', 'wp-primitives'), 'version' => '9cb31ccae1cdbcf503b0'); + array( 'react-jsx-runtime', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-components', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-preferences', 'wp-primitives' ), + 'version' => '9cb31ccae1cdbcf503b0', +); diff --git a/build/3.1.0/onboarding-restart-button.asset.php b/build/3.1.0/onboarding-restart-button.asset.php index 74570fd14..d162ad035 100644 --- a/build/3.1.0/onboarding-restart-button.asset.php +++ b/build/3.1.0/onboarding-restart-button.asset.php @@ -1 +1,4 @@ - array(), 'version' => 'd409f6c052e3b64374b3'); + array(), + 'version' => 'd409f6c052e3b64374b3', +); diff --git a/build/3.1.0/sitegen-theme-marker.asset.php b/build/3.1.0/sitegen-theme-marker.asset.php index 3eb3105b3..02857bc1f 100644 --- a/build/3.1.0/sitegen-theme-marker.asset.php +++ b/build/3.1.0/sitegen-theme-marker.asset.php @@ -1 +1,4 @@ - array(), 'version' => '857c9b1be7fae2d05356'); + array(), + 'version' => '857c9b1be7fae2d05356', +); diff --git a/includes/LoginRedirect.php b/includes/LoginRedirect.php index a9b2f994b..8fab93936 100644 --- a/includes/LoginRedirect.php +++ b/includes/LoginRedirect.php @@ -61,7 +61,7 @@ public static function filter_redirect( $original_redirect, $user ) { if ( '0' === $redirect_option ) { return $original_redirect; } elseif ( '1' === $redirect_option ) { - return admin_url( '/index.php?page=' . WP_Admin::$slug ); + return apply_filters( 'nfd_build_url', admin_url( '/index.php?page=' . WP_Admin::$slug ) ); } // Don't redirect to onboarding if onboarding was exited or completed. @@ -81,7 +81,7 @@ public static function filter_redirect( $original_redirect, $user ) { } // Redirect to onboarding - return admin_url( '/index.php?page=' . WP_Admin::$slug ); + return apply_filters( 'nfd_build_url', admin_url( '/index.php?page=' . WP_Admin::$slug ) ); } /** diff --git a/includes/WP_Admin.php b/includes/WP_Admin.php index 4e077ffd7..ecaafe522 100644 --- a/includes/WP_Admin.php +++ b/includes/WP_Admin.php @@ -211,7 +211,7 @@ public static function render() { echo PHP_EOL; echo ''; echo PHP_EOL; - echo '
' . self::is_loading() . '
'; + echo '
' . self::is_loading() . '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo PHP_EOL; echo ''; echo PHP_EOL; @@ -246,14 +246,14 @@ public static function register_assets() { NFD_ONBOARDING_DIR . '/languages' ); - $nfdOnboardingData = array( + $nfd_onboarding_data = array( 'runtime' => Data::runtime(), 'input' => ReduxStateService::get( 'input' ), 'sitegen' => ReduxStateService::get( 'sitegen' ), ); \wp_add_inline_script( self::$slug, - 'var nfdOnboarding =' . wp_json_encode( $nfdOnboardingData ) . ';', + 'var nfdOnboarding =' . wp_json_encode( $nfd_onboarding_data ) . ';', 'before' ); @@ -331,12 +331,12 @@ public static function exit_to_dashboard(): bool { // If the brand plugin page URL is not found in the runtime, redirect to the WordPress admin. if ( empty( $brand_plugin_url ) ) { - wp_redirect( admin_url() . '?' . $dashboard_redirect_params ); + wp_redirect( apply_filters( 'nfd_build_url', admin_url() . '?' . $dashboard_redirect_params ) ); exit; } // If the brand plugin page URL is found in the runtime, redirect to the brand plugin page. - wp_redirect( $brand_plugin_url . '&' . $dashboard_redirect_params ); + wp_redirect( apply_filters( 'nfd_build_url', $brand_plugin_url . '&' . $dashboard_redirect_params ) ); exit; } @@ -455,7 +455,7 @@ public static function can_restart_onboarding(): void { 'var nfdOnboardingRestartMeta =' . wp_json_encode( array( 'buttonText' => \__( 'Build with AI', 'wp-module-onboarding' ), - 'buttonHref' => \admin_url( 'index.php?page=' . self::$slug ), + 'buttonHref' => \apply_filters( 'nfd_build_url', admin_url( 'index.php?page=' . self::$slug ) ), ) ) . ';', 'before' @@ -504,7 +504,7 @@ public static function hide_onboarding_restart_card(): void { \wp_enqueue_style( 'hide-onboarding-restart-card' ); } - /* + /** Enqueue site editor specific assets when coming from onboarding. * * @return void diff --git a/src/app/data/store/slices/runtime.js b/src/app/data/store/slices/runtime.js index 3b8b6e69b..56d190140 100644 --- a/src/app/data/store/slices/runtime.js +++ b/src/app/data/store/slices/runtime.js @@ -93,7 +93,7 @@ export const selectors = { const migrationUrl = addQueryArgs( migrationInfo?.defaultLink, migrationInfo?.queryParams ) + ( migrationInfo?.fragment || '' ); - return migrationUrl; + return window?.NewfoldRuntime?.linkTracker?.addUtmParams( migrationUrl ) || migrationUrl; }, /** diff --git a/src/app/steps/Migration/MigrationStep.js b/src/app/steps/Migration/MigrationStep.js index cb77edf81..677e11ecc 100644 --- a/src/app/steps/Migration/MigrationStep.js +++ b/src/app/steps/Migration/MigrationStep.js @@ -25,6 +25,7 @@ const MigrationStep = () => { /** * Track migration initiated event + * * @param { string } instaWpMigrationUrl The migration url * @return { Promise } */ @@ -70,7 +71,7 @@ const MigrationStep = () => { await trackMigrationInitiatedEvent( migrateUrl ); // Open migration url (external) - window.open( migrateUrl, '_self' ); + window.open( window?.NewfoldRuntime?.linkTracker?.addUtmParams( migrateUrl ) || migrateUrl, '_self' ); } else { throw new Error( 'Failed to fetch migration url' ); }