Home » Blog » CakePHP and WordPress

CakePHP and WordPress

I’m not too fond of WordPress and yet…

Most of the websites I have built are using WordPress.

The reason I am using it is simple: The final customer enjoys the ease of use that WordPress provides. It empowers them to maintain the content of the website and (to an extent) manage the website themselves.

WordPress is excellent for what it was built for: a blogging platform. As soon as you begin to “add on” to it and make it into a complex web-application, things break down in terms of performance, stability, and security. It pains me to see how every plugin is downloading its own set of libraries and code, creating an app, with-in an app, with-in an app.

This problem shows up because each plugin developer has to make sure that all the code they need is there, and they don’t know if you have it from other plugins. So the code base gets fatter and fatter with duplicate code, and the website gets slower and slower.

Maybe in the future, the core of WordPress will be re-written from scratch to address these issues and to have a shared library folder or use some dependency manager (like composer).

In contrast, for the more complex web applications, I have been using CakePHP. The reason: I love Cake, and I like PHP!

Joking aside, CakePHP is a framework that allows rapid application development using modern design and technologies. Because it is a framework and not a full app (like WordPress), there is much flexibility on how you want to do things, what libraries you want to use, how do you want to integrate it with the rest of the world, and so on. This approach makes for much cleaner logic and code and better performance.

The downside is two-fold:

First, the customer needs a tech person to maintain a CakePHP app. There are no simple “update everything” buttons.

Second, for better or worse, you lose the considerable plugin ecosystem that WordPress has to offer. And some plugins are super useful, like Yoast SEO.

The Best of Both Worlds

(no, this is not about the Star Trek episode)

What I have ended up doing in some cases is to have a CakePHP app developed alongside the WordPress app for the clients that agree to have me as their tech person. This setup allows them to use WordPress for more frequent and simple tasks and enables me to deploy the power of CakePHP to manage automation, monitoring, and reporting for their business. Win-win!

Case Study

For a big WordPress site where things needed not to break down, and that specific metrics are met every month, I have developed a custom CakePHP app to monitor the WordPress site. It would generate charts and analytics for sales, visits, engagement, and other metrics. It would issue alerts when needed and generate reports daily, and monthly that would make it easier to diagnose any potential problems.

Yes, everything could have been written in WordPress as a plugin, but that would have meant making a fat code base even fatter, and it would have linked the two very tightly. Having a separate application allows me to update them separately, and if one stops working, it does not upset the other. A side benefit that I got, later on, was that the same app could link into other WordPress (or Joomla!) powered website for aggregate data reporting.

If you have the skill or the resources to hire the skill, it may be worth considering creating your custom development in CakePHP instead of WordPress.

If you’re interested in the technical details, leave a comment, so I know to write about it.

Looking to learn more about CakePHP?

Michael from Toptal wrote an excellent review of CakePHP 3.x, and it only gets better with CakePHP 4.x. And if you’re starting from scratch, you may want to look into Laravel first. I am an “old-timer” when comes to CakePHP, but I see how some of the decisions at Laravel feel more modern and are a good choice for more complex apps.

Leave a Reply

Your email address will not be published.

seventeen + thirteen =