Skip to content

Conversation

@katinthehatsite
Copy link
Contributor

Related issues

Fixes STU-1108

Proposed Changes

This PR ensures that when you click on the Publish site button in Studio, it navigates to WP.com and takes you through the purchase flow, then bringing back to Studio. It should behave identical to Create a new WordPress.com site button inside the Sync modal.

Testing Instructions

  • Pull the changes from this branch
  • Start Studio
  • Navigate to the Sync tab
  • Make sure that you don't have any WP.com sites connected to your Studio site so that the Publish site button displays in the top right corner
  • Click on the Publish site button
  • Observe that you are brought to WP.com
  • Complete the purchase
  • Wait for the site to go Atomic
  • Observe that you see a popup asking you to open Studio
  • Confirm that the site you just created is connected in the Sync tab (might be a couple of seconds)

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@katinthehatsite katinthehatsite marked this pull request as draft December 16, 2025 12:40
@katinthehatsite katinthehatsite self-assigned this Dec 16, 2025
@katinthehatsite katinthehatsite changed the title Studio: Make sure that Publish site buttons navigates to WP.com Studio: Make sure that Publish site button navigates to WP.com Dec 16, 2025
@katinthehatsite katinthehatsite requested a review from a team December 16, 2025 12:42
@katinthehatsite katinthehatsite marked this pull request as ready for review December 16, 2025 12:42
@github-actions
Copy link
Contributor

📊 Performance Test Results

Comparing a951b43 vs trunk

site-editor

Metric trunk a951b43 Diff Change
load 9881.00 ms 7766.00 ms -2115.00 ms 🟢 -21.4%

site-startup

Metric trunk a951b43 Diff Change
siteCreation 13280.00 ms 14280.00 ms +1000.00 ms 🔴 7.5%
siteStartup 5974.00 ms 5963.00 ms -11.00 ms 🟢 -0.2%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change

Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @katinthehatsite for improving this! I have tested it, and it works as expected. I am redirected to the creation site flow, and the site is connected to Studio at the end of the process. Changes also LGTM!

After clicking on Publish Site Creating site Site is created Site is connected to Studio
Image Image Image Image

This PR is working as expected and could be merged. However, I would like to point out that the button says Publish site, and that is not actually happening until they click on Push in Studio. So I think we should create some follow-up task to add a clear Notice to the user that the site must be pushed for the local site to be published.

@katinthehatsite
Copy link
Contributor Author

This PR is working as expected and could be merged. However, I would like to point out that the button says Publish site, and that is not actually happening until they click on Push in Studio. So I think we should create some follow-up task to add a clear Notice to the user that the site must be pushed for the local site to be published.

Thanks for the review 👍

@epeicher 100%, we will do the follow up PR as mentioned in Linear to do the following:

In the follow up, we will make the Push to Productionmodal open once the user is redirected back to Studio. Alternatively, we might start the push automatically

@katinthehatsite katinthehatsite merged commit 327e0bd into trunk Dec 17, 2025
10 checks passed
@katinthehatsite katinthehatsite deleted the fix/redirect-publish-to-wpcom branch December 17, 2025 09:38
Copy link
Member

@sejas sejas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing the Publish button to open the browser directly. It works great.
I left a small suggestion to make sure that we call generateCheckoutUrl always with a local site id.

Comment on lines +3 to +5
export function generateCheckoutUrl( selectedSite?: SiteDetails ): string {
const url = new URL(
'https://wordpress.com/setup/new-hosted-site?ref=studio&section=studio-sync&showDomainStep'
Copy link
Member

@sejas sejas Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@katinthehatsite, can we pass the section as a parameter? Currently it's hardcoded to &section=studio-sync, but I would like the Publish site button to have a different section in the URL so we can measure the amount of "clicks" on this button.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will adress these comments in a follow up PR 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adressed in #2283

katinthehatsite added a commit that referenced this pull request Dec 19, 2025
* Misc improvements

* Update section for Publish site button

* Convert parameters to searchParam set

---------

Co-authored-by: Kateryna Kodonenko <kateryna@automattic.com>
Co-authored-by: Antonio Sejas <antonio@sejas.es>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants