Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 61 of 219)

Articles, tips, and resources for WordPress-based development.

How I Built It Podcast: Page Template Dashboard

For those of you who aren’t familiar, the How I Built It podcast is a show that Joe Casabona publishes each week. In short, the show features Joe chatting with various people who are building things using WordPress, how they went about it, and other tangential topics.

I think it’s a neat idea for the show.

Coincidentally, I had a chance to finally meet Joe in person last year after (at the Post Status Publish conference) years of conversing online. If you’ve heard him on the podcast, he’s just as friendly in person. And if you’re not following him on Twitter, I recommend it.

That said, I had the chance to be featured on a recent episode of How I Built It in which I talk about one of my plugins (that’s horribly named) and some other related topics.

Continue reading

Singletons in WordPress, Revisited (A Time and a Place?)

Before I start a post talking about using singletons in WordPress (or, more appropriately, the Singleton Pattern), I want to make sure that you read the following two articles:

Both of these articles provide immensely valuable perspective on this pattern and the dangers of using it whenever using it throughout our work in WordPress; however, does that mean we should completely avoid them?

I don’t think so.

Then again, I also recognize that the articles aren’t saying to completely avoid them. They are giving strong cases for how to use them and the dangers of using them should you opt to do so.

And though I’ve definitely used them in the past, I’ve generally stopped. However, I recently came across a use case for a project in which I think it’s acceptable.

Continue reading

The WordPress Economy, Employment, Strategies, and More with WP-Tonic

Last week, I had the pleasure of talking with John Locke and Jonathan Denwood on WP-Tonic to talk about a variety of things regarding the WordPress economy, self-employment, development strategies, observations around the software, along with a variety of other topics.

The WordPress Economy, Employment, Development, and More

Before covering what it is that we covered, I do recommend checking out their library of podcasts.

They’ve talked to people who I think are worth a follow and who are far smarter, accomplished, and have unique insight on a variety of topics in the WordPress space.

Continue reading

On Writing Clever Code with Arrays in WordPress

I don’t know if there’s a standard for what’s considered “clever code,” but I think that if you were to show various code samples to programmers, they’d be able to know it when they see it.

And there used to be a time in my career that I was far interested in writing clever code. But the older I get and the more work I do in maintaining projects, the less concerned I am about writing clever code and the more interested I am in writing code that’s clear and read and thus maintain.

Clever Code with Arrays

Clever code is for the birds. Pardon these stupid puns.

When we work with WordPress, we’re likely dealing with arrays a lot especially given that so much of the internals of WordPress are built on them (yes, there are some objects too, but arrays are pervasive).

What, then, does clever code with arrays look like in WordPress versus less clever code? And furthermore, should we avoid aiming to write clever code?

Continue reading

Registering WordPress Hooks Using Another Class

In yesterday’s post, I talked about a WordPress plugin constructors and the rationale as to why hooks shouldn’t be in the constructor.

Though I mentioned a number of ways to handle hook registration, I didn’t bother to go into details for each of those strategies. As far as I’m concerned, they are deserving of their own article in order to provide as much detail as possible for how to set something up.

For example, one of the methods I shared stated:

  • It’s possible to create a class that maintains a registry of objects and the hooks with WordPress.

In other words, it’s about registering WordPress hooks using an object-oriented approach to decrease coupling and increase cohesion among the components in the plugin.

But what does that even mean? What are the advantage does it bring, how is it setup, and how it used?

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑