Make WordPress Core

Opened 6 weeks ago

Last modified 6 weeks ago

#52817 new defect (bug)

hello dolly does not delete the language file

Reported by: Otshelnik-Fm Owned by:
Milestone: 5.8 Priority: normal
Severity: normal Version: 5.7
Component: Plugins Keywords: needs-patch
Focuses: administration Cc:


When deleting the Hello Dolly plugin (i uninstall the plugin through the plugin uninstall interface), the translation file under the path /wp-content/languages/plugins - is not deleted

— these files remained when we deleted Hello Dolly.

I believe that when you delete a plugin, its files outside the plugin directory should also be deleted.

Change History (1)

#1 @SergeyBiryukov
6 weeks ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 5.8

Thanks for the ticket!

Generally, plugin translations are deleted along with the plugin, see [29856] / #29860.

It looks like Hello Dolly is a bit of an edge case here, as the file name (hello.php) does not match the plugin slug in the directory (hello-dolly). If you delete the plugin, reinstall it from the directory, and delete again, I believe that would delete the translation as well :)

There is an exception for Hello Dolly in _get_plugin_data_markup_translate(), added in [19965] / #19597, to make sure its translation is loaded correctly.

Perhaps another exception is needed in delete_plugins(). Or, maybe somewhere else too, so that the translation would only be downloaded when installing the plugin from the directory, since otherwise a hello-dolly-ru_RU.po file is simply redundant and unused, as the translation for Hello Dolly is already included in WordPress core language files (admin-ru_RU.po in this case).

Just a reminder for anyone following the ticket, that this is not the place to suggest removing Hello Dolly from core, see #11538 for that.

Some other tickets that may (or may not) also be related: #29540, #37351, and #49338.

Note: See TracTickets for help on using tickets.