WordPress For Application Development

As far as software is concerned, I’m particularly fond of working on web applications and have spent the majority of my career focused on exactly that.

Specifically, I spent the first few years of my career working on enterprise applications in .NET. Like any programmer, I spent a lot of my free time tinkering with various languages, frameworks, and tools partly because it was fun and partly because I wanted to stay current on newer technologies.

It’s funny, though: The longer you work on web applications the more you recognize that all of them – at some basic level – come back to the same thing: getting data into the database and getting data out of the database.

Sure, there’s a lot going on between the two and there are tons things to consider but, at the end of the day, that’s what’s happening and everything else is details.

For example, the majority of web applications usually include user management, registration, authentication, session management, sanitization, validation, and so on – and on and on (this list can get really long and boring).

The point is that as applications grow, they become harder to maintain.

Of course, our computer science degrees and all of the people who go around touting the latest-and-greatest techniques for building web applications talk about all of the various ways we should be building our software in order to make sure we avoid this maintenance problem.

You’ve heard it before: it ranges from all sorts of various testing techniques to different design patterns mixed with any given framework and the latest client-side library.

Don’t get me wrong – all of that stuff is important to think about, it’s fun to discuss, and it’s absolutely worth incorporating into your work as much as possible, but practically speaking it’s a slippery slope – if you end up spending all of your time searching for these silver bullets to help create your weapon of choice, you may never get around to actually building stuff.

And that’s where frameworks come in handy. For any given language there are numerous frameworks that seek to help mitigate the problem of organization, maintenance, and the mundane tasks of web development. And that’s awesome. Seriously, I love that for any given tedious job, there’s likely a library that exists for it. That’s half of what software development is all about.

But the dark side of this is that you end up breeding these religious wars over what framework is better and why, then it devolves into what language is better and why, and suddenly we’re not only not building stuff, we’re not building stuff and we’re arguing over the fact that we have too many options with which to build stuff.

Weird, right?

If web applications all reduce to the same two things – that is, data in and data out – and we have so many options from which to choose, why not just try to sit at the intersection of what set of tools help solve your problem best* and pick set of tools that you or your team enjoy using the most?

Anyway, for years I spent the majority of my time in .NET and I spent a lot of my free time in Rails. Truth is, I like ’em both though. I also spent time messing around with a variety of other frameworks and languages. While doing all of this, I was also maintaining a small blog on top of WordPress (this was back during the 2.X version).

At some point, I began to do more customizations for my blog on WordPress, then I began to do small customizations for others, then I began building larger projects, and as I began to educate myself more on the platform, the Codex, and really began to enjoy working with it.

Here’s the thing: WordPress isn’t typically considered as an option for application development nor as a software development stack. But just like you spend long enough time working in web applications, spend long enough time in WordPress and you’ll begin to recognize many of the same things:

  • Database
  • Middleware
  • Presentation
  • User Management (Registration, Authentication, etc.)
  • Sanitization and Validation
  • Caching mechanisms
  • …and so on

Bottom line: WordPress is a completely viable option for application development.

At this point, I’m spending a large majority of my time building products for both my startup and for others using WordPress and I really enjoy it. This raises an interesting question: Why isn’t WordPress considered to be an option for building certain types of web applications?

No, I’m not advocating that the next social media website be built on WordPress – I’ve already said that it’s often about finding the right tool that helps solve your problem best* – but I am saying it’s totally worth considering for a certain type of web application.

So, the original question, why isn’t viewed as such?

I believe that it comes down to how WordPress is marketed and presented – as product. It’s not presented as a framework. Developers aren’t the target audience. There’s very little marketing lingo or landing page that calls attention to its API or its viability of building your typical CRUD-based web application.

Instead, it’s presented as a blogging platform, a content management system, or a way to easily build a website.

All of these other frameworks – be it Zend, Rails, Sinatra, .NET MVC, CakePHP, etc. – present themselves as a way to help you go about building software. WordPress presents itself as a way for you to blog about building software (or anything else, obviously).

But for developers who have spent significant amount of time working with WordPress, you understand that it’s just as much a development stack as some others that are available and that it’s subjected to the same development processes as any other framework, and building for it can often be just as frustrating and/or rewarding.

* This is an idea that probably deserves its own post and this isn’t that post.

This article is also provided in Spanish language thanks to Maria Ramos from WebHostingHub.com.

12 Replies to “WordPress For Application Development”

    1. Truth is, I didn’t see it as a development stack when I first got on it – it wasn’t until I started doing customizations, plugins, and obviously the theme work we’ve done that I really began to see its potential.

  1. Liked this point Tom and would love to see it discussed in greater detail. I’ve given it some thought as well, and have come to the conclusion that with a crazy mix of plugins, custom dev, custom post types and taxonomies you “could” build almost anything on top of WP as your framework. Much of it will be a kluge (klooge? sp), but it could work — and would likely lead to a rapid prototype, if nothing more long term. Some of it, will be entirely appropriate. And your right – WP isn’t front of mind for many (any?) development folks … and that’s probably too bad. It would be a good solution for some cases, and a rapid prototyping tool for others. I think the buddypress folks might be closer to this line of thinking since existing stacks don’t really address that nature. You see the odd app theme get created that gives more credence. Side note: between this post and your last one, I think I have a good guess on that analog from whence you speak ;-p

    1. I’ve got a handful of things I want to talk about more on this topic so they’re definitely coming down the pipe and would love for you to continue to chime in with your thoughts. Like you said, there appears to be very little discussion around this in the development community – I figure why not try to bring it to a light a bit more.

      Anyway, in my experience, I think it’s possible to strip WordPress down into a very basic set of functionality (user, registration, sessions, etc) without needing plugins or additional tools – just use the native API. From there, you can use custom registrations, user roles, and so on to handle levels of access around the application.

      To your point on rapid prototyping, I think you’re right but I’d hate to see it relegated to just a prototyping tool especially when it’s so much more and the potential is so much greater. I think there’s a huge gap between what’s possible with WordPress and what people are doing to help realize that potential. Of course, I’m not saying that *I’ve* done anything groundbreaking, but I’d like to think that a few of us have done some pretty cool stuff that should be shared (again, posts I’ll eventually get to :).

      Dig the comment and dig talking about this!

  2. I was so glad to see this post, Tom. I’ve been thinking this for quite some time, and actually started to solidify my thoughts on it around the time I did a talk at WordCamp Melbourne on ditching custom CMSes ( http://blip.tv/wordcamp-melbourne/using-wordpress-as-a-development-platform-4839739 ).

    These days, when people ask “What is WordPress?” or they assert “WordPress is for blogging”, I try and explain that “WordPress is a web application development framework that happens to do blogging out-of-the-box”. Running our local WordPress User Group meet up, I have to throw that line out pretty regularly, as we get a lot of people coming along who really don’t know that much about WordPress yet.

    As far as prototyping goes, while I agree it would be fairly quick to use some plugins and things to get up and running quickly with an application based on WordPress, I think over time you’d want to replace those plugins with application-specific code that performed the function required, or at least customised the plugin. But I don’t think this prototyping is necessarily the strong point, I think it’s just a small advantage for certain scenarios.

    WordPress itself as a base, with an application built on top (likely consisting of a theme and a collection of application-specific plugins), is a real tool.

    In my spare time (read: only in my mind at the moment) I’m working on a SaaS application built on WordPress Multisite. This is partly because I saw a niche that could use the SaaS, and also partly to test this theory of using WordPress as an application framework and seeing how well it goes in practice. One day I may actually get time to properly build it out, and then we’ll see :)

    Also, I’m a strong advocate for using the right tool for the job, and I’d be interested to read your thoughts on that too!

    1. If you’re building a specific application from the ground up, I agree that you’d want to ditch certain plugins for more application-specific code primarily because the plugins will likely be more generalized for a specific need.

      That isn’t to say that *some* plugins aren’t useful, but more often than not there very specific “business-rules” that should be tailored specifically for the problem at hand and it’s unlikely that a certain plugin will offer such focused functionality.

      I’ve got a number of different posts I’m drafting up – everything from a software engineer’s approach to theme (and plugin) development to how to think of object modeling in the context of WordPress all the way through what I consider to be good tools for the job.

  3. Hi, congrats for this great article. I also think that WordPress could be nice to develop web applications, and I agree that people could talk more about this topic.

    Recently I did some tests integrating WordPress and Yii Framework. So, I can use some features from Yii (like active records, data access object) and others from WordPress.

    My first impression is that, when deciding to use an integration like that, maybe is better to use the WordPress as backend/admin and ignore it’s theme features, while Yii as responsible to do the front-end and CRUD (but obviously, it’s nice if this CRUD is backend, should be integrated within WordPress admin).

    Please, if you continue work on this kind of things, share your experience with us. It’s so nice to know that we are not alone :)

    Thiago Senna

    1. Thanks Thiago!

      Yes – from an application development standpoint, I think that more conversations need to be had and users should be explaining more about their particular approach and experiences in doing so. That’s one thing I hope to continue to be able to do.

      I’ve never used any other server-sider framework with WordPress. I’ve tended to roll my own views, pages, etc with custom helper functions to manage data access and permissions. It’s worked fine, but I think there’s room for improvements – perhaps a plugin or some other utilities to make it easier for future development.

      Anyway, if you blog about this feel free to share a link. I’d love to follow along!

  4. Thanks for sharing. Helps newbies to app frameworks (like me) get oriented. I’ve been doing some reading on the possibility of using WordPress as an application framework. I think my biggest hangup (admittedly I’m not an uber programmer) is when I read comment threads that bash WordPress for the way it stores data in the database and how it’s missing some key features like an uninstall system that removes plugin and theme data from the database whenever we uninstall/delete them. I know that no matter what framework we go with, there will always be something that doesn’t quite work the way we want it to. Makes me wonder if the crux of the argument on which platform to use really be about the tradeoffs vs the usefullness/effectiveness and more importantly, how to gauge it for yourself.

    Anyway, I’ve much to learn and appreciate everyone’s insights.

    1. when I read comment threads that bash WordPress for the way it stores data in the database and how it’s missing some key features like an uninstall system that removes plugin and theme data from the database whenever we uninstall/delete them

      As far as how information is stored, I get some of those concerns mainly because there’s not a consistent mapping for how, say, post types map to database tables. Instead, everything is a post and its type is denoted by a column in the database.

      This is but one example. And yes, there are definitely some concerns, but I don’t think they’re absolute show stoppers.

      As far as uninstalling plugins is concerned, that’s left up to the developer. There are hooks placed all throughout the code the least of which is not register_deactivation_hook that gives us the ability to clean up after ourselves.

      Makes me wonder if the crux of the argument on which platform to use really be about the tradeoffs vs the usefullness/effectiveness and more importantly, how to gauge it for yourself.

      FWIW, I tend to come back to this. There are certainly tradeoffs and questions for every language and platform that are out there, and there are plenty of issues with WordPress, but I do think some are exaggerated or come from a place of lack of understanding.

      It’s like me coming in to make a point about any other framework of library when all I’ve done is take a cursory look at what’s offered rather than spending a year or so trying to create something with it.

    1. Hey Stefan,

      I’m not sure what you mean by a “scheduling application” so it’s hard for me to give a definitive answer, but given the APIs that WordPress offers for content management, I’d say that it’s completely possible and easily doable (given a proper WordPress developer) to build such a solution).

      Hope this helps!

Leave a Reply