Add support for the WordPress.org plugin preview - #297
Conversation
Readme.txt updates.
|
@dkotter @iamdharmesh I wonder if its worth trying to create test/demo credentials so folks don't have to run through that setup step in the plugin and jump right into seeing some sample posts & tweeting/posting to X/Twitter? |
This would be the ideal for a demo (I considered the same thing for our Apple Maps Block plugin). My main concern I came to was how do we prevent someone from taking those credentials and misusing them, since they would be easy to find if we're going to use those in our blueprint file? Or is that something that even needs to be cared about? |
|
Yeah, I thought perhaps if WP Playground could take a secret somehow as input but as @dkotter @iamdharmesh mentioned elsewhere that could still be exported from the DB in the browser session so probably best to have folks enter their own credentials to test the plugin. |
|
Yeah, didn't fully test myself but getting the same error. Seems the Playground environment doesn't yet support curl: WordPress/wordpress-playground#85 As such, probably not worth deploying this change yet as you can't actually fully test things until this gets resolved upstream |
|
@iamdharmesh @jeffpaul This was waiting on WordPress/wordpress-playground#85 (comment) to be finished and sounds like that is now the case. Tested this again and I am able to successfully get past the connection step though didn't test beyond that. |
|
Looks like the settings page renders as I would expect. @iamdharmesh as you get to OSS time, mind confirming that valid X credentials work in the Playground environment before we merge this and enable the Live Preview on WPORG? |
|
Given we've struggled with this for so long, I'm inclined to close it out and just accept we won't have a Live Preview for this plugin. Any concerns @dkotter @iamdharmesh with that? |
Honestly I'd be okay with just releasing this as-is. It doesn't work completely but it does provide a limited preview. But I'd also be okay with just closing this out as well if we decide that is better |
|
I am also okay with releasing this as-is. Better to have something than nothing. |


Description of the Change
WordPress.org recently launched support for plugin previews utilizing the WordPress Playground feature. Plugins wanting to take advantage of this need to opt in by setting up a
blueprint.jsonfile that configures how the preview should load. This PR adds in that file that does the following:Note once these changes are on .org, the preview button will need to be enabled in a test state. Once verified as working, we can enable it for all users.
How to test the Change
The WordPress Playground allows you to spin up a new environment directly through the URL, by going to
https://playground.wordpress.net/#and pasting your JSON config after the#. In this case, the URL should be: https://playground.wordpress.net/#{%22$schema%22:%22https://playground.wordpress.net/blueprint-schema.json%22,%22landingPage%22:%22/wp-admin/admin.php?page=autoshare-for-twitter%22,%22preferredVersions%22:{%22php%22:%227.4%22,%22wp%22:%22latest%22},%22steps%22:[{%22step%22:%22login%22},{%22step%22:%22installPlugin%22,%22pluginData%22:{%22resource%22:%22wordpress.org/plugins%22,%22slug%22:%22autoshare-for-twitter%22},%22options%22:{%22activate%22:true}}]}Changelog Entry
Credits
Props @dkotter
Checklist: