Category Archives: WordPress

Choosing a Web Host for a Project Should be Like Pairing Wine

Think about it– 

You walk into a fancy bistro for dinner. The chef has crafted a wonderful three course meal for his guests this evening. He’s carefully picked ingredients that compliment each other and make three wonderful dishes. Along with those dishes, he’s paired a wonderful wine selection. You eat your meal. It was delicious.

When doing web projects for clients, your role should be similar to that of a chef. It is your responsibility to pick the ingredients (plugins, themes, code) to make the dish (project) come together. But it doesn’t end there, they need a fine wine (hosting) to compliment it.

Looking at things this way gives a good illustration of all the pieces involved to launching a successful web project. Hosting should be paired depending on the scale of project you’re doing. You wouldn’t pair a light white wine with beef entree; the beef would overpower the wine. Likewise, you wouldn’t pair a heavy red wine with a delicate fish entree.

More often than not, I see hosting mis-paired for web projects though. With more and more specialized/niche hosts appearing it’s key to remember everything isn’t one size fits all. A host with a great cache setup might be good for content driven sites where the site is for the most part read-only. That doesn’t really work when you have a lot of moving parts like dealing with sessions (e-commerce) or geolocation.

Knowing how to pair projects with hosting will save you the pain of developing an awesome project for a client then falling flat on your face when rolling it live. I’ve learned those lessons before– the hard way.

WordPress theme for Colloquy

I got bored the other week and created a WordPress styled theme for the Colloquy IRC client. It uses the standard WordPress colors and includes a nice WordPress logo in the background.

There are two variations of it– WordPress, and WordPress Busy. The only difference is that the latter hides events (join, part, nick, etc), which I find very useful for very busy rooms. Hence the name. ;)

Colloquy WordPress Theme

To install download the zip file containing the styles and image, unzip and drag the variants folder into ~/Library/Application Support/Colloquy/Styles/

From there you should be able to activate the style in Colloquy from Style > Standard > WordPress / WordPress Busy

Updated Theme

In sticking with the busy developer mantra of “I’m too busy to update my own site’s theme” I did what I usually do and update to the the latest WordPress default theme. Now featuring TwentyTwelve instead of TwentyEleven.

And hey, I blogged about it! ;)

Restored Archives

I set up my first WordPress site back in 2004 when WordPress was a very immature project. It was a great site and there were some good discussions, but due to some circumstances in 2006, it led me to delete my blog and all my content. It wasn’t necessarilly “deleted”, but taken offline.

About 2 years later, near fall of 2008 I set up my site again. Just to get something going I started from scratch and never imported the content. There were some bad memories with some of the old content. I wanted to move on.

Over the past 6 months or so I had toyed with re-importing the content. I had the backup. The last version I had run with the old site was 2.0.4. Today I decided to pull the trigger and import the old content.

I’ve imported 439 posts into this site. Now I have archives back to 2004. In September it will be 8 years I’ve been using WordPress– since version 1.2. It truly is an awesome publishing platform.

Mr WordPress On Your Bed

A friend pinged me on IM today and sent me a chunk of latin that was filler in a word document. It’s uhh… interesting when you run it through Google Translate.

Original latin:

Suspendisse bibendum magna sit amet lectus molestie faucibus. Sed semper blandit tortor. Etiam cursus.

English Translation:

Mr WordPress on your bed is great here. But you are always more. An accident.

Removing Standard Image Sizes from WordPress

I ran across an issue today where I needed to specify which image sizes were generated within WordPress. I didn’t need the stock sizes (thumbnail, medium, large) but I did need a few custom sizes. Adding custom sizes is the easy part but removing others threw me for a loop.

The quick and dirty solution would be to set the sizes in Settings > Media to 0 so that nothing would be generated. While this works on a single site, its not the best solution for something that would be deployed on multiple sites. After all, who wants to remember to change individual settings on each new site?

Best solution, filtering intermediate_image_sizes. Basically all you need to do is return an array of what sizes you want generated. In the example below, I had already used add_image_size() to generate 3 new sizes: theme-small, theme-medium, and theme-large.

Here’s the code:

add_filter( 'intermediate_image_sizes', 'rcd_remove_stock_image_sizes' );

function rcd_remove_stock_image_sizes( $sizes ) {
    return array( 'theme-small', 'theme-medium', 'theme-large' );
}

Basically what this does is define only our 3 new image sizes in the array eliminating the stock sizes of thumbnail, medium, and large.

Thanks to @Otto42 for the tip!

Capital “P”s, Communities, and Conspiracy Theories

I’m sure you’ve heard about the debate with WordPress vs WordPress. There was a patch committed to WordPress 3.0 that automatically converts it to include an uppercase P and follow the WordPress branding. This was added as as an easter egg of sorts to help the WordPress brand, and while I don’t have an issue with it, I do have an issue with the way some in the community reacted to it.

The problem with easter eggs is they’re supposed to be found by those in the community and they’re supposed to be fun. Of course, there was no hiding this one. The revision was committed in the public eye, but without a ticket. I don’t think there was much need for a ticket and public discussion because this has been in play on WordPress.com for a few years now. Of course, some argue that there was no community input because there was no trac ticket.

The one legitimate issue I could find with this patch was the fact that because the way it corrects text, it can possibly break image links and directories. I’m sure this is only in a minor percentage of cases, because as most have learned, their hosting environment is case sensitive and they use all lowercase directory and file names. This has since been fixed for trunk and 3.0.1 in revisions 15377 and 15378.

This begs the question, if this patch worked properly and didn’t break links, would we even be in this situation? Would the few squeaky wheels be complaining about Matt and Automattic doing their will and not respecting the community? Would this issue have been blown out of proportion? Would anything have even been said about it?

As usual, some in the community to complained. I’ve heard all sorts of excuses from editing user’s content (albeit just a spelling correction), to the capital P caused the BP oil spill. Yes, I’m not joking. Conspiracy theories breed conspiracy theories. There have even been parody sites made– capitalp.org and lowercasep.org

This brings about another point– I recently had a discussion with Aaron Brazell regarding the WordPress community and complaining. The point he made was that if it doesn’t affect your bottom line (income) stop complaining about it. All you do is waste your breath, waste your time, and don’t make as much money as you could. By directing your resources to other places, such as your business or contributing patches to WordPress, you can further better yourself and the WordPress community.

As usual though, there’s always a few that want to complain, and while I won’t mention them by name (they know who they are), I hope they take one thing away from this post– focus your time on making WordPress and the WordPress community better instead of complaining about this or that. Please  stop coming up with conspiracy theories about Matt, WordPress and Automattic; they’re rarely true. Its not an issue of principal, Matt, or Automattic; its an issue of making things better. Focus your time on creating a patch to fix the filter and fix the bug. That helps improve the community.

Upgrading Multiple Subversion Copies of WordPress With a Script

I run all my WordPress installs as Subversion checkouts. This makes it easier to upgrade since there’s no FTP involved and I can choose when to upgrade as well as to what version. Since I have multiple blogs, I created a script to facilitate an easy upgrade all of them at once when a new version is released.

As a Christmas present to the WordPress community I’m making my script available to the public.

The only requirement is that you’re using subversion to manage your WordPress installs already. Other than that, the script is pretty simple to use, there’s just one line of paths that needs to be updated.

To use this script, start by creating a new bash script on your server:

vi wpupdate.sh

Press “I” to turn insert mode in vim and paste in the following:

#! /bin/bash
# Copyright (c) 2009 Ryan Duff <http://ryanduff.net>
# This script is licensed under GNU GPL version 2.0 or above
#
# This script upgrades (switches) a subversion copy of WordPress to a tagged version of your choice
# List of Current WordPress tag versions can be found at <http://core.trac.wordpress.org/browser/tags>

# Set your paths
paths=(/path/to/install/1/ /path/to/install/2/)

clear

echo WordPress Update Script
echo ------------------------
echo
echo -n "Please enter version number and press [ENTER]: "
read version

for path in ${paths[@]}
do
cd $path
svn sw http://core.svn.wordpress.org/tags/$version/ .
done

Move your cursor up to the paths line and change to match the full paths to your WordPress installs.

Save the file. (Press Esc to exit insert mode. Type :wq and press Enter to save the file and quit vim)

Make the file executable:

chmod +x wpupdate.sh

To run the script type:

./wpupdate.sh

When prompted, enter the version tag you want to update to and press Enter. Current WordPress version tags can be found here.

If you have any questions or problems, feel free to leave them in the comments.