Progress on Multilingual WP

Over the last two weeks I didn’t had the chance to actually spend a lot of time working on the plugin, BUT I’m proud to say that 2 very big things happened over those two weeks:

1. Started using the plugin for a big corporate website

At the company I currently work at, we got the task to convert an ASP.NET site to a WordPress site. The site is in two languages and has quite some content – well it probably has around 70 pages in each language and a big load of files as well, but that’s still more than the average website. Since I’ve decided to stay away from qTranslate when it comes to big multilingual websites, I decided to get my plugin for a spin and see if can handle such a website and it’s needs.

While working on the website a bunch of small issues showed up and I was able to resolve them right on the spot. In general I didn’t come across anything serious, which makes me more confident in the (hopefully)upcoming launch of the plugin to the general public

I also stumbled upon a different issue with multilingual websites – sometimes not every page is available in each language. Sometimes you want to display certain content just for specific language/s. Take the following example:

You have a university and on your website you’ve published information about it – including your address, contacts, etc. You’ve also created a page in your native language about the programs/discounts that local students can take advantage of – that is certainly information that is not suitable for foreign exchange students and they don’t need to be bothered to see it on your website. On the other hand you also have a section in foreign languages explaining what you can offer to exchange students – something that the local students won’t benefit from. So you only want to display those pages to their expected audience.

I tweaked here and there and in the end I came up with a custom-tailored solution that involved a simple meta panel displayed on every page/post/etc with a list of check boxes with all enabled languages. When you check a certain language, this page suddenly becomes unavailable for that language – it’s removed from menus, search results, even if you try to open the exact URL it will still display a 404 error. I’m even thinking of adding this functionality as an option to the plugin(it would be disabled by default), but it would probably need some more work.

2. The first website using Multilingual WP has gone live

Well, ok – it’s the second one of which I know, but I’m not counting themoonwatch.com

This is the website for a team that will participate in the Red Bull X-Alps this year. You can check-out their website here – X-Alps – BasqueTeam. The guy who worked on the website is one of the team members – Iñigo Arizaga. He initially contacted me with a couple of bugs regarding the plugin and then kept on doing that as he was finding various small issues while developing the site. He was of great help to me and I really appreciate it I wish them good luck, favourable wind and meteorological conditions and most importantly to enjoy the event!

 

That being said – if anyone else has successfully launched their website using Multilingual WP to make it multilingual – please feel free to drop a link in the comments and let me(and everyone else) know about it.

Migrating to Multilingual WP

After a long time of working on the code of the multilingual plugin, I finally dared to test the plugin in a live environment – my own site!

The migration wasn’t as smooth as I wished it to be, but that was expected – I fixed a bunch of issues that I hadn’t noticed until then. So far the plugin’s development is moving on very well and hopefully I’ll really be able to release it soon(I’m not coming up with a date for when that would happen, simply because things can change a lot in just a week or so).

After adding support for the excellent Google XML Sitemaps plugin(which was the main thing stopping me from trying the plugin on my site) and making the Taxonomy support better I decided to finally upload the plugin to my website and see what happens.

If you decide to do that, please, PLEASE, make a back-up of your database – in my case I didn’t had to use it, but it’s good to have one just in case something goes terribly wrong.

I activated the plugin, configured the desired languages and went through the migration of my posts(which for just two languages turned out to be extremely fast). The migration worked flawlessly and I ended up with both of my languages in the new interface(migrated from qTranslate) – for both posts and pages, and categories and tags.

I decided to use the feature of the plugin, where I can set custom slugs for each taxonomy(besides the custom slugs for each category/tag). It worked sort-of-okay, and I had to fix some bugs with it. The only concern one might have when using this feature on an already set-up site is that old links will break and you’ll have to use a plugin that redirects the broken URL’s to the correct ones. I used the 404 Redirected plugin for that – it’s a bit clumsy and is lacking Regex support, but I only have a handful of links that I need to fix anyway, so it was fine.

In the case of more URL’s, it’d probably be smarter to use a plugin like Redirection – I personally didn’t like it a lot, because it didn’t had the option of disabling automatic redirection to the home page on 404’s, but it does have support for Regex rules, which would make it much more easier to fix more of the broken links with less entries.

Other than that – the language switcher doesn’t come with built-in styling, so as you can see in my sidebar at the moment the text is not properly aligned with the flags – I don’t consider that an important issue, so I’m putting it off for a bit now – I’ll probably find some time one of these days to do that as well.

One more thing I was going to forget – statistics(of sorts) of the plugin’s performance compared to qTranslate – to be honest, most of the numbers are not that low, compared to qTranslate, but my small website wasn’t causing a lot of trouble for qTranslate anyway. I did 2 scans with qTranslate on and 2 scans with Multilingual WP on – one manual and one automatic for each.

I’m posting the results from just the automatic scans, since they seemed to have “caught” and timed more pages than my manual scans(I think the plugin doesn’t always work correctly).

With qTranslate enabled:

WordPress Plugin Profile Report
===========================================
Report date: June 6, 2013
Theme name: Moon Watch
Pages browsed: 3
Avg. load time: 1.8621 sec
Number of plugins: 19
Plugin impact: 82.56% of load time
Avg. plugin time: 1.5373 sec
Avg. core time: 0.1272 sec
Avg. theme time: 0.0281 sec
Avg. mem usage: 137.17 MB
Avg. ticks: 158,059
Avg. db queries : 52.67
Margin of error : 0.1695 sec

Plugin list:
===========================================
P3 (Plugin Performance Profiler) – 0.0017 sec – 0.11%
qTranslate Separate Comments – 0.0451 sec – 2.93%
qTranslate – 0.8806 sec – 57.28%
Other(13 plugins) – 0.6097 sec – 39.68%

Plugin impact with qTranslate

 

With Multilingual WP enabled:

WordPress Plugin Profile Report
===========================================
Report date: June 6, 2013
Theme name: Moon Watch
Pages browsed: 5
Avg. load time: 0.7518 sec
Number of plugins: 18
Plugin impact: 79.91% of load time
Avg. plugin time: 0.6008 sec
Avg. core time: 0.1270 sec
Avg. theme time: 0.0129 sec
Avg. mem usage: 58.95 MB
Avg. ticks: 14,781
Avg. db queries : 82.60
Margin of error : 0.0111 sec

Plugin list:
===========================================
P3 (Plugin Performance Profiler) – 0.0023 sec – 0.38%
Multilingual Wp – 0.1557 sec – 25.92%
Other(16 plugins) – 0.4426 sec – 73.7%

Plugin impact with Multilingual WP

 

These results are pretty rough – since for more consistent results those tests should’ve been done more and for more pages, but I think some of the information they give is pretty obvious and hard to argue with.

I used the P3 (Plugin Performance Profiler) plugin – I really think it’s an awesome tool – I’m not sure how accurate it its, but it does seem pretty good

 

Well, that’s all for now – feel free to try the beta version of the plugin, by downloading it from GitHub, and wish me luck with releasing the plugin publicly soon!