Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 123 of 258)

Personal opinions and how-to’s that I’ve written both here and as contributions to other blogs.

Partials and Templates in WordPress

Templates in WordPress is a topic that seems to come up for discussion every now and again. There are plugins aiming to make it possible, too. And though I’m intrigued by the idea, I’ve yet to go all in on it.

Timber for Templates in WordPress

That’s a topic of discussion for another post, though.

Over the last few years of writing plugins for others, one of the things I’ve found to be one of the easiest things to do is to separate our views into partials.

Continue reading

Installing PHP CodeSniffer with WordPress

In previous posts, I’ve talked about using PHP CodeSniffer with WordPress, how to install it (in a variety of ways), and why I think it’s important.

In continuing the series on code smells and writing higher quality code for WordPress (by avoiding code smells), I followed-up the initial article with two other pieces. The first article covers a high-level definition of code smells.

The second article, which I outline below, talks about how to install PHP CodeSniffer with WordPress starting from ground zero.

Continue reading

The Clean Architecture and WordPress

For the past couple of weeks, I (along with others in the comments) have been talking about things such as testing, namespaces, and more. When building well-architected, testable, and scalable software, these are all relevant topics.

But they only scratch the surface of some of the many ways in which we can manage project architecture.

Developers have been experimenting (and using) WordPress with a variety of different tooling such as different web servers (like IIS – good luck :) and with different database servers.

And when it comes to dealing with various types of third-party dependencies like database servers, creating a proper architecture is key to making sure your code is portable between environments and for other reasons, such as testing.

Continue reading

What Are Code Smells?

There are a lot of fun terms, like “code smells,” that come up in programming. And though they may have unusual names and make somewhat tedious or boring concepts sound a little more exciting, they can often refer to something that decreases the quality of what we’re building.

At least, that’s the case with code smells.

In a previous post, I’ve talked about using PHP CodeSniffer to watch the code we’re writing to help us make sure that we’re following certain standards, rules, and what not but I’ve not discussed it regarding code smells.

Continue reading

Start Black-Box Testing WordPress Projects

As much as I love how easy it is to create a project on top of WordPress and release it into one of the free repositories, there are certain aspects of development that are neglected.

Case in point: testing.

And though I’ve been talking a little bit about unit testing, there are also other types of testing such as acceptance testing, integration testing, black-box testing, and so on.

Black-Box Testing WordPress Projects

This is not the type of black-box I had in mind.

All of the above are ways that we can go about ensuring a high degree of quality is built into our projects. Sometimes, I think we forgo these things for the sake of shipping something more quickly.

Other times, I think that we neglect to do them because writing tests is not as much fun as actually building a project. In other cases, I think that we opt not to test because we don’t have the proper education around the tooling for how to do so.

Don’t get me wrong: I have a much better track record of writing tests around client projects that I do about some of my public plugins (save for Easier Excerpts and Scheduled Post Shortcut which are done by Eric and myself), so I’m working to change that.

But if you don’t do any other type of testing, I urge you to at least try to introduce black-box testing into your development process.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑