create-block-theme icon indicating copy to clipboard operation
create-block-theme copied to clipboard

Add blueprint.json file to enable plugin previews

Open t-hamano opened this issue 1 year ago • 2 comments

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.

t-hamano avatar Jan 30 '24 12:01 t-hamano

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 avatar Feb 06 '24 11:02 vcanales

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.

t-hamano avatar Feb 06 '24 14:02 t-hamano

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.

vpelss avatar Mar 18 '24 20:03 vpelss

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

t-hamano avatar Mar 19 '24 03:03 t-hamano

@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..

vpelss avatar Mar 19 '24 04:03 vpelss

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 😅

t-hamano avatar Mar 27 '24 14:03 t-hamano

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

vcanales avatar Apr 09 '24 15:04 vcanales