I hear a lot of the Internet Marketing gurus brag about how they cannot even write their own landing pages. They argue that most (or all) of the technical stuff should be outsourced so you can spend time on marketing instead of hacking. There is no money in hacking, they proclaim. I see their point, and who am I to argue? After all, the number of “million dollar launches” that I have been involved in is exactly zero.

I do wonder sometimes how you know if outsourced technical jobs are being done correctly if you don't understand the underlying technology, but that is a subject for another blog post. This post is about code. And one thing you can say about internet marketing specifically, and the internet in general — there is a lot of code out there. Code makes things work, and the quality of code can make or break a project (or an application).

WordPress is a great example of a situation where coding quality is absolutely critical. Apart from the core engine, there are hundreds upon hundreds of plugins that depend on the quality of the core code. Those plugins, if improperly written, can crash other plugins or even crash WordPress itself. In addition to that, there are themes which are really just code. If your theme is not written well, it can break too.

Last week, I was working with an excellent WordPress theme developer on a new theme. We were doing all of our testing on a site that was recently upgraded to WordPress 2.5, and were using some stock WordPress 2.5 template files. During our testing we found that some of the stock WordPress 2.5 theme files did not run on a WordPress 2.3 install. Now this is understandable — after all, why would anybody expect something designed specifically for WordPress 2.3 to run in WordPress 2.5. (Note that he was doing all the work — I was just along for the ride).

As it happens, the theme test we were working on crashed in WordPress 2.3 because it depended on the new gravatars function called in comments.php. Gravatars is the cool function now native to WordPress 2.5 that puts the author's picture next to their comment. The code in the them looks like this:

echo get_avatar( $comment, 32 );

See the problem? The theme called get_avatar without checking the return status (if available) or at least whether or not the function existed. Luckily, php provides for situations like this. The “function_exists” function lets you test to make sure that a function is there before you call it. So, a better way to call a function like this is:

if( function_exists('get_avatar')) { echo get_avatar( $comment, 32 );

This tests to make sure that there is a function called get_avatar available to be called. It does not say anything about whether or not the call is successful. Now, you can reasonably make the argument that there is no need to test for get_avatar in a WordPress 2.5 theme since only a knuckle head would run WordPress 2.5 code under WordPress 2.3. I get that. But I also believe that it is always good practice to design code so that it is robust against unexpected circumstances.

Always use protection.

Regards,
Mark

P.S. The theme that I was working on is called SEOAdMax by Garry Conn. It is available for free.

TEST
Enter your name and email address below and I'll send your Domain Name Checklist directly to your inbox.

Enter your name and email address below and I'll send your Domain Name Checklist directly to your inbox.

It's the only domain name checklist you will ever need.

You have Successfully Subscribed!

Enter your name and email address below and I'll send your Blog Post SEO Checklist directly to your inbox.

It's the only SEO checklist you'll ever need.

You have Successfully Subscribed!

Enter your name and email address below and I'll send your awesome Become An ExpertChecklist directly to your inbox.

Crush Imposter Syndrome Starting Today!

You have Successfully Subscribed!

Monday Motivational Email

Yes!! Please help me stay motivated by sending me an awesome motivational email each Monday morning.

Success! Now check your email to confirm your subscription.

Affiliate Marketing Tips

Enter your name and email address below and I'll send your awesome Affiliate Tips Checklist.

More than 30 tips to help you increase commissions sent directly to your inbox.

You have Successfully Subscribed!

Join The Community!

 

Leave me your email and I will send you cool free stuff

You have Successfully Subscribed!

Sign Up To Get Notified About The Launch!

You have Successfully Subscribed!

utm parameters google analytics

Where should Isend your UTM Parameter Secret Decoder Ring?

It's the only UTM Parameter reference you will ever need, and I'll send it straight to your inbox.

You have Successfully Subscribed!

Want To Start Your Own Internet Profitable Online Business? Need Help Making It Grow?

Want To Start Your Own Internet Profitable Online Business? Need Help Making It Grow?

Just leave your email and I'll send you everything you need to get started, and helpful tips to make your business thrive.

You have Successfully Subscribed!

Enter your name and email address below and I'll send this presentation directly to your inbox.

These slides are perfectly with episodes 147 and 148.  They'll make everything crystal clear.

Your content is on the way!

Yes! Notify Me When New Late Night Internet Marketing Podcast Episodes Are Released!

You'll know when new episodes are available (and exactly where to find them).  Easy peasy.

You have Successfully Subscribed!

Yes! Notify Me When New Late Night Internet Marketing Podcast Episodes Are Released!

You'll know when new episodes are available (and exactly where to find them).  Easy peasy.

You have Successfully Subscribed!

Pin It on Pinterest

Share This