How to make sure you don’t fuck up

I’ve been doing a lot more freelance stuff lately, and I feel like I’ve learnt something new (or a lesson has been stressed a lot more unto me) with every client.

Work off-line.

This definitely feels like more trouble than it’s worth, but trust me on this. I work with WordPress addons and fixes mostly, and I’ve found it’s always best to just grab their copy of WordPress, including their plugins and database, and run that on your localhost (or where ever). That way you’re running their installation warts and all (in case they changed some of the WordPress code without noticing or something),  so you’ll even have the same bugs as them.

Although WordPress mostly looks after itself with respect to the php.ini settings, if you’re working on something that doesn’t you may even want to yoink those settings and change your localhost to those. Same for .htaccess.

This way you know when you upload your changes it’ll work exactly the same way on their server as it did yours. There’ll be no nasty surprises because they have magic quotes turned on or their pages are redirected through another.

Whilst you’re at it, back all that stuff up.

Drag and drop all their files over FTP, export their database, nab their settings. Before you even start work, archive all of that. Put it in a /clients/ClientName/ folder and leave it there.

That serves two purposes; first you’re definitely not going to break their entire website accidental. And if you do, you’ll be able to restore, hopefully before they even notice. Second, you don’t have to keep nipping into their FTP server to find out how that old file was, or to revert back to the server version. Some people have tight bandwidth options and they won’t be happy about you using all that up.

Even after you’ve finished, keep the back up.

Honestly, you’ll be thankful you have. After you’ve done the job and your fix works perfectly on the live site you should still keep all the backups you made of their data for a little while. I’m planning on keeping mine for about a month or so. You might have missed a dire circumstance that you’ve broken, and in a few weeks you’ll get an “URGENT: YOU BROKE SOMETHING” entitled email.

Remember to encrypt that backup somehow. Just a simple password when you archive the file is enough. If your laptop gets stolen with hundreds of client’s MySQL passwords and things it’ll be fairly embarrassing phoning them all up and telling them they need to change them. I’d imagine that’d be more embarrassing than telling an ex you have herpes.

Whilst we’re talking about encryption, most servers have SFTP enabled and you should take advantage of that. I should expect most FTP clients have that feature, but I use WinSCP. It’s just the added extra security you can give your customers, and covering your back if anyone is ever listening in on your connection.

Keep track of your changes.

When you’ve finished your work do a diff or something similar on the work you’ve done compared with your old backup. If you’re client comes to you and says that since you’ve done your work some abstract thing on their blog has broken, you can go through that diff and either use it as evidence that it wasn’t you that broke it, or see specifically where you went wrong, and how you can fix it.

Also, it might be comforting to the client to see what work you’ve actually done. And you can always use it as a reference later on in other projects (“how did I make the post title change a few clients back..?”).

There are some others that I’ll add later.

One thought on “How to make sure you don’t fuck up

  1. I’d add “Make one change at a time, see if it does what you think it’s going to do”. Especially when it’s something simple that you’ve done plenty of times before. It’s too easy to screw up on step four of a list of small changes and then spend ages trying to work out where you went wrong.