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 blueprint.json file to enable plugin previews #511

Merged
merged 1 commit into from
Mar 27, 2024
Merged

Add blueprint.json file to enable plugin previews #511

merged 1 commit into from
Mar 27, 2024

Conversation

t-hamano
Copy link
Contributor

This PR adds a blueprint to enable the preview button in the plugin directory.

The behavior based on this definition should exactly match the URL below.

https://playground.wordpress.net/?plugin=create-block-theme&url=/wp-admin/admin.php?page=create-block-theme&networking=yes

There is currently no easy way to test this blueprint in advance, but the preview button is only visible to plugin committers. Therefore, if there is a problem, it will not affect users and can be fixed with follow-up.

I am not a committer of this plugin, so if this PR is merged, I would appreciate it if you could test whether the preview actually works.

@vcanales
Copy link
Member

vcanales commented Feb 6, 2024

Thanks for this. I'd like to merge it and test it, but I haven't been able to find docs on the .wordpress-org directory we'd be adding the blueprint to; could you point me to that?

@vcanales vcanales added the enhancement New feature or request label Feb 6, 2024
@t-hamano
Copy link
Contributor Author

t-hamano commented Feb 6, 2024

You can check it here.

https://make.wordpress.org/meta/2023/11/22/plugin-directory-preview-button-revisited/

Also, I forgot to link the issue that this PR closes. This PR will solve #481.

@pbking pbking linked an issue Mar 8, 2024 that may be closed by this pull request
@vpelss
Copy link

vpelss commented Mar 18, 2024

My plugin works in the playground. No errors.
https://playground.wordpress.net/?blueprint-url=https%3A%2F%2Fwordpress.org%2Fplugins%2Fwp-json%2Fplugins%2Fv1%2Fplugin%2Femogics-tarot-reader-for-wp%2Fblueprint.json%3Furl_hash%3Dfb28acaf87a14fb5e03352ab343d5800

The generate blueprint.json when added to my 'assets' folder does not enable a 'Enable Live Preview'. It states "Note: Missing or invalid blueprint.json file."

https://wordpress.org/plugins/emogics-tarot-reader-for-wp/advanced/

Is this feature working? I believe I have followed all the steps.

@t-hamano
Copy link
Contributor Author

@vpelss You need to commit the blueprint.json file inside assets/blueprints/, not inside the assets/ directory.

@vpelss
Copy link

vpelss commented Mar 19, 2024

@vpelss You need to commit the blueprint.json file inside assets/blueprints/, not inside the assets/ directory.

Many many thanks!

I don't know how many times I read that page. Not once did I notice the subfolder.
Now I just feel embarased..

Copy link
Contributor

@pbking pbking left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you

@pbking pbking merged commit 0693307 into WordPress:trunk Mar 27, 2024
1 check passed
@t-hamano t-hamano deleted the add-playground branch March 27, 2024 14:25
@t-hamano
Copy link
Contributor Author

Thank you for merging! I would appreciate it if you could confirm that the preview actually works as expected. I don't have commit permission for the Create Block Theme plugin, so I can't see the preview button 😅

@vcanales
Copy link
Member

vcanales commented Apr 9, 2024

@t-hamano we've released 2.0, and can now confirm that the preview button works as expected. Thanks!

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

Successfully merging this pull request may close these issues.

Add blueprint.json file to enable plugin previews
4 participants