Skip to content

[Website] Skip WordPress installation when WordPress files already exist - #3065

Merged
adamziel merged 1 commit into
trunkfrom
avoid-running-wp-installer-if-not-needed
Dec 18, 2025
Merged

adamziel merged 1 commit into
trunkfrom
avoid-running-wp-installer-if-not-needed

Conversation

@adamziel

@adamziel adamziel commented Dec 18, 2025 •

Copy link
Copy Markdown
Collaborator

Summary

Without this PR https://playground.wordpress.net/ always runs the WordPress installer even when running a mini fight site that's already pre-installed and shipped to the SQLite database. This adds around 600 milliseconds to every playground boot on a beefy MacBook Pro.

With this PR, that WordPress installer request is skipped when possible. How? It sets the wordpressInstallMode to install-from-existing-files-if-needed that makes the installer optional.

Test plan

  • Load a saved Playground site and verify it still boots correctly
  • Create a new Playground and verify WordPress installs as expected
  • Observe faster boot times when loading existing sites

When loading a saved site, there's no need to run the WordPress installer because the files are already in place. This change uses the 'install-from-existing-files-if-needed' mode which checks if WordPress is installed before making the installer request. This saves around 600ms during boot on a MacBook Pro.
@adamziel adamziel changed the title Skip WordPress installation when WordPress files already exist [Website] Skip WordPress installation when WordPress files already exist Dec 18, 2025
.then((r) => r.blob())
.then((b) => new File([b], 'wp.zip'))
: undefined,
wordPressZip: wordPressRequest

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

wordPressRequest is undefined when !shouldInstallWordPress

wordPressZip: wordPressRequest
?.then((r) => r.blob())
.then((b) => new File([b], 'wp.zip')),
sqliteIntegrationPluginZip: sqliteIntegrationRequest

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

sqliteIntegrationRequest is always set.

@adamziel
adamziel merged commit 9042c02 into trunk Dec 18, 2025
33 checks passed
@adamziel
adamziel deleted the avoid-running-wp-installer-if-not-needed branch December 18, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant