Jetpack and WPML Do not Play Well Together

There are some nagging Jetpack WPML issues, really. Been using Jetpack for many things, but stats and auto posting to social media are one of my favorites. For translating and managing my bilingual site I have been using WPML. The best one of its kind. Unfortunately the two do not work well together.  This in the field of displaying statistics and the translation of Jetpack elements anyways.

Allow me to briefly introduce the two plugins and then get to the issues at hand.

Jetpack

Jetpack is a great free plugin created by Automattic and used at WordPress.com where it is integrated and on WordPress.org sites with the help of a plugin. You can upgrade to a paid version to add additional features like Akismet anti-spam plus and things like backups, but the free version does take care of most of the needs I and my clients have.

Jetpack

It is great for:

  • checking for site uptime,
  • automattic posting to social media,
  • basic statistics using Jetpack
  • protection against brute force attacks
  • collecting subscriptions

to name a few of the free features.

One of my favorites, Jetpack Stats, is a great way to have a snapshot overview of how your WordPress site is doing. Not too bloated.

Jetpack Stats by day

Just a clean way to see what pages and posts have been visited, how many unique visitors and views, where the visitors are from, what referral links were used. Just the basics.

WPML

WPML

WPML is a state of the art language management tool for WordPress sites. It allows you to manage bilingual or multilingual sites with ease. Whether you work alone or with a team, it is an outstanding tool to translate content, create multilingual content and manage it all from one location using multiple domain names, subdomains or a separate directory for the secondary language(s). Here features as listed by them:

  • It’s complete – With WPML you can translate pages, posts, custom types, taxonomy, menus and even the theme’s texts.
  • It’s compatible – Every theme or plugin that uses WordPress API runs multilingual with WPML.
  • It’s dependable – We provide full support for WPML, helping you deliver perfect websites on time.

Jetpack Stats issues with WMPL

The issue I have been having is that every time I post a blog in Dutch Jetpack does not show it under insights though it does show as a square under posting activity. Therefore I cannot see how blog posts posted in Dutch fair once they have been published. As no ticket for this specific issues seems to have been filed except for not showing all post in secondary languages at Jetpack Stats I added a new one here.

Jetpack Subscription Translation Issues

Other issue, reported at WPML way back, is that Jetpack Subscriptions does not get translated well. The ticket is quite old now and has not been attended to. It is still not possible to translate the translation widget for display in other languages using WPML.

This is really the reason why I decided to write this blog posts on Jetpack and WPML. Seems the folks at WPML are really busy so perhaps keeping tabs on these issues here will help speed things up. Great products, Jetpack and WPML, so would love them to play well together again. Comments are welcome!

WPML – Two Languages – Two Domains – One CMS

Some of you may know that Imagewize Webdesign, run by me, is a site that runs on two languages from two different domains – Dutch and English. This is done using the nifty plugin WPML. With it you can manage your content in multiple languages. You can also run all content from one location and still serve it on separate (sub) domains! To make this work you do need to set things up properly in the backend and server wise. Here is how.

WPML – Intro

WPML is the best multilingual Content Management Plugin out there for WordPress. I do use qTranslate X, but it simply cannot compete with the options WPML offers and certainly cannot offer the stability WPML has to offer. qTranslate has gone through several reincarnations over the past couple of years and has been buggy at times. WPML works well out of the box, deals with:

  • permalinks,
  • string translations,
  • menu translation management,
  • theme translation management,
  • language switcher
  • media translation

It does it all and no extra plugins are needed. Nice!

Now let’s get back to the cool feature of WPML – Two Languages – Two Domains – One CMS

Server Side

On the Apache webserver – NGinx not covered – you need to make sure that all traffic going to the domain that is not running the content is redirected to the main domain location or vhost. This can be done using a ServerAlias. WPML Example here below:

<VirtualHost *>
  DocumentRoot /your_wp_install_directory/wordpress
  ServerName www.english-domain.com
  ServerAlias www.french-domain.fr

  ... your other stuff here ...
</VirtualHost>

So for Imagewize we needed:

<VirtualHost xxx.xxx.xxx.xx:80>
ServerAdmin webmaster@imagewize.nl
DocumentRoot /home/wp_zzsk4g/imagewize.com
ServerName www.imagewize.nl
ServerAlias imagewize.nl

As you see Dreamhost added the ip address and port. Inside that vHost the DocumentRoot was added with a ServerName and ServerAlias imagewize.nl to redirect all traffic from that domain to imagewize.com.

The basic Domain name mirroring that is supposed to work as a ServerAlias with Dreamhost just did not do the trick. I assume it was only adding a ServerAlias and not a DocumentRoot to load data from one location. But I am glad Dreamhost helped me out in the end and set this up on my Dreamhost Managed VPS!

Client side

Client side you need to configure WPML – dashboard > WPML > languages > language url format – to load the content of the main language from domain a and for the secondary language from domain b.

WPML - Two Languages - Two Domains - One CMS

WPML will validate the domains added to make sure they are correct and all works.

Any question, comments? Please let me know in the comments!

 

Update

Dreamhost VPS no longer allows adjusting httpd.conf or adding vhosts – no sudo access anymore. The mirroring of the domain nor the chaning the DocumentRoot to make imagewize.nl load data from imagewize.com for WordPress with WPML worked as a new solution. So I had to use the second language in a subdirectory and redirect the second domain traffic there using a redirect in the .htaccess:

<IfModule mod_rewrite.c> 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^imagewize.nl$ [OR]
#RewriteCond %{HTTP_HOST} ^imagewize.com.com$
RewriteRule (.*)$ https://wpvilla.in/nl/$1 [R=301,L]
</IfModule>

The only other solution would be to move to a dedicated or cloud environment. Looking into these options, but will stick to this VPS for now though I have issues with spikes in RAM due to scripts I am running every now and then for security and backups.