Opened 2 years ago
Last modified 2 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 needs-design-feedback needs-design has-test-info |
| Focuses: | administration | 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 (5)
Change History (13)
#1
@
2 years 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.
This ticket was mentioned in PR #10200 on WordPress/wordpress-develop by @nikunj8866.
3 months ago
#2
Trac ticket: https://core.trac.wordpress.org/ticket/60194
#3
@
3 months ago
- Focuses administration added
- Keywords needs-test-info added; dev-feedback removed
https://github.com/WordPress/wordpress-develop/pull/10200 PR adds a "Live Preview" button to the plugin install screen, allowing users to try plugins in a Playground-based environment before installation.
The button is only displayed when:
- The plugin provides a valid preview_link in its API data.
- The plugin is not already installed.
This enhancement builds upon the WordPress.org Plugin Directory changes that introduced Live Previews (see meta ticket #7251).
Steps to Test
- Go to Plugins → Add New in the WordPress admin dashboard.
- Search for a plugin with a preview available. For example, try searching for "Convert to Blocks".
- Confirm that a "Live Preview" button appears next to "Install Now".
- The button should open the preview in a new browser tab.
This ticket was mentioned in Slack in #core-test by nikunj8866. View the logs.
3 months ago
@rakib03029 commented on PR #10200:
3 months ago
#6
Test Report
Description
This report validates whether the indicated patch works as expected.
Patch tested: https://core.trac.wordpress.org/ticket/60194
Environment
- WordPress: 6.8.3
- PHP: 8.0.30-dev
- Server: PHP.wasm
- Database: WP_SQLite_Driver (Server: 5.5 / Client: 3.40.1)
- Browser: Chrome 141.0.0.0
- OS: macOS
- Theme: Twenty Twenty-Five 1.3
- MU Plugins: None activated
- Plugins:
- Convert to Blocks 1.3.4
- Test Reports 1.2.0
- WordPress Importer 0.9.4
Steps tested
- Navigated to Plugins → Add New
- Searched for Convert to Blocks
- Verified the Live Preview button is displayed
- Clicked the button → redirected to Playground:
- Playground loaded the plugin successfully
- Button did not appear for plugins without a preview link
- After installing, Live Preview button disappeared
Actual Results
- ✅ Issue resolved with patch.
Additional Notes
- Any additional details worth mentioning.
Supplemental Artifacts
Add Inline: [Image([https://www.awesomescreenshot.com/image/57153858?key=4b25c234b928b287820d30c0a429f2a9)]]
@dhruvang21 commented on PR #10200:
2 months ago
#8
@nikunj8866 Tested the PR with wordpress playground and it's working fine
Initial draft patch for discussion and review