Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 115 of 258)

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

More on Working with CSV Files in WordPress

CSV files are a topic that I’ve previously discussed on this blog. But one of the things that come with sharing information in this format over time is that new information, strategies, or techniques can be learned.

CSV Files in WordPress

This is one of the challenges of others finding old content, isn’t it? But I digress on that.

For those who haven’t read my previous entries, you can see some of them here:

And it’s not that those are irrelevant. I might change a few things here and there, but that’s the purpose of this post. Instead, I want to build on some of the things mentioned above.

After all, working with CSV files in web applications is nothing new, and it’s not going anywhere anytime soon. So why not share some additional strategies that I’ve found useful in making my projects a bit more robust (and see what you have to add to it in the comments :).

Continue reading

Uploading Files to a Custom Directory in WordPress

As it relates to uploading files in WordPress, the CMS offers some convenient API functions that make it easy for developers.

Uploading Files to a Custom Directory

The standard uploads directory in a WordPress installation.

Some of these functions include:

These functions, though, often require us to limit our files to the uploads directory. And many times, that’s great. It gives us a single place to store our files and it gives us one place to retrieve our files when needed.

But if you’re working on a web application or even an advanced plugin, this isn’t always the ideal situation. For example, let’s say that you have a plugin in which you want to have your own uploads directory, and that’s where you want to store your files.

What do you do in that case?

Continue reading

Yet Another Blog (Gotta Go Your Own Way)

This blog has been discontinued and you can read more about it in this post.

The idea of starting another blog seems daunting especially when I try to write for this one on a daily basis. But to say that I enjoy writing is a bit of an understatement.

The other caveat is that I try to be pretty focused on the type of material that I write about on this site. I’ve made some mistakes with this blog, sure, and I’m working on rectifying that especially over this next month.

Several things have come from this blog, though. For example, I get tweets, emails, and other forms of [sometimes creepy but maybe just kidding] messages about how I run my business, how I manage my time, what applications, sites, services, and so on that I recommend.

All of those topics are fun to talk about, but they don’t fit in with the whole idea of “a perspective on professional WordPress development.”

So what am I supposed to do when there’s more that I’d like to write about but don’t have a place to do it?

Continue reading

Singleton Design Pattern and Dependency Injection, Part 3

In the previous two posts (available here and here), I talked a bit about the Singleton Design Pattern, dependency injection, and dependency injection containers.

Singleton Design Pattern as a Dependency Injection Container

Not that kind of container (but it’s still a cool shot).

These are all topics that I think are important for developers to know and to understand. If you’ve not read the previous posts, then I recommend it because the code that’s shown later in this post assumes you know a little bit about each of the topics mentioned above.

Furthermore, this is going to be a bit shorter as it relates to the previous two posts. The purpose is simply to show how to use a singleton as a simple dependency injection container.

Continue reading

Singleton Design Pattern and Dependency Injection, Part 2

In the previous post, I said that I was going to talk about how to use the Singleton Design Pattern as a simplistic way to introduce a dependency injection container into a project.

The Singleton Design Pattern and Dependency Injection Containers

One of the best comments I’ve seen about dependency injection containers comes from Stack Overflow (and Joel Spolsky, even):

IoC containers take a simple, elegant, and useful concept, and make it something you have to study for two days with a 200-page manual.

And there’s a time and a post for where I could digress, but that’s not this post. Instead, there are a few nuances about this idea that I want to clarify before I go any further:

  1. Dependency Injection Containers are more than just ways to store objects. They handle other additional logic. I’ll cover more about this later in the article.
  2. I don’t recommend sticking with an implementation of the Singleton Design Pattern for a container (or for very many things, for that matter).
  3. The purpose of showing this as a strategy is a way to show how you can take a project with a tight deadline, a desire to use software development best practices, and find some practical middle ground.

All of that to say is that what I’m going to show is not what I consider being a best practice for using dependency injection containers.

Instead, it’s a way to “meet in the middle” when it comes to working under pressure for building solutions for others all the while not wanting to sacrifice sound engineering principles.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑