-
Notifications
You must be signed in to change notification settings - Fork 54
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
#481
Comments
I tried testing how Create Block Theme plugin works in Playground. https://playground.wordpress.net/?plugin=create-block-theme Unfortunately, most of the features seem to fail due to errors... 😅 Many of Create Block Theme's functions update files and directories, so they might not be compatible with Playground at the moment. |
Thanks for testing this out! Could you explain more about which features failed? I think many of the theme creation tools work fine in Playground (creating a new theme, cloning the current theme, creating a blank theme), but I don't think adding custom fonts from both Google and local files works yet. Maybe we could disable these if the plugin is active in a Playground environment (I'm not sure how easy this would be!) |
Sorry, there may have been a problem with the environment or network when I tested it. Many features seem to work correctly.
ff61197017314bf824a816cb25c3e740.mp4 |
No worries!
Yes, this is the same error I was seeing. I thought this was solved with WordPress/wordpress-playground#724, but perhaps this is a different error. It seems to be a problem with accessing the |
From what I've researched, this problem seems to have a similar cause to WordPress/wordpress-playground#396 reported in the Playground repository. The Create Block Theme plugin attempts to download the font via the
My understanding is that the To resolve this, we would add the following hook to this plugin to force function custom_http_request_host_is_external( $external, $host ) {
if ( 'fonts.gstatic.com' === $host ) {
return true;
}
return $external;
}
add_filter( 'http_request_host_is_external', 'custom_http_request_host_is_external', 10, 2 ); Pinging @adamziel: I see that you have submitted WordPress/wordpress-playground#400 to fundamentally resolve this issue. Is it okay to add a filter like this for now to make the Create Block Theme plugin work properly in the plugin preview environment? 🙇 |
For network features you'll need to enable the networking access by adding With that option in place, I was able to interact with Google Fonts in the Playground preview. You can also use it in the Blueprints as follows: {
"features": {
"networking": true
}
} Let me know if that solves the issue here. |
@adamziel Thank you for telling me that! I had missed that parameter. After some more testing, I'd like to submit a PR to add a blueprint to this plugin. |
We should consider adding a
blueprint.json
file to enable plugin previews on the WordPress.org directory.More info here: https://make.wordpress.org/meta/2023/11/22/plugin-directory-preview-button-revisited/
The text was updated successfully, but these errors were encountered: