Localized WordPress is much slower?

For each translation file, WordPress has to unpack it, then each entry will be converted into an Translation_Entry object.

The short string “caller_get_posts” is deprecated. Use “ignore_sticky_posts” instead. will need three times more memory when it is translated:

  '"caller_get_posts" is deprecated. Use "ignore_sticky_posts" instead.' => 
  Translation_Entry::__set_state(array(
     'is_plural' => false,
     'context' => NULL,
     'singular' => '"caller_get_posts" is deprecated. Use "ignore_sticky_posts" instead.',
     'plural' => NULL,
     'translations' => 
    array (
      0 => '"caller_get_posts" ist veraltet. Bitte nutze stattdessen "ignore_sticky_posts".',
    ),
     'translator_comments' => '',
     'extracted_comments' => '',
     'references' => 
    array (
    ),
     'flags' => 
    array (
    ),
  )),

And that’s the reason why properly written plugins and themes do not load their language file unconditionally. Unfortunately, there are not many properly written plugins and themes …

The WordPress translations are split into an admin and a front end part to reduce the memory impact. It is still a lot.

You can prevent loading of specific language files with an mu-plugin:

add_filter( 'override_load_textdomain', 'stop_language_files', 10, 2 );

function stop_language_files( $bool, $domain )
{
    if ( 'textdomain_you_do_not_want' === $domain )
        return TRUE;

    return $bool;
}

Leave a Comment