Category Archives: PHP programming

My exploits in the land of PHP.

Trying something a little different

Last week I did something a little different. I gave a presentation at the Vancouver WordPress Meetup Group January meeting. This isn’t that unusual in the grand scheme of things. Folks who’ve known me for a while know I was the chair of the Amiga Users of Calgary at one time, and an active member for many years. I gave plenty of presentations and chaired meetings, but that was a while ago.

For the last couple of years, I’ve been playing around with building a business directory (2 really) and that was the topic of my presentation. I covered the variety of themes and plugins as well as some general reasons one might build a directory on WordPress.

I felt good about doing this. I was nice to give something back after a couple of years of observing, and to get back into the habit of DOING something.

Chris came along for moral support (cuz that’s what he does) and took a few pictures.

Competitive Analysis

So, for a little over a year I’ve been working on a new WordPress plugin. A full-fledged management system for an industry that currently has about 3 or 4 major competitors.

This has been a big project, and I’d say I’m 80% of the way to being able to release something preliminary. I get sidetracked a lot and after working all day on code, I just plain don’t feel like coding when I come home. Plus there’s more fun stuff to do.

Part of what I’ve been doing when I don’t feel like coding is the competitive analysis portion. It’s a little late in the game – you should do this up front, and I did – but it keeps my mind occupied.

I have about 500 screen shots fo their systems, 40 Google documents listing features of each component including all the announcements of new features. I read their support forums, industry forums, magazines & newsletters looking for trends, patterns and unmet needs.

Here’s how the competition stacks up as I see them:

  • Competitor A – Nicely done interface, solid set of features, industry experience, attractive site, outdated demos, incomplete help. I’m paying a small amount for access to this site and their active user forum. The staff and users are active on the forum, but the site owner’s idea of customer service attitude is more attitude than service.
  • Competitor B – Ok interface (a little tight & terse), hard to navigate, solid set of features, broad appeal. Open demo site with all features. Help system is under a different company name, loads slowly, and isn’t terribly helpful.
  • Competitor C – Antiquated interface (the 90s called), I couldn’t figure out where to start, or add new stuff, layout is a single column of links, primary website hides more than it sells, help is not helpful. Well, I did figure out kind of how to add stuff.

In short, not only is the project fascinating to me (and extremely challenging), but there’s plenty of room in this market. Comp A claims to have 15,000 clients and Comps B and C would seem to have both plenty of clients and some money in their pockets (although C should spend it on programming, not advertising). My own scans of site lists shows a number of WordPress installs, but not a huge number.

Oh, and Competitor A runs ads every month (for the last 2 years it seems) in an industry print (and online) magazine. The ad is nice looking and appropriate, but the site they advertise (not their main site which is odd) actually has no content on it. It has a header and a menu, like it was meant to be a demo site, and yet there’s nothingĀ  here! It’s a HUGE waste and makes them look bad, I think.

This is an industry where the companies spend hundreds of dollars a month, and carry huge investments in inventory. The competitors services are all fully hosted, and pricing varies. Comp A has packages ranging from $10 – $50 per month (mainly about capacity for storing the number of items) and Comp C is a $99/year. Comp B is a mystery. Their site doesn’t disclose pricing (so far as I’ve found) until after you join. And I don’t need/want to do that just yet. Apparently Comp B offers their site for “free” if you join one of their other services, starting at $12 per month. They all offer “widgets” and things you can include in your site that links back to theirs. If you don’t pay for a premium option, you get a url like – which looks a little sad. I see why they do it for the upgrade.

My plan? In an ideal world, I’ll sell the plugin for $150 – $250 with lifetime upgrades and support. Perhaps selling additional modules, installation & configuration services. I may have to go higher. Also, turn it into a hosted service like the others do, running on WordPress multi-site and partnering with a web designer/firm to offer solid templates, and refer work. And everyone gets a domain. Subdomains like these guys use are as useful & professional as a email address.

This is a grand dream, and it’s going to take a while to get there. But I’ve put this out there for a few reasons.

Mainly, just to vent about how crappy these other guys seem to be. Don’t get me wrong, they’re all doing many, many things right and have pretty good word of mouth and awareness. But there are gaps. I’ll have gaps when I launch too and that’s ok.

Secondly, by putting it out there, my friends and family know about it and can call me to task on it when necessary. Yes, I’m a procrastinator, but that’s for a future post.

It's full of empty!

My god it’s full of empty!

I read a great article on Smashing Magazine today, detailing the author’s favorite Programming Mistakes, which really highlighted just a couple of mistakes I’ve made, and seen other programmers make.

Tonight, while waiting for Chris to come home, I was working on this big WordPress plugin project I’ve been doing. Apparently I’ve been doing it for a year, based on the dates on a few files. Well, I took like 4 months off to do another one, but I digress….

The point is I found a common programming mistake that I make, and I see my fellow programmers make at work. They forget to consider the EMPTY state.

My day job is working for a 15 year old website with tons of users. Our dev systems are replicas of live data so we have lots of stuff to test against. I call this the FULL state. What we fail to consider is the EMPTY state. What happens when a user first sets up an account and is face with a blank slate? Sounds like an obvious question, right? But it’s not always.

We all start with a blank slate and program for it. But a few days/weeks/months into a project, we have been re-using that same old test account with that awesome and witty test data for Bugs Bunny, Megan Fox, or whatever your favorite mock-data is. It’s familiar and comfortable. And you blithely make changes to this stored procedure, that class or some function.

And the code gets to the next phase. Maybe it’s QA, or maybe it’s LIVE/PRODUCTION (god forbid) and the first report hits.

“Dude, when I log in/click start/add a listing, I get a massive error.”

Huh? What? It’s been working all these months fine. What could be wrong?

Well, it turns out you didn’t consider that the user (fine, intelligent user that they are) hasn’t got any data yet!

Currently, running on my test blog for just such cases, my plugin looks like this:

It's full of empty!


Yeah, that’s not even close to pretty. Granted the big error markers are coming from xDebug so it wouldn’t look like this to the end user normally, but still, I obviously failed to consider the empty.

So, one of my jobs this weekend is to go and rework those functions to not explode if there’s not found data, but rather to gently prompt the user to go and enter the required data.

I’ll also want to add some nag bars to the system if critical data like this is missing.

I sure hope it rains so I’m not missing anything.

Mini Milestone

Feel free to disregard this post if the thought of coding, parsers and things brings you to your knees, or makes your eyes roll back. It’s gonna be that kind of post.

I’ve been working on a new WordPress Plugin for an unserved market, at least as far as WordPress is concerned, although there are a lot of peripherally similar plugins.

For this plugin, I had to figure out how to store up to 10,000+ imported items that would later be searchable, but not display on the site.

My initial solution added a custom table to the WordPress install with columns for all the various features. It also included a ton of custom code to figure out how to import the content, convert it, store it in the database and then search it.

I had an email conversation with Mike Schinkel who spent a good deal of time trying to convince me of the value of Custom Post Types in this instance, but I wasn’t willing to open my mind. I got hung up on the “Post” part and thought they were truly Posts, but I’ve learned they are more than posts.

Why use Custom Post Types (or Custom Content Types as they’re better named)? Several reasons…

  • No custom tables. My solution, in a multisite environment, would have created a custom table for each blog
  • Extensible. I can use custom fields, taxonomies and other constructs to extend the information.
  • Forward compatible. Using the approved WordPress API for everything means better “future proofing” against change.
  • Auto-indexing for searches. Everything is indexed like WordPress does for posts.
  • Less coding. Yeah, I had to learn the hard way, and spend a bunch of time learning stuff, but ultimately spent WAY less time writing code. That means smaller footprint, and easier maintenance.

There’s other reasons I can’t think of, and I’m sure someone will argue against me, like I did in the beginning, but I’m beginning to see the real power of Custom Content Types.

Mind your mind

Another of those “life lesson” type things today.

The new project I started back in the fall is a bigger size. It’s been re-written at least twice already as I learn new things. I love learning new things, and these will ultimately make the project just that much better, so I don’t mind. It’s also not stopping me from moving forward with new code/features as well. Best of both worlds.

Where does the “Mind your mind” come from? Well, I thought I was building a software/plugin of type X, but after reading an email today, I realized that I was wrong. My mind had been telling me “stories” based on assumptions, and things I had read about competing projects.

While it was important to understand those competitors, what was more important was for me to evolve my understanding of what I was fundamentally building.

By actually keeping an open mind and understanding how what I was reading was REALLY what I was building, my eyes were opened. It means a fundamental shift in HOW I design the project and the importance of some of the features. And it will ultimately affect the marketing of the product.

It may also change the name of the project.