Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 111 of 428)

Rapid Prototyping with WordPress: Concept Analysis

In the previous post, I started walking through the process of taking the idea for a plugin that rapidly prototyping it into something that works within WordPress. And though it works, it doesn’t necessarily follow any object-oriented principles, nor is it in a place that we can easily continue to add features.

No, this isn’t an argument for why object-orientation is better. It happens to be my preferred way of writing code so I’m approaching it this way.

I know that the example code I’m giving is simple and I know that a case can be made that something like this can be left as it is. But the point of this is to show how to take a concept, prototype it, and then move it into something that follows object-oriented principles.

And, in my experience, it’s much harder to do that with a complex example from the outset. if you lose readers from the beginning, then what hope is there for them to understand what’s coming?

So with that said, we’re going to take a look at the code from the previous post and do a bit of a concept analysis on it to see what might work well within a class and how we might begin to organize it using classes, namespaces, and so on.

Continue reading

Rapid Prototyping with WordPress: From Concept To Plugin

I’ve talked about using WordPress as a tool for rapid application development in a past article.

But the longer I work with WordPress and the more code I see, the more potential I realize it has as both a platform for rapid prototyping and then taking those prototypes to fully developed applications.

These plugins can be web applications, plugins, themes, websites, whatever. For the purposes of this post, it doesn’t matter. Instead, what matters is that for example:

  • you have an idea for a plugin,
  • you want to see how it might work within WordPress,
  • you quickly put something together,
  • you begin refining it.

For many who are getting involved for more serious WordPress development, I thought it might be worth taking a look at what this looks like. Namely, I’ll take an idea for a plugin, prototype it, and then refine it into a well-organized, object-oriented plugin.

So in the next series of articles, I’m going to walk through that process.

Continue reading

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

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑