Opened 15 months ago
Last modified 15 months ago
#60194 new feature request
Add Preview in Playground buttons to plugin install screens
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.5 |
Component: | Plugins | Keywords: | has-patch dev-feedback needs-design-feedback |
Focuses: | Cc: |
Description
Proposal: add Preview buttons to plugin install screens within wp-admin.
Background:
The WordPress.org Plugin Directory now supports a Live Preview feature based on Playground; see https://meta.trac.wordpress.org/ticket/7251 for context.
You can see an example working on the https://wordpress.org/plugins/convert-to-blocks/ plugin. Previews are currently only enabled on plugins where the developer has opted in and provided a blueprint.json file (which provides setup and configuration info).
The preview button on the web site works simply by redirecting from https://wordpress.org/plugins/PLUGIN-SLUG/?preview=1
to a playground.wordpress.net
URL which loads the plugin's blueprint file. It opens the playground URL in a new window using target="_blank"
.
I'm proposing that we do essentially the same thing from within wp-admin, on screens with an Install button for plugins: add a Preview button, which opens https://wordpress.org/plugins/PLUGIN-SLUG/?preview=1
in a new window.
The wordpress.org plugins API already returns a preview_link
property containing the appropriate URL for plugins with a working preview.
I'll attach a diff with a minimal implementation; this is intended as a starting point for testing and discussion, not a finished patch in its current state.
Initial draft patch for discussion and review