• Hi,
    I’m trying to speed up a copy of WordPress that runs locally on an old (Celeron 2GHz, 600MB RAM) but otherwise idle “server”. With polylang disabled, the main html is loaded in about 0.5 sec, while with polylang enabled the time is 1.2 sec.

    I tried some profiling with xdebug and found that a lot of time is spent by function load_textdomain(). A bit of googling showed that it basically loads the translations for various messages that WordPress might generate.

    I’m using WordPress as a sort of mini CMS with blog functionality reduced to posting news. The comments and other blog-like features are disabled, so it does not really need to say to the site visitors things like “please log in” or “your comment was added” or whatever. Just show a page or a post. So, I went to polylang/include/core.php line 325 and commented it out
    # load_textdomain( $textdomain[‘domain’], str_replace($this->default_locale, $new_locale, $textdomain[‘mo’]));

    The load time shrank to 0.6 seconds. The only things that broke (that I noticed) were the strings from Settings-Languages-Strings translation, like the site title. Everything else seems to work as before.

    Do I miss anything? Will it break some internal logic if I leave that line commented out? Is it needed at least for the dashboard?

    Thanks.

    https://www.ads-software.com/extend/plugins/polylang/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Polylang] load_textdomain performance’ is closed to new replies.