[Personal-WP] Improve recovery mode and add direct OPFS file browser access #3182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for the change, related issues
When a site crashes due to a broken plugin, recovery mode was failing because WordPress would boot and crash before the recovery blueprint could install the mu-plugins needed to disable the broken plugin. Additionally, when a site is crashed, users couldn't browse or edit files to manually fix issues.
I had this implemented in my https://github.com/akirk/wordpress-playground/ fork but missed to migrate it here.
Implementation details
wordpressInstallMode for recovery: In recovery mode, pass
wordpressInstallMode: 'do-not-attempt-installing'to prevent WordPress from booting before blueprint steps run. This allows the recovery blueprint to install mu-plugins even when a broken plugin would crash WordPress on boot.Direct OPFS file browser access: When PlaygroundClient is unavailable (site crashed), the file browser now falls back to accessing OPFS directly via
OpfsFilesystemBackend. This allows browsing and editing files without needing WordPress to boot.Testing Instructions (or ideally a Blueprint)