MemcacheD is your friend

MemcacheD Is Your Friend is an object caching plugin for WordPress that offers faster access to cached objects, especially if your database happens to reside on a different host. The problem this time around is that it scopes some of its members as private, and as a result, is incompatible with some plugins. I’ve run into this before when trying to import data into WordPress.

This time, I was trying to get Elasticpress working on a site where the Memcached object cache was already set up. Thankfully, someone on a Github support thread helpfully pointed to a fork they made of the long-neglected Memcached Is Your Friend plugin. I haven’t had a chance to try it yet but wanted at least a placeholder here to it in case it comes up again.

Moving Evernote notes into WordPress

proprietary insecurity

I’ve accumulated many notes (2000+) in Evernote over the years, and love that it can store binary attachments such as images or other media files. My favorite feature is the Evernote Web Clipper browser extension; it does a fantastic job at saving the parts of an article I want to save while keeping the styling intact.

Evernote has a free plan which I’ve enjoyed for a long time, but recently the financial status of the company has come into question, and they restricted syncing to only two devices. Also, the last thing I want to happen is another kind of Google Reader shutdown fiasco. I doubt that a shutdown would make my existing notes disappear, but it’s better to be prepared ahead of time. To that extent, I’ve been looking for a viable option to migrate my notes into another platform. Continue reading “Moving Evernote notes into WordPress”

WordPress performance problem with many posts

If you have a ton of posts in your WordPress blog (we have over 35K in one site at work), it turns out that the Previous and Next links on each post may be running a tough query on your database.

I wanted to know why MySQL was using so much CPU and wrongly assumed it was due to a bad tuning effort (it usually is). I googled “SELECT p.ID FROM wp_posts AS p INNER JOIN wp_term_relationships AS tr ON p.ID = tr.object_id INNER JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id” which was in my output of MySQL’s show full processlist command. It led me to this StackExchange page which showed an alternative, more efficient version of the WP function calls that produce those previous and next links.

In our case, we just didn’t need those links and our theme let us turn them off from the admin. An instant and dramatic drop in CPU by MySQL ensued.

Scripted WordPress Upgrades

This command line interface for administering WordPress is called wp-cli. It’s pretty great.

I wrote a script to run from cron for updating a bunch of different WP installs in the same directory.

enabled SSL/TLS on devolve

Big thanks to StartSSL for getting me set up with a signed certificate. Their FAQ on configuring with openssl and nginx worked like a charm. I even got a handy email from them after I thought I was done, telling me that I needed to concatenate the certificate they gave me with a sub cert and root cert for the chain of trust to work properly.

Honestly, the hardest part was making WordPress work properly and to update links to avoid browser warnings. I got most of the way there by using the search and replace plugin – one needs to be very careful with that tool, however. For example, post GUIDs should never change, even if changing the hostname that WP is running on.