Wordpress Code
I’m very much a fan of Wordpress. I’ve installed it for a number of friends and clients. But if you’re a fan of neat, clean and tidy PHP code, just don’t look under the hood. SHIVER. I understand the difficulties of working on such a complex application with multiple developers, but there’s got to be some way that these people can stick to a few simple coding standards, whatever those standards might be.
On the front side, Wordpress works phenomenally, but little things like continually switching the usage of single-to-double quotes, repetitious code, and mixtures of global and local variables makes it look like it was thrown together. I can only hope that future versions will get a code makeover in addition to any feature updates.
Update: WordPress 1.5 is out, and it’s fantastic. I have officially made the switch. I love it.
Post and Author Info.
Published September 30, 2004 by:
Commenting is currently off for this post.
So far there are 15 comments.

Style stuff in the code bugs me too, but going line-by-line and rewriting all that isn’t a terribly high priority. When I work on a section of code I try to clean it up, but that means that some sections follow the new style, some the old style, and some the very-old b2 style. Eventually it will all be tidy, but it’s an iterative thing. The double/single quotes thing is actually on purpose which you can read a bit about here:
http://wordpress.org/docs/developer/coding-style/
October 1st, 2004
I really appreciate your response, Matt. I read the post again a few hours after putting it up, and it did sound a little more argumentative than I wanted it to. But your answer seems very sufficient. Mamma always told me not to complain about anything unless I was willing to do something about it. SO maybe I should research more about how WP works and then start by making a few plugins and such. I’ll try to do my part to help the situation. So again, thanks for taking the time to respond and assure us that you’re constantly working to create a better and better product.
October 2nd, 2004
You should try Text Pattern.
Nice and tidy!
October 4th, 2004
This is so common in open source projects. I’ve looked at a few of them and they all look like spaghetti. At times it makes you wonder how the software even works.
I’ve sent patches to some OS projects. When I code for others, I try to match my coding style with the project. I don’t read “coding style instructions” for any project though — it’s in the code, if there is one.
October 9th, 2004
And that is why many projects look like soup. If the project leads take the time to create code style docs you should read them.
They were created for a reason. Look at me all high and mighty, its like pulling teeth to get me to actually observe the style code, isn’t Matt?
October 14th, 2004
Wordpress is quite a pile of spaghetti. I’m desperate to leech on to an existing project for my needs (as opposed to starting from scratch) but every time I consider it and look at what’s available, I only find myself in the same spot with the same concerns. Wordpress was the most recent of these. I tried — I mean REALLY tried — to scrape enough code out of it to make it usable (or, rather, reusable) for my purposes… I just couldn’t do it.
So I share your hope of cleaner Wordpress code in revisions to come.
October 18th, 2004
Put a little time where you mouth is, (of course I am not including the site author in this tirade.) we are working very hard, with a very limited amount of talented people to make a free, powerful semantic system; the problem is so bad that hacks like me are being tapped to help.
Hey Jim, why don’t you join the team as a contributing Dev and clean up some of that code, instead of just griping about it?
October 19th, 2004
Couldn’t have said it better myself…
When I started blogging I wanted a cms for my blog, but when I saw the code in WP I thought it would be better to make my own cms so that I could always add features without having to figure out somebody’s wierd code…
March 25th, 2005
Further evidence of the immaturity of the WP developers is the way they fly to every published complaint like it was a honeypot for WP developers, and bash the complainer mob-style. Geesh… grow up guys.
Spaghetti code is a consequence of prioritizing, and you clearly state your priorities all the time—satisfy the user base at all cost. Why not live with your decision, instead of earning a reputation as the coders who meet non-coder user expecatations AND immature coders who have solittle confidence in theirproduct they need to try and quell every criticism.
Count the users, be happy, and keep going.
May 23rd, 2005
thats cool that we have such site as that.
June 11th, 2005
I’m trying to hack Wordpress, the big problems I am facing is the lack of commenting, and the “require ‘foo’;” that lead onto more “require ‘bar’;” making tracking down functions very hard.
July 7th, 2005
Flip and I thought Prince Charles was a snob! Don’t listen to them Matt – I think you’re doing a great job. As has been said before you can gripe or get with the programme and help.
Relax, chill and breath – you’ll find you’ll live a lot longer and instead of wrinkles you’ll have smile lines.
Rich
August 28th, 2005