siteorigin-panels icon indicating copy to clipboard operation
siteorigin-panels copied to clipboard

Add a Blueprint for WP.org Live Preview

Open brandonpayton opened this issue 1 year ago • 4 comments

This PR adds a Blueprint file so that SiteOrigin's Page Builder plugin can have a Live Preview button in the WP.org plugin repo. The Live Preview will load your plugin in the WordPress Playground web app using the provided Blueprint.

According to the WP.org docs:

There are two things required for a plugin preview button to appear to all users:

  1. A valid blueprint.json file must be provided in a blueprints sub-directory of the plugin’s assets folder.
  2. The plugin preview must be set to “public” from the plugin’s Advanced view by a committer.

Once those conditions are met, a Live Preview button should appear next to the Download button in the WordPress.org plugin repo, like:

image

Try this link for an example of the preview.

I work on the WordPress Playground project and have started creating some PRs to propose Live Preview for various plugins. If you have any feedback related to Playground or Live Previews, I would love to hear it.

brandonpayton avatar Dec 12 '24 04:12 brandonpayton

Note: This Blueprint installs the Vantage theme for use with the plugin. That can be removed or changed if desired.

brandonpayton avatar Dec 12 '24 04:12 brandonpayton

It looks like I was mistaken about where to place the blueprint.json file. I believe it belongs under the top-level assets directory for the plugin, under assets/blueprints and not under trunk/assets/blueprints.

Perhaps this should have been an issue with an example blueprint.json instead of a PR.

brandonpayton avatar Dec 12 '24 18:12 brandonpayton

Hi Brandon! Thanks for submitting this. We had seen the previews and wondered how it worked but just didn't get a chance to look into it yet. So we really appreciate you setting this up.

Regarding where to put the blueprint.json file, I had a look at Simple Page Ordering (as that has the button) and it's present in the assets directory, not trunk. We may still end up merging this in a . dot directory (likely .assets) just so it's versioned still. We'll look more into the Blueprint options though before proceeding.

Thanks again for submitting this!

AlexGStapleton avatar Dec 13 '24 02:12 AlexGStapleton

That's great! In case it helps, here is a reference for the Blueprint data format: https://wordpress.github.io/wordpress-playground/blueprints/data-format

brandonpayton avatar Dec 18 '24 18:12 brandonpayton

Thanks again for submitting this @brandonpayton. :)

AlexGStapleton avatar Aug 30 '25 13:08 AlexGStapleton

@AlexGStapleton, nice! Thank you for fixing this up and merging. :)

brandonpayton avatar Sep 04 '25 17:09 brandonpayton