Today we released a first beta of a completely new String Translation, which avoids all database calls to translate strings on the front-end and WordPress admin.
The way String Translation in WPML works has changed over the years. Our goal was always to allow you to translate every piece of text on your site and to load the server as little as possible.
In recent years, plugins and themes have grown bigger, using many more translatable strings. A typical admin page which opens a page builder, WooCommerce and several other big plugins could load over 30K strings from the database. This growth in the number of translatable strings has made sites slower with String Translation. WPML allows you to translate everything on the page and when it filters these many strings, the CPU and database get loaded.
Today, we’re ready with a new version that completely changes how String Translation works. This new release does two major changes:
- Only touch strings that you want to translate
- Rely on .mo files to apply translations
The first change means that the String Translation table will not include all texts by all plugins and the theme by default. For the vast majority of the sites, themes and plugins come with their own .mo files with good and complete translations. There’s no need for WPML to filter (and make translatable) all these strings. If you want to override the translation of texts from a plugin, you can still do it. You’ll be able to choose which plugins you want and WPML will register the strings coming from it.
The second big change means that WPML does not call the database for the translation of any string. WPML compiles .mo files for your translations and lets WordPress load them. The size of these .mo files depends on the number of strings that you translate. On most servers, loading a file is significantly faster than loading multiple entries from the database (the DB is the performance bottle neck for many sites).
This version is already running on all our production websites (WPML.org, Toolset.com and ICanLocalize.com). It’s working smoothly and the servers are happy. String Translation was never a significant factor in our sites’ performance, so we’re using other sites for performance analysis.
We received dozens of sites form clients, where String Translation was a lot more significant. On all these sites, we confirm that the server load due to String Translation has practically dropped to zero. These sites now load at about half the time they loaded before (hurrah!).
Current Development Status
This beta is ready for your testing. The only caveat is that it’s not yet working on multisite installations. If you have a single-site (regular) WordPress install and you suspect that you have performance issues due to String Translation, try this beta. We’re going to let this beta run for several weeks and collect client feedback in the meanwhile. We’ll be completing the support for multisite while profiling more client sites.
If you’ve switched to this beta and are still getting significant performance issues related to WPML, we want to see your site. We may find other pockets of performance issues that we need to handle. We want to make sure that by the time this goes into production, nobody has any performance issues related to WPML. Our aim is to release WPML 4.3 for production at the first half of September.
Download and Try
To get this beta, log-in to your WPML account and click on Downloads. At the top-right, change the channel to Beta. You will definitely need to download the first two items – WPML Multilingual CMS and String Translation. If you’re also using Translation Management, download its beta as well.
Remember, this version doesn’t yet work on multisite installations!
It’s OK to use it on development sites and on production sites, but with some caution.
After you try this beta of WPML, we’d love to get your feedback. Please share all the information that you can with us. We want to know when this beta fixes performance issues and about any remaining performance problems that we need to handle.
Leave your comments and we’ll get back to you.
WPML Go to Source
Powered by WPeMatico