I assume other developers often ponder this question. In a practical sense, the answer is “because it’s what you know”. But I’m pondering a bigger question. As a developer with a keen interest in PHP should I waste my time with WordPress? Can you ever get “respect” as a PHP developer when your tool of choice is WordPress?
WordPress is a dinosaur compared to most of the popular custom PHP frameworks. Frameworks like Codeigniter,Kohana and others are very light weight and scalable. They generally focus on concepts like OOP (object-oriented programming) and MVC (model-view-controller). Code reusability and encapsulation are priorities not luxuries.
WordPress is a vestige of PHP before PHP had a robust object-oriented structure. As such it is mostly a collection of libraries of functions. Of course, with every new release these function are streamlined and improved. But ultimately WordPress is always going to be a procedural framework.
So if you’re interested in PHP why waste your time with a code base that will never be the vangard of PHP development?
Well, for one, just because WordPress core is less than impressive from a PHP point of view, does not mean that cutting edge approaches to coding are not implemented via plugins. Plugins are essentially little custom apps that tie into the WordPress API. But as such there are lots of plugins that exemplify flexible and cutting edge approaches to code development.
For instance, there’s a plugin out there the integrates Doctrine ORM with WordPress. Doctrine is a “Object-Relational-Mapping” interface that aims to cleanup how PHP interacts with Databases. Sure WordPress core doesn’t have a Database Abstraction layer, but if your interested you can use Doctrine in your plugins!
PodsCMS, one of my favorite plugins, is another one that pushes better code into WordPress. Pods is capable of managing massive complexity in WordPress content, but itself is a very light-weight, Object-Oriented framework. Moreover, PodsCMS, while not entirely MVC, at least separates code from markup which is a feature sorely lacking in WordPress core.
Other plugins, among them Shopp (an e-commerce plugin) and GravityForms, take very Object-Oriented approaches to coding. So just because there are limitations to WordPress core, does not mean developers passionate about PHP cannot excel and flourish. If anything, the lack of cutting edge PHP in WordPress creates a tremendous opportunity for hard core PHP developers.
But why? Why drive a station wagon when you could be driving a sport car? Well, because you have places to go and things to do … and people to take with you. The simple reality is that there’s a huge market for WordPress development. A bigger market than just about any other out-of-the-box CMS. And that means an opportunity develop good code for good projects.
So if you’re a WordPress developer and want to branch out into custom PHP, my advice is first, learn the WordPress way of doing things. Then forget the WordPress way of doing things. Experiment with custom frameworks and try to find ways to incorporate the innovations into the WordPress projects you’re working on.
And most importantly, don’t be afraid to NOT use WordPress for a project or two. Getting outside your comfort zone is what gets your creative juices flowing.