Make WordPress Core

Opened 6 months ago

Last modified 6 months ago

#60194 new feature request

Add Preview in Playground buttons to plugin install screens

Reported by: tellyworth's profile tellyworth 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.

Attachments (3)

admin-plugin-preview.0.diff (2.2 KB) - added by tellyworth 6 months ago.
Initial draft patch for discussion and review
Screenshot 2024-01-12 at 5.00.47 pm.png (134.8 KB) - added by tellyworth 6 months ago.
Here's what the button looks like in the plugin search/card view.
Screenshot 2024-01-12 at 5.01.01 pm.png (199.8 KB) - added by tellyworth 6 months ago.
And here's what the button looks like on the plugin detail view (bottom left).

Download all attachments as: .zip

Change History (4)

@tellyworth
6 months ago

Initial draft patch for discussion and review

@tellyworth
6 months ago

Here's what the button looks like in the plugin search/card view.

@tellyworth
6 months ago

And here's what the button looks like on the plugin detail view (bottom left).

#1 @tellyworth
6 months ago

  • Keywords has-patch dev-feedback needs-design-feedback added

I added two screenshots showing the current state of the UI - it's basic and needs some feedback from design as to whether or not it's acceptable.

Note: See TracTickets for help on using tickets.