Docs: Guide "WordPress Playground for Plugin Developers"
As part of https://github.com/WordPress/wordpress-playground/pull/1602 there are plans to create a guides section where specific guides to tackle specific needs can be added to the docs.
I think a "WordPress Playground for Plugins Developers" guide could be a good candidate. These are some of the initial ideas that I think could be included as guidance for plugin developers to leverage WordPress Playground for their work.
Playground for Plugin Developers
- You can launch a WP Playground instance with any plugin on the WordPress Plugins Directory URL
- Example: https://playground.wordpress.net/?plugin=gutenberg
- You can launch a WP Playground instance with any plugin on a zip
- Example: https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/WordPress/block-development-examples/trunk/plugins/post-meta-modal-2502fb/_playground/blueprint.json
see blueprint.json
{
"landingPage": "/wp-admin/post.php?post=1&action=edit",
"steps": [
{
"step": "installPlugin",
"pluginZipFile": {
"resource": "url",
"url": "https://raw.githubusercontent.com/WordPress/block-development-examples/deploy/zips/post-meta-modal-2502fb.zip"
}
},
{
"step": "login",
"username": "admin",
"password": "password"
}
]
}
- You can launch a WP Playground instance with any plugin code on a gist
- Example: https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/WordPress/block-development-examples/trunk/plugins/post-meta-modal-2502fb/_playground/blueprint.json
Which key ideas should be reflected in this guide for Plugin Developers? cc: @richtabor @ndiego @justintadlock @bph @ryanwelcher
Some ideas/scenarios:
- if my plugin has dependencies on other plugins.
- if I have a plugin settings view or onboarding wizard I want to auto-redirect to.
- if I have plugin options I want to configure ahead of time (like license keys/unlocking a "pro" demo).
The Blueprint Gallery has a few blueprints that should be beneficial for above scenarios:
- If a Plugin dev needs a CPT to show off some features
- Most plugins also need additional content: -- Blueprint example to add posts via a wp-cli command. -- Use wp-cli to create a post from text file with block markup and a featured image
- The tutorial from the Developer Hours: Creating WordPress Playground Blueprints for Testing and Demos that could be useful for plugin developers: https://github.com/wptrainingteam/hellodashboard
Here's a Playground-based plugin development workflow:
https://github.com/user-attachments/assets/2ee61579-1366-4681-8518-700eaf6f0519
Also the current Blueprints builder might be useful to mention until we have a block-based one:
https://github.com/user-attachments/assets/f549d37d-2619-421c-9c76-258fccac6fe7
Pull Request previews and GitHub proxy are also likely of interest here.
@akirk built Blueprint building UI that makes building plugin previews easy. It would be great to showcase that, maybe have a video, and showcase how to put together a simple plugin preview.
Here's a Playground-based plugin development workflow:
@adamziel, is this option currently enabled (or is it working)? I have tried this option in Brave (Chrome), Firefox, and Safari and this option is always disabled.
@juanmaguitar Chrome may be the only browser that supports it today. I know Brave is Chrome based, but I think you need Chrome specifically.
Closing this issue as per https://github.com/WordPress/wordpress-playground/pull/1747 and https://github.com/WordPress/wordpress-playground/pull/1750