It’s an exciting time for the WordPress community, with an ever increasing interest in modern programming practices and more people becoming familiar with frameworks such as Laravel. In response, a number of MVC frameworks for WordPress have sprung up to help make it more powerful, extensible and maintainable.
Want to know how some of these frameworks stack up? So did we! We’ve compared 6 MVC frameworks/plugins/starter themes for WordPress and put together a handy feature comparison table.
Full Disclosure: We have skin in the game, one of the frameworks below is our very own Lumberjack (which has dramatically impacted the way we’ve developed sites over the last few years – for the better).
The frameworks we looked at, in alphabetical order, are:
- Lumberjack – a framework built on top of Bedrock and Timber
- Sage – a starter theme built by the team behind Bedrock
- Themosis – a framework built on top of Symfony & Laravel packages
- Timber – a plugin that provides Twig and some MVC functionality
- TypeRocket – a framework with some additional Admin UI/feature enhancements
- WP Emerge – a framework and starter theme
Feature Comparison
Lumberjack | Sage (with Bedrock) | Themosis | Timber | TypeRocket | WP Emerge | |
---|---|---|---|---|---|---|
General | ||||||
License | MIT | MIT | GPL-2 | MIT | GPL-3 | GPL-2 |
Dependencies | PHP 7.1+ | PHP 7.1+ & Node 8+ | PHP 7.1+ | PHP 5.3+ | PHP 7.2+ | PHP 5.5+ |
Composer Support | ✔︎ | ✔︎ | ✔︎ | ✔︎ | ✔︎ | ✔︎ |
Environments | dotenv | dotenv | dotenv | ✘ | ✘ | ✘ |
Configuration | ✔︎ | ✔︎ | ✔︎ | ✘ | ✔︎ | ✔︎ |
Error Handling | ✔︎ | ✘ | ✔︎ | ✘ | ✔︎ | ✔︎ |
Logging | ✔︎ PSR-3 | ✘ | ✔︎ | ✘ | ✔︎ | ✘ |
HTTP | ||||||
Templating | Twig [1] | Blade | Blade & Twig | Twig | Twig & custom | Blade & Twig |
Controllers | ✔︎ | ✔︎ [2] | ✔︎ | ✔︎ | ✔︎ | ✔︎ |
Class based | ✔︎ | ✔︎ | ✔︎ | ✘ | ✔︎ | ✔︎ |
View Composers | ✘ | ✔︎ | ✔︎ | ✘ | ✘ | ✔︎ |
Server-side Routing | ✔︎ | ✘ | ✔︎ | ✔︎ | ✔︎ | ✔︎ |
Method filtering | ✔︎ | ✘ | ✔︎ | ✘ | ✔︎ | ✔︎ |
Named Routes | ✔︎ | ✘ | ✔︎ | ✘ | ✔︎ | ✘ |
HTTP Messages | ✔︎ PSR-7 | ✘ | ✔︎ Laravel | ✘ | ✔︎ Laravel style | ✔︎ PSR-7 |
Middleware | ✔︎ PSR-15 | ✘ | ✔︎ Laravel | ✘ | ✔︎ Laravel style | ✔︎ |
On routes | ✔︎ | ✘ | ✔︎ | ✘ | ✔︎ | ✔︎ |
On Controllers | ✔︎ | ✘ | ✔︎ | ✘ | ✔︎ | ✘ |
Session | ✔︎ | ✘ | ✔︎ | ✘ | ✔︎ | ✔︎ |
Persistant | ✔︎ | ✘ | ✔︎ | ✘ | ✔︎ | ✘ |
Flash | ✔︎ | ✘ | ✔︎ | ✘ | ✔︎ | ✔︎ |
Extendable Backends | ✔︎ | ✘ | ✔︎ | ✘ | ✘ | ✘ |
Data | ||||||
Post Classes | ✔︎ [1] | ✘ | ✘ | ✔︎ | ✔︎ [3] | ✘ |
QueryBuilder | ✔︎ | ✘ | ✔︎ | ✘ | ✔︎ | ✘ |
Post based | ✔︎ | ✘ | ✘ | ✘ | ✔︎ | ✘ |
SQL based | ✘ | ✘ | ✔︎ | ✘ | ✔︎ | ✘ |
Custom Post Meta Fields | ✘ | ✘ | ✔︎ | ✘ | ✔︎ | ✘ |
Theme Features | ||||||
Frontend | ✘ | Bootstrap 4, Bulma, Foundation, Tachyons or Tailwind | Webpack & Laravel Mix | ✘ | Webpack & Laravel Mix | Webpack, Sass & PostCSS |
Page Builder | ✘ | ✘ | ✘ | ✘ | ✔︎ | ✘ |
Custom Meta Fields | ✘ | ✘ | ✘ | ✘ | ✔︎ | ✘ |
Advanced | ||||||
DI Container | ✔︎ PSR-11 | ✘ | ✔︎ Laravel | ✘ | ✔︎ | ✔︎ Pimple |
Service Providers | ✔︎ | ✘ | ✔︎ | ✘ | ✔︎ | ✔︎ |
Database Migrations | ✘ | ✘ | ✔︎ | ✘ | ✔︎ | ✘ |
CLI | ✔︎ Hatchet [4] | ✔︎ Node Based | ✔︎ | ✔︎ Node Based [4] | ✔︎ Galaxy | ✔︎ |
Test Coverage | ✔︎ 89% | ✘ | ✔︎ | ✔︎ 94% | ✔︎ | ✔︎ 92% |
[1] Via required Timber package.
[2] Technically more of a View Composer pattern.
[3] Used for configuration rather than post instances.
[4] Install separately
Key Takeaways
- Laravel has clearly had a large influence across the board, with almost all frameworks being inspired either in their API design or wholesale using Laravel packages to add features.
- Blade and Twig both have a fairly even coverage, with a couple of frameworks providing support for both.
- Approaches to Routing and Controllers differ largely across the board. On the face of it the feature set provided appears similar but the execution is often different (some even feeling more like View Composers than Controllers). There is also mixed support for custom routing vs the core WordPress routes, with some frameworks requiring explicit configuration and others auto-magically upgrading to Controllers.
- PSR standards support is still relatively sparse with only 2 of the 5 frameworks implementing them. HTTP Messages (PSR-7) and Middleware (PSR-15) are probably the most useful to have and it would be good to see this implemented across the board.
- Composer was used across the board. It’s probably about time that WordPress implement this natively!
Wrapping Up
There is plenty of choice when it comes to bringing WordPress into the modern PHP era and that is a great thing! The framework that will work best for you will largely depend on preference and possibly whether or not you also want an opinionated Frontend stack for your theme.
Whilst our personal framework of choice might be a little biased, all of the frameworks we looked at provided significant value and competition will only result in better options for the community as a whole! That said, if you’re currently using Timber but want to explore more of the features shown above, then Lumberjack is the most natural progression as it builds on top.
See something not quite right, think we’ve missed something or would like to see another framework added to the comparison? Drop us a message on Twitter (@rareloop).