Open ironprogrammer opened 5 months ago
This is due to the install step simply sentence-case capitalising the slug that's being installed.
The 'proper' way here would be to make a theme_information / plugin_information API call to fetch the details.
That would correct the examples provided, but for plugins like Jetpack would result in Downloading Jetpack – WP Security, Backup, Speed, & Growth
due to the description-in-title. This would be a better outcome though.
Just to add some context to the above..
The existing code for converting a zip name to the human name is this: https://github.com/WordPress/wordpress-playground/blob/trunk/packages/playground/blueprints/src/lib/utils/zip-name-to-human-name.ts
The existing code doesn't make an API call, and instead downloads directly, IMHO in an attempt for better performance, as the extra API call would add extra steps/latency into the startup procedure.
Given that WordPress plugin slugs are very rarely the same as the plugin name (A good example of this is Yoast SEO, with the historical, wordpress-seo
slug) I tend to agree that something does need to change here.
Thanks, this seems useful and we could prefetch the info from WP.org.
Before we can work on this we need to wrap up the migration of blueprints to PHP, so we can add it there. #1025
When a Playground instance is spinning up, theme and plugin names displayed may have inconsistent or incorrect capitalization. for example:
"Woocommerce" should be "WooCommerce"
"Wordpress importer" should be "WordPress Importer"