Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 111 of 427)

Business Foundations: Scaling a Small WordPress Shop

Lately, there seem to be more and more articles published online that try to cover reasons for why companies should let their employees work from home. Case in point.

On the flipside, there are other articles that are talking about more intensive and more frequently performance reviews. They’re also being called “The Neverending Performance Review.” Case in point.

As a disclaimer, having worked in the corporate world I understand both sides of this.

  • I had the freedom to work from home as needed, though not every day,
  • Performance reviews were done quarterly.

But in the last six and a half years, I’ve been working exclusively from home and I wouldn’t have it any other way. And it terms of performance reviews, I don’t have any real employees (though I do have some great contractors, for what it’s worth) for which I’d administer a performance review.

So I think those articles make for some good reading. I also thought that as I continue to try to write about running my own business within the WordPress space, it might be worth sharing my personal experience on slowly laying business foundations.

Maybe it’ll just be informative; maybe it’ll help others in a similar situation.

Continue reading

What Are WordPress User Caches?

If you’ve ever worked on a project when you need to work with WordPress authentication cookies, then you’ve likely stumbled across the wp_set_auth_cookie function. In short, this function:

Sets the authentication cookies based User ID.

And when you use this function, you’re essentially creating a cookie that’s used to authenticate the user to log into WordPress.

WordPress User Caches

But if you’re looking to authenticate a user with WordPress programmatically, then there are a few extra steps required to do it properly especially if you’re working with caching plugins.

And that’s where WordPress user caches come into play.

Continue reading

Repository Pattern Benefits: Why We Should Consider It

Yesterday, I gave a primer on the repository pattern. In short, it’s one of those patterns that I think anyone working on middleware built on top of WordPress should understand.

When giving a primer on a pattern like this, it can be tough to do justice to the pattern when you need to:

  • introduce it,
  • explain how it works,
  • cover the benefits,
  • and give a small demo.

But the real advantage to the repository lies not only in abstracting the data layer away from the rest of the application but that it can (or should) be able to be easily swapped out with various data stores without changing the API.

For example, in one instance, you may need to retrieve data from the WordPress database, in other cases you may need to retrieve something from a third-party API, or perhaps there’s some other place from which you need to retrieve data.

Regardless, the idea behind the repository pattern is that whatever sits behind it doesn’t matter so long as the API it provides works for the layer of the application calling into it.

And since we’ve covered a primer on the repository pattern, let’s take a look at some of the repository pattern benefits and how we can implement it in the context of WordPress projects.

Continue reading

The Repository Pattern Primer

Whenever you’re working on a larger project that’s based on WordPress, the odds that you’re going to be working with more than a single data source – that is, the WordPress database – are higher than normal. For example, you may be working on a project that has to coordinate information from:

  • the WordPress database,
  • a help desk ticketing system,
  • a content importing system,
  • another third-party API,
  • and possible more.

And when this happens, it can become a bit cumbersome to write code that makes it easy to retrieve information from those different places. This what developers usually talk about when they refer to dealing with “layers” in their application. That is,

  • there are layers for presenting information to the user,
    layers for handling business logic (or domain logic),
  • layers for communicating with APIs,
  • and layers for storing data.

Honestly, you don’t have to have a variety of data stores to watch to create a layer that makes it easier to send and retrieve data from the database, that’s just when it’s more common. You can just as effectively work with a single data store, like the WordPress database, when implementing the repository pattern.

Regardless, if you’re building a larger website, web application, or plugin, implementing the repository pattern is something that can pay dividends in maintenance, clarity of code, and separation of concerns.

But how might this be implemented within WordPress? It’s not terribly challenging, but first, it’s worth reviewing a repository primer before jumping into any code.

Continue reading

Managing Work on Vacation (Managing The Tension)

Two weeks ago, I was on the first major family vacation my family, and I have taken since we’ve had kids. This isn’t to say we haven’t taken trips, gone to the beach, and things like that but we haven’t done anything quite like this.

In short, we spent a week at Disney World – and that’s fun, sure – but when you see it through the eyes of a five-year-old and a three-year-old, nothing can top it.

Managing Work on Vacation

My girls seeing the Magic Kingdom for the first time.

And it’s not even that I’ve never been there before, you know? It’s when you go and experience all of the attractions with your kids who have seen all the Disney movies, cartoons, etc., and then getting to see things like that come to life.

The purpose of where I’m going has doesn’t really have to do with the details of our trip. Yes that was fun and yes I’m glad I went, and we’re already talking about going back before our youngest is too old to get into the magic that comes with visiting the place.

But there’s a whole thing about trips like this that are directly related to balancing work-family-life, right? Ultimately, it has to do with managing work on vacation and the tension that comes with it specifically if you’re self-employed (because that’s what I know).

I doubt I’m going to share anything new, but I thought it might be worth sharing my personal take on what it was like to completely disconnect for a week and what it was like coming back to all things waiting.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑