Hacking WordPress

I’ve been doing quite a bit of side work for friends and family putting together some low traffic ‘business card’ sites. I used to do a lot of custom programming for each of these where I would put up the site and then have a CMS on the back end so they could log in and update the content.

This worked out for a while and I had a pretty basic CMS built that I could plug in where needed. But, as with everything, the feature set that I needed kept growing and I was pretty short on time to implement the features that I needed.

To solve this, I started looking at the various blogging engines that were out there. The one that seemed the easiest to pick up, was pretty popular, and had a ton of plugins for the things that I was looking for was WordPress.

As a blog engine, it does great! It is actually what is powering the site that you are reading now. As a CMS, it does OK. I can create static pages, setup some assemlance of structure with sub pages and decent navigation. There are a ton of themes out there and a lot of people have tutorials that can tell you how to hack them up to make them look the way that you want. But there is one major thing that is bugging me. The code!

Seriously, have you looked at it? Maybe I’m anal retentive. But there is html and PHP mixed together all over the place. The code looks like it tries to implement some sort of MVC where the view is in the theme. But good god, do not go looking through that pile of poo.

Here is an example of what I am talking about:

 


   
 



 

I couldn’t even do that big of a snippet due to all the hell it causes when you post wordpress code on a wordpress site. But the tags are scattered all over the code base. Its a royal mess.

What WordPress needs to do is come up with some sort of code standard or guideline. Then reject anything that doesn’t meet that criteria that they have linked up on their site. This is a full review of all the plugins and themes that they have.

Yes, I’m serious about this!

It will take a long time to do. It will take a lot of man hours to complete. But in the long run, the code will be easier to maintain, extend, and quickly allow users to join the rank and file wordpress developers. It will also allow the hacks out there to become better programmers. Which is something that the code base desperately needs.