wordpress-playground icon indicating copy to clipboard operation
wordpress-playground copied to clipboard

Docs: Guide "WordPress Playground for Plugin Developers"

Open juanmaguitar opened this issue 1 year ago • 8 comments

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.

Screenshot 2024-07-31 at 15 52 32

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

juanmaguitar avatar Jul 31 '24 16:07 juanmaguitar

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).

richtabor avatar Jul 31 '24 18:07 richtabor

The Blueprint Gallery has a few blueprints that should be beneficial for above scenarios:

bph avatar Aug 01 '24 07:08 bph

Here's a Playground-based plugin development workflow:

https://github.com/user-attachments/assets/2ee61579-1366-4681-8518-700eaf6f0519

adamziel avatar Aug 01 '24 07:08 adamziel

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

adamziel avatar Aug 01 '24 08:08 adamziel

Pull Request previews and GitHub proxy are also likely of interest here.

adamziel avatar Aug 01 '24 08:08 adamziel

@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.

adamziel avatar Aug 01 '24 12:08 adamziel

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.

Screenshot 2024-08-09 at 11 28 24

juanmaguitar avatar Aug 09 '24 10:08 juanmaguitar

@juanmaguitar Chrome may be the only browser that supports it today. I know Brave is Chrome based, but I think you need Chrome specifically.

adamziel avatar Aug 09 '24 13:08 adamziel

Closing this issue as per https://github.com/WordPress/wordpress-playground/pull/1747 and https://github.com/WordPress/wordpress-playground/pull/1750

juanmaguitar avatar Sep 12 '24 10:09 juanmaguitar