Fix the WordPress.org plugin preview #143
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
In #116 we added support for the WordPress.org plugin preview. As noted, testing that now results in an error.
Digging in I found two issues:
importFile
step but that has been removed in favor ofimportWxr
Both of these issues have been fixed in this PR.
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/#{"$schema":"https://playground.wordpress.net/blueprint-schema.json","landingPage":"/wp-admin/post.php?post=4&action=edit","preferredVersions":{"php":"7.4","wp":"latest"},"phpExtensionBundles":["kitchen-sink"],"steps":[{"step":"login","username":"admin","password":"password"},{"step":"installPlugin","pluginZipFile":{"resource":"wordpress.org/plugins","slug":"retro-winamp-block"},"options":{"activate":true}},{"step":"importWxr","file":{"resource":"url","url":"https://raw.githubusercontent.com/10up/retro-winamp-block/d2ff63d1127713d9f2a11235a002f38f2927b0ca/.wordpress-org/blueprints/demo-data.xml"}}]}
Ensure that clicking that link loads a proper preview environment with the plugin installed and demo content loaded
Changelog Entry
Credits
Props @dkotter, @jeffpaul
Checklist: