You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is an extract from the WP gettext documentation first comment:
This filter is ideally avoided as the performance aspect can be huge. If you do need it, be aware with a common suite of plugins installed this can easily run thousands of times on one page! WooCommerce and similar make everything translatable.
It’s far improved to check the domain right away and return the translation instantly if it’s not the domain you’re wanting to translate. This minimises the overhead, rather than some of these examples that are running str_replace(), is_single() etc over and over unnecessarily which adds up due to the sheer quantity of times this code will run.
/src/ui/class-classic-editor.php line 71:
\add_filter( 'gettext', [ $this, 'change_republish_strings_classic_editor' ], 10, 2 );
In our local environment, this filter alone is called 10471 times, and is causing 507ms of wall time.
The text was updated successfully, but these errors were encountered: