Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WP.org plugin demo #667

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add WP.org plugin demo #667

wants to merge 4 commits into from

Conversation

kasparsd
Copy link
Collaborator

What?

Add support for WP.org playground feature.

Why?

Fixes #661.

How?

  1. Add blueprints/blueprint.json to the assets directory which is synced with WP.org SVN /assets.
  2. Add npm run blueprint helper script to generate the blueprint URL for testing.

Testing Instructions

  1. Clone this pull request.
  2. Run npm run blueprint and visit the generated URL.

Or simply visit: https://playground.wordpress.net/#%7B%22$schema%22:%22https://playground.wordpress.net/blueprint-schema.json%22,%22landingPage%22:%22/wp-admin/profile.php%22,%22preferredVersions%22:%7B%22php%22:%227.4%22,%22wp%22:%22latest%22%7D,%22steps%22:%5B%7B%22step%22:%22login%22%7D,%7B%22step%22:%22installPlugin%22,%22pluginData%22:%7B%22resource%22:%22wordpress.org/plugins%22,%22slug%22:%22two-factor%22%7D,%22options%22:%7B%22activate%22:true%7D%7D%5D%7D

Screenshots or screencast

The demo currently doesn't work (reported here in WP Slack):

broken-demo

Changelog Entry

Added support for plugin demo on WordPress.org.

"step": "login"
},
{
"step": "installPlugin",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WP.org might be doing this out of the box but we keep it here to ensure we can test it without deploying changes to WP.org.

@jeffpaul jeffpaul added this to the 0.13.0 milestone Feb 14, 2025
@jeffpaul
Copy link
Member

I'd recommend adding a repo badge in the readme.md file (like is done in https://github.com/10up/simple-page-ordering/blob/7e3a05394f5c557c6d35d626a3096e975dc8958d/README.md?plain=1#L5) as that allows folks in GH to also launch the playground demo.

Eg something like

WordPress Playground Demo

@kasparsd
Copy link
Collaborator Author

That's a great idea @jeffpaul! Let's do that.

Do you have ways to help with debugging the playground issue (see screenshot in the description)? Without the plugin active (or with any other plugin such as WooCommerce) the user profile renders fine so it must be something with the plugin.

@jeffpaul
Copy link
Member

Just pushed some tweaks, but while it's not crashing I'm still not seeing the correct page load. Will keep testing to see what's off here.

},
{
"step": "installPlugin",
"pluginData": {
"resource": "wordpress.org/plugins",
"pluginZipFile": {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeffpaul The documentation on the site is old. The latest schema can be seen here https://playground.wordpress.net/blueprint-schema.json

For example, the pluginZipFile is deprecated:

schema

VS Code should be able to autocomplete and suggest the field values per https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for WP.org playground (plugin demo)
2 participants