[wp-trac] [WordPress Trac] #39210: switch_to_locale() unloads all plugin and theme translations

WordPress Trac noreply at wordpress.org
Thu Oct 20 08:19:27 UTC 2022


#39210: switch_to_locale() unloads all plugin and theme translations
-------------------------------------------------+-------------------------
 Reporter:  gchtr                                |       Owner:  ocean90
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.1
Component:  I18N                                 |     Version:  4.7
 Severity:  normal                               |  Resolution:
 Keywords:  has-unit-tests has-patch needs-dev-  |     Focuses:
  note                                           |
-------------------------------------------------+-------------------------

Comment (by spacedmonkey):

 I have provided some screenshots of useful data. As you can see, removing
 this commit from code, as a massive performance boost and fixes the
 issues. My test site, using 2016 theme with a full home page, no
 translations, plugins or other config and single site.

 The issue, is every time a translated string is loaded, it does a call to
 `is_readable`. In this theme with lots of data, it is 900+ times on a
 single page load. If you had more posts per page, then more the page slows
 down.

 Unless this is an extremely simple fix, this commit should be reverted and
 put into another release. That could be 6.1.1 but it might have to wait
 until 6.2. I don't think the performance trade off is worth the
 translations benefits here.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/39210#comment:68>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list