WordPress / wordpress-playground

Run WordPress in the browser via WebAssembly PHP
https://w.org/playground/
GNU General Public License v2.0
1.58k stars 223 forks source link

Inconsistent capitalization of plugin and theme names during boot up #1487

Open ironprogrammer opened 1 month ago

ironprogrammer commented 1 month ago

When a Playground instance is spinning up, theme and plugin names displayed may have inconsistent or incorrect capitalization. for example:

"Woocommerce" should be "WooCommerce"

Downloading Woocommerce

"Wordpress importer" should be "WordPress Importer"

Activating Wordpress importer
dd32 commented 1 month 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.

dd32 commented 3 weeks ago

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.

bgrgicak commented 5 days ago

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