Skip to content

Conversation

@dkotter
Copy link
Collaborator

@dkotter dkotter commented Dec 11, 2023

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.json file that configures how the preview should load. This PR adds in that file that does the following:

  1. Sets up an environment running PHP 7.4 (our supported minimum) and the latest version of WordPress
  2. Logs into the admin
  3. Installs and activates the Ad Refresh Control plugin
  4. Sends the user to the Ads Refresh Control settings page

Note that this PR is targeted to trunk as the hope is we can take advantage of our Plugin Asset Update Action to deploy these changes without having to push out a new release. This new blueprint file needs to live within the assets directory in the svn repo, which is the same directory that Action will send changes to.

Also 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/options-general.php?page=ad-refresh-control-settings%22,%22preferredVersions%22:{%22php%22:%227.4%22,%22wp%22:%22latest%22},%22phpExtensionBundles%22:[%22kitchen-sink%22],%22steps%22:[{%22step%22:%22login%22,%22username%22:%22admin%22,%22password%22:%22password%22},{%22step%22:%22installPlugin%22,%22pluginZipFile%22:{%22resource%22:%22wordpress.org/plugins%22,%22slug%22:%22ad-refresh-control%22},%22options%22:{%22activate%22:true}}]}

Changelog Entry

Added - Support for the WordPress.org plugin preview

Credits

Props @dkotter

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@dkotter dkotter self-assigned this Dec 11, 2023
@dkotter dkotter requested a review from jeffpaul as a code owner December 11, 2023 22:30
@dkotter dkotter changed the base branch from develop to trunk December 11, 2023 22:30
@jeffpaul jeffpaul added this to the 1.2.0 milestone Dec 11, 2023
Copy link
Member

@jeffpaul jeffpaul left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for helping test this out!

@dkotter dkotter merged commit 23411b8 into trunk Dec 12, 2023
@dkotter dkotter deleted the feature/plugin-preview branch December 12, 2023 21:42
@dkotter dkotter modified the milestones: 1.2.0, 1.1.5 Aug 19, 2024
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.

2 participants