Optimizing Global Translator Plugin for WordPress

UPDATE: Version 0.2 released
In the new theme designed for, one of the main goals is to attain maximum speed and shorter page loading times. This post is for people who have the basics of website optimizations. In this post, I’ll discuss a very popular WordPress Plugin, Global Translator, made by, which is used to provide translated version of your blog to visitors. This plugin improved a lot over time, and it gives better and better results after each upgrade. Latest version till date is, which is a stable version.
In the process of optimizing my website, I found out that this plugin consumes a large amount of loading time and keeps pages in a loading state for a long period of time, and it makes many connections busy between the client and the server to download all the flag pictures to the client’s computer. This slows down the page as there’s a limited number of simultaneous connections allowed between the client and the server. On the other side, this increases the ‘account hits’ on shared hosting plans.
To make the plugin and the page load and respond faster, I’ve thought of a solution, which is: instead of the plugin sending multiple small image files, it should send a merged image file containing all the required flag images and generate an image map to build the links.
First of all, I’ll stick to a specific model, which is a single line bar. The functions are easy to understand an you can build any shape you want.
Now I’ve to edit Global Translator’s core to give flag images to the merging script. and then create an image map for the translator bar.
After a lot of tests, I finally figured it out! You can find the code for ‘translator.php’ in the Page.
My modified PHP, will generate a fresh PNG file upon user request and store it in the root directory and then creates an image map to create the links for the translator. The good news is everything remains dynamic and if you change the combination of translations available, the PNG and Image Map will change automatically too!
There are still improvements to be done, for example, forcing the code to create the PNG file in the plugins directory and not the site root! So, if you have any ideas, just let me know!

5 replies on “Optimizing Global Translator Plugin for WordPress”

Unfortunately, anyone who reads a translated version of your blog will think you don’t know how to write. These automatic translation tools can sometimes give you an idea of what the blog is about but they are not able to correctly translate the inherent ideas.

@Janine: I agree with you about the translated versions of the site, and I advised visitors to try to read the articles in their original language (which mainly is English or French for the moment), and visitors should know that translated versions are there only for the sake of giving the general idea of a post to a person who cannot understand any of the main languages. So I’d like to apologize to non-english speaking visitors who find errors in the translated versions. I do not control or write translated versions and they are processed by automatic scripts.

Hello GI, This improvement in Global translator plugin is very good. Now version is released. can you pls update your plugin so i can use it at my site.
Why dont you share it with n2h so it will be shared with all the community
Great improved my site performance a lot when i tested it.

i already use this plugins in my’s very slow generate the pages, i have 1100 pages and 100 pages only translate in one week..anyone have solutions?

Comments are closed.