#35439 closed defect (bug) (fixed)
Prevent (re-)loading of textdomain if already loaded
Reported by: | jrf | Owned by: | ocean90 |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Plugins | Keywords: | has-patch |
Focuses: | performance | Cc: |
Description
On the plugins admin page, the _get_plugin_data_markup_translate()
function attempts to load the localization files for all the plugins listed which have a Textdomain header to try and retrieve the localized descriptions and such.
However (active) plugins will often already have loaded their textdomain from within their own code flow, resulting in lots of extraneous file reads which can be avoided.
Just to demonstrate some stats for a test environment I'm running - take note of the Number of attempts made to load a translation:
Data obtained using the new Debug Bar Localization panel plugin.
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
Even though
is_textdomain_loaded()
has some issues, see #35442, I'm fine with the change.WP_Theme
is doing the same already and I haven't heard of any issues.