Slides from my WordCamp Talk: Put A Map On It!

These are the slides for my talk at WordCamp Montreal 2015, about integrating maps and geolocation into your WordPress site with the Geo Mashup plugin. There should be video eventually and I’ll add it here :)

Full talk description

WordPress has built-in support for storing location information on posts, but no real way to make use of it. The Geo Mashup plugin enables deep, powerful geolocation in WordPress, letting you easily add geolocations (coordinates) to almost any content type. It also displays locations on maps you can embed in your theme, posts or widgets, with a dizzying array of options for what to show and how to display it.

This talk will start with the default geolocation system in WordPress and how Geo Mashup integrates with it. We’ll then cover the basics of setup and adding locations on posts, then the different map types and situations where you’d use them. We’ll finish with some dev considerations for displaying maps as elegantly as possible.

Video of my DRY CSS talk

It’s not exactly a thrill ride, coming in at 51 minutes, but here’s the full audio+slides video of my presentation about DRY CSS, my “simple yet powerful CSS architecture that avoids duplication and increases design consistency by grouping shared properties together rather than redefining them over and over”. Sorry there’s not footage of my pretty face, I recorded this using Screen Capture in QuickTime and Voice Memos on my iPhone (using the earbud mic).

For the impatient, you can also go through just the slides on slideshare.

DRY CSS – Slides from my ConFoo 2012 talk

Here’s the video with slides+audio of talk in case you prefer that. It’s 51min

This is an idea/talk that has literally been years in the making. Ever since I used this “DRY CSS” system for the Global Voices redesign I’ve been meaning to do the background research and lay it all out clearly like this. To me the core principle is so simple and standards-based that I have trouble believing it’s not already a thing, but I can’t find anyone else promoting it so here you go:

Embed should be above, here’s a direct link to the slideshare page: DRY CSS – A don’t-repeat-yourself methodology for creating efficient, unified and Scalable stylesheets »

Or if you prefer you can download the slides as a PDF »

Let me know what you think! Am I crazy? Why aren’t we already doing it this way?

Multilingual content in WordPress, September 2010

Someone emailed me recently to ask about how they should approach the task of setting up a multi-lingual WordPress site (en+fr). My response was long enough that I figured I’d post it here for anyone curious about my thoughts.

We’re looking to update our WordPress website with a multi-language setup […] Would you recommend that we use a multi-lingual plugin, such as WPML, or just create two different wordpress sites?  I’d rather do the former, since once setup it demands much less updating.  I’ve heard in the past that this is very difficult to do, but now with WP 3.0, I’m thinking it must be much easier.  I’d much appreciate your opinion.

Multi-lingual in 3.0

The advent of 3.0 has changed many things but not the frustrating lack of support for multilingualism in WP. The same issues exist now as did in the 2.x days. The main relevant change in 3.0 is that WPMU, a seperate project which let you have multiple sites in one installation, is now part of the main WordPress code. The feature is now referred to as “Multi-site” or “Network” and is fairly easy to activate. This means if you decide to use separate sites it is a bit simpler to have both sites running off the same WP install and sharing themes/plugins. Just set up your main site as and the French one as

Plugins can be abandoned

While its true that two sites requires more tedious repetitive work during updates it less likely to involve insane compatibility work that could arise from the plugin acting up or becomming unsupported. Users of the previously-standard Gengo plugin all got fucked around version 2.5 (don’t feel like looking up the exact version) when the plugin stopped working and none of them could update their sites, leaving them susceptible to hackers. An unpatched version of WP is often vulnerable to attack and a site that depends on a plugin that stops working can’t be patched. is probably your best bet for a plugin

WPML seems like it has serious and dedicated professional developers, and has a LOT of features that are very useful, so its a decent bet that as a translation system it will continue working for a long time. Especially if you don’t have a ton of content it is a pretty good choice (because you can always copy/paste the content into a second site some day if the plugin stops working). Using it will require some heavy modifications to your theme if you want the language chooser etc. to actually make sense. My experience with WPML has lead me to believe that the devs aren’t particularly great UI designers compared to their programming skills.

Multiple sites keeps your posts database clean and logical

I personally like the two-site approach because it keeps your content and databases clean as a tradeoff for the deeper linkage between translations you could otherwise get from a plugin. It’s extra hassle to edit the content on both sites all the time but IMHO the bigger hassle is actually translating and keeping content fully synchronized which is nearly impossible regardless of your translation infrastructure.

On Global Voices we have a custom solution we call Lingua

I don’t have any real experience with WPML or qTranslate (the other big name in WP translation) because on Global Voices (the site I run) I’ve coded a custom translation plugin that we call Lingua. It uses separate sites but keeps a database that links translations across the sites (see for an example of the output). IMHO this is the best model for running translations because if the plugin stops working all you lose is the links to other versions. Each translation site can continue to work independently without knowledge of the others, so you can work on the update issues seperately while still being secure. Unfortunately the plugin isn’t even close to being public-friendly, but I’m hoping the model gets used someday. I added it to the list of potential plugin types on the Codex page about multilingual WordPress.

Maybe one day it will be easy

Good luck to anyone trying to build multi-lingual WordPress sites. It’s a nightmare but none of the other CMS options are actually much easier, and all the other benefits of  WP make it hard to turn down. Here’s hoping that one day the core development team is willing to pick up the problem and commit to a standardized solution (vote for built-in multilingualism on the WordPress “Ideas forum”).

EDIT (Sep 11, 2010): I should also mention the Worldwide Lexicon project and their WWL translation plugin for WordPress. It has an intense approach that combines machine translation with human editing to make your site quickly translated and let you improve it incrementally as time goes on. I haven’t used their plugin myself because older dev versions I tried were very buggy and hard to understand. If you’re just starting now the new versions are worth a try and may be a good solution if the combination of machine and human translation is desirable to you.

Global Voices Does Miami

GV Logo on the beach in Miami

Photo taken by Amira

I’m about to leave Sunny Miami Florida to return to frigid Montreal and am feeling particularly blessed to get to work and sometimes hang out with such wonderful people.

The WeMedia conference invited us and kindly sponsored some of our costs, but the real treasure has been sharing a house, food, drinks and stories with my coworkers. I’ve gushed about it in the past but its worth repeating: I couldn’t possibly do better in life than to have these people around me. That I get paid to spend time with them is a little miracle.

Shout outs to Eddie, Lova, Georgia, Solana, Jillian, Lokman, Rebekah, Ivan, Amira and Leonard. I fuckin’ love you guys.

Global Voices does Valentines: Teach someone to blog!

Back when there weren’t a lot of easy ways to start blogging elegantly I’d give blogs to any of my friends who showed interest, setting up Movable Type/WordPress/Blogger for them and working out simple templates I thought they’d like. Some of them are still up and going ( Mira, Woo! Room206, Speaks the Gimp, Tom Makes Pictures, A Collection of Works, The Creative Act, St-Francis Jigger, ) while others were abandoned a long time ago in favor of social networking or other hobbies (Brian, Princess Camp and Poison Frogs, Girl Riot, No, You’re a Blogger Geek, Lyss). Just making that list took me so long, I don’t think I ever added it all up like that before.

Anyway, these days I usually just point people at, since they have great themes, the best software around and an easy way to take it to the next level.

So what’s left to do? The other half of giving someone a blog: Showing them how to use it!

Global Voices Valentines Teach someone to blog or microblog

Global Voices’ core mission, aside from reporting on what’s happening in blogs all over the world, is to get more blogs and bloggers going whenever possible. Writing is good for you, it helps you clarify your thoughts and hone your writing, and it also helps people find you and keep up with you online.

GV is having a drive to get people to teach someone else how much fun blogging can be, or alternately blogging’s little cousin, microblogging (which means services like Twitter or similar to “status” on facebook but with more power and more fun. btw I’m almost always @jeremyclarke).

I signed the pledge to write about it and teach someone, but as the above list implies, my life is already pretty saturated with people I’ve taught to blog, so if you live in Montreal and want to learn how to blog (or want some advice about it too I guess) drop me a line and I can help you out sometime.

If you have someone in your life with problems getting their message out (or a business to promote, or any other problem that could be solved if they had a TV channel) then consider taking some time to show them how blogging could improve their life <3

Lingua flexes its muscles.

On the site I work on, Global Voices we call our translation project Lingua. It is mostly composed of volunteers who love our mission so much they want to make sure people can read it in languages other than English (the default for Global Voices at this point, hopefully to change going forward).

Each translator chooses which posts they want to translate (we have too many in English for the other languages to translate everything) so usually we get 2 or 3 of the dozen or so active languages that translate any given post, and we show links at the top of the post to the translations (a mix of showing off and making it easy for people who’s first language isn’t English to find more convenient versions).

This is something wonderful for me to see: One post that the whole Lingua community got together and translated, resulting in a ridiculously long list that shows the truly amazing variety of letterforms, if nothing else, that Global Voices is printed in.

screenshot of language listing on a post that was translated into every lingua language

We use the ISO codes for languages (like wikipedia, i.e. but in case you’re curious, the post is available in: French, Chinese Traditional, Chinese Simplified, Macedonian, German, Malagasy, Bangla, Swahili, Albanian, Spanish, Italian, Dutch, Russian, Serbian, Portuguese, Arabic, Polish, Indonesian, Japanese and Farsi.

That’s a mouthfull. I love my job.

Okay I lied: We are whores for cuteness

Donate to Global Voices - Help us spread the word

When the Global Voices community saw the baby joke (pictured in the last post) they loved it so much they demanded a lolcat-based campaign and the above was born.

Just to keep it classy we also have a more subdued badge:

Donate to Global Voices - Help us spread the word

Donation page, All badges.

Keeping your server alive with Monit

NOTE: This is super web/development/sysadmin stuff, casual non website people should probably check this instead

Lately GV has been pretty out of control and our server has been crashing way to regularly due to too many visitors or bots. I’ve been working to find all the little holes in the Apache/PHP/MySQL configurations that are causing the crashes when load gets high, but it’s impossible while you’re constantly putting out fires and restarting the servers manually.

monit logoI’ve been having frustrating fun with a tool called Monit that helps stop your server from completely crashing by watching it’s system stats and selectively restarting processes or executing whatever command you want. It installs pretty easily on Linux servers (I think it’s in both Yum for CentOS/RH and in apt for Debian/Ubuntu) and it uses text files similar to Apache to set up different status conditions and what to do. The configuration took me awhile to get right, but once the percentages were tuned based on watching it for awhile it has kept the server from crashing even once for more than a minute despite some record traffic related to our Mumbai coverage. If it weren’t for Monit I’d probably still be getting calls in the middle of the night saying the site was down.

You still need to find the bugs in your server configuration, or move to more powerful hardware (what we’re doing), but even if its annoying that the apache needs to be restarted every few minutes in order to not crash the server, its better than having it crash randomly when you’re not around. While you’re still tuning the system, you can have it email you based on certain conditions, so you can see how often a certain status is reached and determine whether a restart is necessary. The manual explains the functions pretty well and isn’t too long.

My advice if you’re setting it up

Setting the reset/exec levels

If you’re setting it up for the first time and you’re not having any problems at the moment you should be careful not to set the percentages too high, or the server might crash before it got that bad. I was giving a Memory/RAM max around 80%, but the remaining 20% didn’t seem to be enough to save the server, it was already to late. Here are my settings for our Apache webserver:

check system
if loadavg (1min) > 5 for 2 cycles then exec "/etc/init.d/httpd restart"
if loadavg (1min) > 7 for 1 cycles then exec "/etc/init.d/httpd restart"
if memory usage > 65% for 3 cycles then exec "/etc/init.d/httpd restart"
if memory usage > 75% then exec "/etc/init.d/httpd restart"

The ‘exec’ action is running the apache restart command directly, which will clear out all appache processes and restart them, freeing up RAM temporarily. I’m also running two levels of Load checking, which will measure the strain on the CPU. Together these cover a lot of situations that result in crashes, and there are two versions of each, one for bad situations that have gone on for awhile (“for 3 cycles” i.e. 3 minutes) and one for terrible situations that are seen even once (“for 1 cycles”, which is actually unnecessary to write).

You can actually also set up monitoring of specific processes like Apache or other servers, but its been a lot buggier (thinks the program’s not running when it is) for me than the raw server statistics, so use at your own risk.

Alternate Email Formatting for Monit

The default email format template that comes with Monit is pretty hard to read to the point where it’s kind of maddening to recieve messages from it. Luckily they offer a custom mail formatting api so you can make one that makes sense for you. The pieces they give you are a bit limiting but I worked out one that is very short and clear and should even work okay as an sms:

set mail-format {
subject: [$ACTION] $EVENT on $SERVICE
– – – – – – – – – – – – – – – – – –
Action: [$ACTION] at $DATE from $HOST


Which sends you emails like:

[exec] Resource limit matched for
‘’ mem usage of 71.9% matches resource limit [mem usage>65.0%]
– – – – – – – – – – – – – – – – – –
Action: [exec] at Fri, 28 Nov 2008 19:35:22 -0500 from


Which I think is a lot better than the default. Any Monit users out there with a good format I’d love to see what else you’ve come up with.