Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 156 of 427

Get Started Internationalizing WordPress Projects

Internationalizing WordPress projects are arguably more important now than ever. With WordPress’ market share as large as it is, it’s never been used by such a wide audience.

To that end, it makes sense that a project accessible to people all over the world can be translated into the various languages said people use.

I think it’s important to make a clear distinction, though:

  • If you’re working on a project for a particular client and you know that it doesn’t need to support internationalization, then building the project for that specific language is okay.
  • If on the other hand, you’re working on a theme or a plugin that will be distributed in one of the public repositories or marketplaces and has the potential to be used by people who speak a language different than your own, then your should be internationalizing your project.

In the past few years, it’s become easier than ever to internationalize WordPress projects. And in my latest set of articles for Envato, I’m walking readers through exactly how to do it.

Continue reading

Writing Good Git Commit Messages

Git commit messages – actually, any commit messages – are one of those things that I believe start off with the best of intentions.

That is, we tell ourselves that from the outset of a project that this time is going to be different than the last time. Whereas, the last time, our commit messages started off well but, by the end, we’re writing things like:

  • Fixed some things
  • Removed stuff
  • Refactored the function

Sure, this is a bit facetious, but the point is that if you look at commit messages for a lot of projects, they start off far more detailed in the beginning than by the end of the project.

I’m guilty of this, too. How, then, do we stick with good commit messages (and specifically, good Git commit messages, since so many open source developers use that service)?

Continue reading

Object-Oriented Partials in WordPress

Partials in WordPress, regardless of if they are part of a plugin or part of a theme, can help maintaining a project much easier (let alone building a project).

But if you’re working with them to help drive your settings pages or your WordPress administration pages, part of working with them is making sure they are adequately represented on the server-side, too.

Generally speaking, this is usually referred to as the domain logic or may even be thought of as part of the “model” or “controller” code when thinking regarding MVC. Of course, this isn’t MVC, and I’m no fan of trying to apply patterns where they don’t fit.

My point, though, is that I’m talking about object-oriented classes that are responsible for managing data and handling coordinating information rendered in the partials and how the user interacts with it.

Continue reading

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

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑