WordPress is not a Web application framework, we know that.
But what is a framework anyway? I believe a framework should first and foremost offer you convenience and rapid development in a structured manner. WordPress started as a blog engine (a very simple one) but it is quickly evolving and with the right set of tools and techniques it can also become a quite good web application framework.
What makes WordPress great is its simplicity. But what are some of its shortcomings?
Knowing where we fall short
At WidgiLabs we have done several WordPress-based websites and we are generally very happy with them. However as we move more into the development of web applications and away from websites, WordPress poses a few problems:
- it’s not cloud ready - although these days you can now even run WordPress on Google App Engine, it is still heavily dependent on MySQL as the database system and you’ll have trouble using cloud databases.
- debugging is an arse - I’ve seen experts manage to have step-by-step debugging for WordPress projects but most developers are flying on print_r, var_dump and error_log.
- no database migrations – making it hard for people to collaborate on scenarios where you have a custom database schema that evolves quickly over time.
- no clear MVC separation – making it very easy to start mixing logic with presentation and that’s never good.
So how can one go about and use WordPress as a web framework and avoid being trapped with these problems? Here’s a list of what I’ve found helps, what can be solved and when you should stick to using something else.
Minimize the shortcomings
- although WordPress is not cloud ready straight away from the installation package it is still possible to build very robust infrastructures where WordPress will run and handle hundreds of thousands of visitors with great speed and performance. A lot of documentation and video resources exist already on this subject and wordpress.com is the supreme example of what can be achieved (see the stats).
- debugging has been improved quite a lot with tools such as the Developer plugin and the Debug Bar plugin. Using XDebug you can add the handy convenience of step-by-step analysis.
- database migrations are less of a subject if you stick to using Custom Post Types and other structures that don’t involve custom database schemas evolving rapidly over time. In case you do then maybe using WordPress isn’t the best choice (or maybe someone can suggest a tool/workflow for this?)
- As for clear separation between logic and presentation one should always use the theme guidelines and you can also use Backjone.js that now ships with the default WordPress.
Knowing what we do best
WordPress has a few things done right already and you can take advantage of them, namely:
- updating is a breeze – it’s so fucking easy, I love it.
- the plugin and theme architecture is great
- the SEO – even Matt Cutts from Google has come out to admit WordPress is the best blog engine for SEO.
- stepping into the CMS territory – with custom post types and meta fields WordPress is becoming a very good CMS.
WordPress started as just a blogging system, but has evolved to be a full content management system and so much more through the use of thousands of plugins, widgets, and themes. The roadmap for WordPress is to keep aiming at simplified publishing on the Web but it is possible that at the same time it will also provide the convenience and rapid development that we are all eager to have for web development?
What’s your take? Would you like to hear more about using WordPress as a Web Application Framework? What are the main challenges you’ve identified in using WordPress as a framework for building custom Web apps?