[wp-trac] [WordPress Trac] #35439: Prevent (re-)loading of textdomain if already loaded

WordPress Trac noreply at wordpress.org
Wed Jan 13 08:09:55 UTC 2016


#35439: Prevent (re-)loading of textdomain if already loaded
--------------------------+-----------------------------
 Reporter:  jrf           |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Plugins       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:  performance   |
--------------------------+-----------------------------
 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'':

 Without the patch:
 [[Image(http://snag.gy/IaPFZ.jpg)]]

 With the patch:
 [[Image(http://snag.gy/XGluW.jpg)]]

 Data obtained using the new [https://wordpress.org/plugins/debug-bar-
 localization/ Debug Bar Localization] panel plugin.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35439>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list