wp-cli / extension-command

Manages plugins and themes, including installs, activations, and updates.
MIT License
90 stars 79 forks source link

Uninstalling a plugin does not remove plugin language files #337

Closed jennydupuy closed 2 years ago

jennydupuy commented 2 years ago

Hey,

I have an installation of WP in french fr_FR. I use wp-cli to install a plugin, for example duplicator. I type wp plugin install duplicator then wp language plugin install duplicator fr_FR

Then I uninstall duplicator by command wp plugin uninstall duplicator

I see in the wp-content/languages/plugins/ the files duplicator-fr_FR.mo and duplicator-fr_FR.po. So I want delete them and I use : wp language plugin uninstall duplicator fr_FR but wp-cli respond: Warning: The 'fr_FR' language is active.

So I must activate an another language to uninstall the language files fr_FR: wp site switch-language en_US and type wp language plugin uninstall duplicator fr_FR Success: Language uninstalled

If I delete a plugin in the dashboard screen plugins, the language files of plugin are also deleted, even if the en_FR language is still enabled. Why the wp-cli command wp plugin uninstall don’t make the same?

Thanks

danielbachhuber commented 2 years ago

Thanks for the report, @jennydupuy !

I've confirmed the bug:

We should remove the language files too, to follow core behavior.