,

|

Playground is changing the way I work with WordPress

If you haven’t tried Playground yet, head on over to playground.wordpress.net.

At first, it might not seem that impressive. The link above takes you to a WordPress demo site where you can click around and do typical WordPress things.

But the catch is that Playground is running entirely in your browser. I won’t get into the wizardry that makes all this possible; you can learn more here and here.

I want to focus on what Playground can do for plugin and theme developers. In a matter of seconds. For free.

You might know that I run several WordPress plugins, Block Visibility being the most complex. You really have to try the plugin to appreciate how it works, but demo sites are annoying to set up and maintain. At least, that was my experience, but no longer now that Playground exists.

All I did was create a blueprint.json file and place it in the plugin’s GitHub repository so it’s publicly accessible. The file looks like this:

{
	"landingPage": "/wp-admin/plugins.php",
	"features": {
		"networking": true
	},
	"steps": [
		{
			"step": "installPlugin",
			"pluginZipFile": {
				"resource": "wordpress.org/plugins",
				"slug": "block-visibility"
			},
			"options": {
				"activate": true
			}
		},
		{
			"step": "login",
			"username": "admin",
			"password": "password"
		}
	]
}

You can then run Playground using this blueprint to launch WordPress pre-installed with Block Visibility. Easy as that.

Here’s the format you need for the URL: playground.wordpress.net/?blueprint-url=[path-to-blueprint-file].

This just scratches the surface of what Playground can do, so check out the documentation for more. Huge props to Adam Zieliński for bringing Playground into the world, and expect big things in 2024.

Responses

  1. Sam Brockway Avatar
    Sam Brockway

    This is wonderful, Nick!

    Thanks for highlighting this very valuable use case for WP Playground.

    What about tracking analytics?

    1. Nick Diego Avatar
      Nick Diego

      There is no way to track Analytics that I am aware of, other than tracking clicks on the original link. I’ll take the tradeoff for simplicity. 😅

      You can also add demo content via an .XML file, which I am going to explore later.

      1. Sam Brockway Avatar
        Sam Brockway

        Very interesting! Do you have your link tracked? 👀

        1. Nick Diego Avatar
          Nick Diego

          No. Since Block Visibility is entirely free and open source, I am not that concerned about metrics. But you could if you wanted to.

  2. Oliver Avatar
    Oliver

    Thanks Nick for all your great work. I always watch your videos, they are great.

    One thing I wish most is to get native control in the image block over lazyloading, as it should not be used above the fold. Hope this will come in 6.5.

    1. Nick Diego Avatar
      Nick Diego

      Thanks Oliver!

      Regarding the Image block, I encourage you to open an issue on GitHub if there is not one already, here’s the link: https://github.com/WordPress/gutenberg/issues/new/choose

      If you do, just cc me (@ndiego) and I’ll make sure the issue gets the correct labels and such.

      1. Oliver Avatar
        Oliver

        Thanks you Nick. I did…

Latest articles