Skip to content
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

Uninstalling a plugin does not remove plugin language files #337

Closed
jennydupuy opened this issue May 17, 2022 · 1 comment · Fixed by #339
Closed

Uninstalling a plugin does not remove plugin language files #337

jennydupuy opened this issue May 17, 2022 · 1 comment · Fixed by #339

Comments

@jennydupuy
Copy link

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 danielbachhuber transferred this issue from wp-cli/language-command Nov 9, 2022
@danielbachhuber danielbachhuber changed the title Uninstall a plugin not uninstall plugin po/mo files Uninstalling a plugin does not remove plugin language files Nov 9, 2022
@danielbachhuber
Copy link
Member

Thanks for the report, @jennydupuy !

I've confirmed the bug:

  • When a plugin is uninstalled through the web, its language files are removed.
  • When a plugin is uninstalled with WP-CLI, the language files remain.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants