Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 146 of 427

WordPress Plugin Design: Namespaces and Autoloading

WordPress plugin design is not something that we often read about explicitly, is it? Instead, we often talk about functionality, performance, and things like that (not that they are unimportant, but they are just one part of the conversation).

When it comes to WordPress plugins, the functionality one offers may range from very small to incredibly large. And this is how it is with almost any type of product, isn’t it?

WordPress Plugin Design: WordPress Plugins

“Plugins extend and expand the functionality of WordPress. 46,537 plugins with 1,392,817,734 total downloads are at your fingertips.”

Sometimes, I think we have a tendency to want to say “focused, and lean” with smaller plugins as if a larger plugin can be described as such simply because of its nature.

But that’s not true.

There are very small, well-built plugins that offer one or two features. And there are large plugins that are also well-built that offer a plethora of features. On the flip side, either type may also be unfocused, cobbled together, and may be anything but what we’d like it to be.

When you look at the landscape of all that’s offered regarding WordPress plugins, it raises a few questions (at least from a developer’s perspective).

I’m going to cover them all in this post, too! Or not.

But seriously, one of the things I’ve been thinking about is this:

At what point do you begin organizing your code, so it includes namespaces, autoloading, dependency management, and other such features that take it beyond a collection of classes or functions?

This implies a lot about a given hosting environment and a developer’s level of familiarity with PHP and experience with other tools, but that’s secondary to the question (and I’ll cover all of that momentarily).

Continue reading

Custom WordPress Administration Pages

Creating custom WordPress administration pages isn’t always necessary if you’re going to use something like the Settings API. But if you’re working on a feature for a plugin or something that extends WordPress core in a way that requires more flexibility, it’s something that may be useful.

Custom WordPress Administration Pages

In some respects, it gives you more control, but you may also need to work on writing your system for displaying messages in the administration area, handling sanitization and validation, and so on.

It’s a lot to consider, and there’s a variety of use cases. In my latest series on Envato, I begin walking through some of the foundational requirements for working on custom WordPress administration pages.

Continue reading

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

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑