On Being a Developer-friendly Developer

I’m working on a project right now that requires some changes to a very complex and large premium WordPress theme. It’s a very powerful e-commerce theme that has a ton of plugins and shortcodes baked into it. The problem is my client really just likes the layout of the theme, and really doesn’t want all the bells and whistles. So the first thing I’m doing is stripping the theme of all the excess. But this brings up three major concerns:

mattress tag
Photo courtesy of “drl” at Flickr.com
http://www.flickr.com/photos/mbk/2338576127/

1. The Mattress Tag

The trouble with working with themes — especially premium themes — is they come with a secret “manufacturer’s warranty”. Basically, if you expect any help from the theme developer at any time in the future… don’t mess with his/her theme. Don’t break it, don’t edit the files directly. It’s like that tag on the mattress, if you cut it off, your house fire is all your fault!

2. Future-Proof It

There’s another concern in tweaking premium themes, besides that the theme developer won’t like it. If the developer does ever push an update and you hit “update theme”, you loose all your customization. Nobody’s got time for that!

3. What Happens in Vegas, Stays in Vegas

Lastly, if you’re working on a client site, you may¬†think you’re gonna keep that client forever… but probably not. Turnover happens, and, if you’re lucky, your business is going to grow and you’re going to have other staff working on sites in the future. If you just start going in and making changes all over the place no one who comes through there after you is ever going to know what you did.

My Solution(s)

Doing this stuff well all starts with your mind-set. (1) Respect those that make stuff well and provide it to you for free or sell it at radically low cost to you. There are tons of really high quality stuff out there available at pennies on the dollar compared to the working-hours put into them. Respect that. (2) Make sure your work is always future-proof. In the case of working on a premium theme, don’t change the theme directly, make a child theme and edit that. Easy! (3) Mark-up what you do with VORACITY. Make it ultimately clear that:

// ### THIS SECTION HERE WAS NOT ORIGINAL TO THE THEME
// ### I DID THIS... ME ALONE. EMAIL ME IF I MESSED YOU UP
// ### HERE'S MY EMAIL [email protected]

When it Doesn’t Go As Planned

So all those things are important to me and I try to do all of that all of the time. But on this particular theme, I couldn’t keep the edits to just the child theme. I won’t go into detail, but basically, I had to add some code to the parent theme’s functions.php file.

WARNING, WARNING, DANGER, DANGER Never do that! Ug!

I wish I could have avoided it, but I couldn’t. So suddenly, even though I marked it up really clear, my client can’t update his parent theme if updates come out. No fun. So I thought to myself:

“Self, I wish I could put a big “READ THIS BEFORE UPDATING” on the theme page”

So, as in most things WordPress related, whenever you find yourself wondering about stuff, the CODEX is your friend. This fancy little piece of code let me make a link to a custom markup page on the theme options page.

add_action('admin_menu', 'my_plugin_menu');

function my_plugin_menu() {
	add_theme_page('My Plugin Theme', 'My Plugin', 'read', 'my-unique-identifier', 'my_plugin_function');
}

Here’s the screenshot (theme name obfuscated since the site is not live yet).

Viola!

So now, I’ve made the changes I need to and they can be easily replicated whenever an update comes out, and anyone who ISN’T me will be able to figure that out too. Happy Days!

CC BY-NC-SA 4.0On Being a Developer-friendly Developer by Matt Cromwell is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

There are 4 comments Join the conversation

Comments are closed.