Amazon Reloaded for WordPress Updated

I’ve just updated my Amazon Reloaded for WordPress plugin. The update includes the following changes:

  • Improved code quality
  • Improved error handling
  • New settings inputs for Amazon secret and API keys
  • New interface for display search results
  • Better formatting of search form
  • Support for Amazon’s new request signature requirements

I’m happy to get this out there and want to thank the individuals who stepped in when I was too busy to update it.  Thanks!


Interesting Programming Decisions

As a professional programmer, I come across a lot of places where I need to make tough decisions. Some of the questions I often ask are:

  • Should I split this into a separate function?
  • What conditions should I check here and what is the best order?
  • Are there any programming principles that I know of that apply here?

I was writing a WordPress plugin today and came across a piece of code that I feel exemplifies the decisions you have to make as a programmer and is simple enough to explain to a layman.

When writing conditionals there are two rules that I try to follow:

  1. Always check the positive of the condition
  2. Make the most common case come first

Generally these two principles coincide. However, today I came across a situation where they did not match up. The piece of code is as follows:

if (!is_wp_error($attachmentId)) {
    $attachmentIds[] = $attachmentId;
    add_post_meta($newPost, self::$_post_meta_Image, wp_get_attachment_url($attachmentId));
    $imageCounter++;
} else {
    wp_delete_attachment($attachmentId);
}

The most common case here is that the attachment saves appropriately and the $attachmentId variable is not of type WP_Error, so the first condition will evaluate true and go into that first block. However, given the API I’m working with, I have to check the negation of is_wp_error rather than check a positive value. So, I put the common case first but had to check a negative to do so.

I really thought about swapping this, but decided not to because I believe this is clear enough to not cause confusion. What do you think?


Bashify – A Fun WordPress Plugin

I’ve been working on something the past few days that I thought would be kind of fun.  I decided to recreate a (very) limited Bash shell that can be implemented on any WordPress install with the activation of a single plugin and the addition of a single link.  I’ve decided to put the very alpha version into play here on this site and am looking for feedback.

If you’re a total geek like me who spends half his day behind the command line, why don’t you go ahead and click that link up in the main nav that says Bashify Me!  You’ll soon see why the link is there and what happens.  Commands work as you expect with some limitations.  You can’t do “..” with cd as I didn’t want to deal with that headache.  You can’t make files or dirs (obviously) and the commands aren’t very liberal with their accepted input.  Play around, though, and I think you’ll like it (if you’re awesome).

I’ll be doing a full write up about the plugin, what it does, and how it does it, over on Plugin-Developer.com within a couple of days.


I’m In a Book!

A couple of years ago, I don’t think I would have ever said this in any seriousness. Now, however, I can happily say that I am listed in a book on WordPress as an “Established WordPress Developer.” If you’re interested, the book is “WordPress for Dummies, 2nd Edition” and is on bookshelves now. My name is on page 329. Since I know most people won’t rush out to purchase the work, I”m including a picture I took with my digital camera to prove it. They spelled my first name wrong (Nich instead of Nick) but got my last name and Plugin-Developer website correct.

I think the thing that makes me the most happy is that I’m right in there with some of the huge names in WordPress development. The other four individuals listed are people whose work I have admired for a while now.

WordPress for Dummies - Established Developers


Couple of Things Today

I have a couple of quick updates today. Nothing too lengthy, but these are things I felt were important enough to mention.

Angela is Awesome

This isn’t a particularly new thing, but we were at the gym today and I snapped a picture of her doing alternating dumbbell curls. Her form was awesome, and you can see how strong she is. Here’s the picture:

img_0298

Business Development

I haven’t posted about business in a long time, but I have been really busy. I’m specializing almost exclusively in WordPress development, but do have a few product releases planned for this year. I’ve developed a set of clients that are great to work with and provide consistently challenging and interesting projects. I should be getting even more business soon thanks to some free publicity.

In preparation for the increased number of requests, I had my website redesigned. I sliced and diced the PSDs I got from my designer and ended up with a great looking site that supports all modern browsers (excluding IE6, but I don’t care about that). You can check out the new site at the same old address, Plugin-Developer.com. Let me know what you think, as I just launched it today.

My Workouts

I changed my workouts up this week and the intensity has increased 10 fold. I left the gym today feeling like I’d been hit with a truck, and I love it. I can’t believe how much I missed that feeling. Expect some videos in a couple of weeks. Also, I’ll be doing my standard workout weekly post at the end of this week.

Amazon Reloaded for WordPress

I’m updating my Amazon Reloaded for WordPress plugin and it looks great. I should be able have it released on February 15th if all goes well. I’ve taken into consideration almost all of the suggestions made here and through email. To everyone who commented and liked the plugin, I say thank you. I’ll make a post when the new version is released.


« See older posts