Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 89 of 428)

Working with Classes, Templates, and Partials in WordPress

When I sat down to begin this post, I planned to write something far more involved that I what I’m going to share. Initially, I wanted to walk through one of two things:

  • The Complete Guide To Setting Up a Development Environment,
  • Integrating Code Quality Tools into PhpStorm

The first would be focusing on a variety of other things I’ve talked about, tying them all together, and having a definitive reference. But this is something that I want to take time to put together to make sure it’s done right.

The second is one that I think is important but I’m in a bit of a transitional phase with some of my own tools. Until that’s done, I’d rather not write about it.

Even still, there’s always something to cover, right? So today I’ve opted for something simpler: Breaking down the use of classes, templates, and partials in WordPress plugins using a simple example.

Continue reading

Uploading Files in WordPress Revisited, Part 2 – The Server Side

Before jumping right into the code for this, I wanted to mention two things:

  1. Yes, I’ve covered this in some detail a while back,
  2. And this is the second part of a two-part series.

If you’ve not read the first part, do it first. The idea is that the code will work in conjunction with what I’m going to cover in this post to make sure that both the client-side and the server-side are covered.

Ultimately, the reason for breaking it down like this is not just to make sure that things are done correctly, but also to make sure that the user has the most positive experience possible.

With that said, here’s how to go about uploading files in WordPress on the server-side.

Continue reading

Uploading Files in WordPress, Revisited: Part 1 – The Client Side

Years ago, I wrote about how to upload files in WordPress from the administrative area. This post is practically an update to that post, but it covers new considerations that I make and some other processes that I think are necessary.

For this post, I’m going to work off the example of uploading a PDF file and how also to make it available in the Media Library.

In doing so, I’m also planning to cover some considerations that should be made on the client-side and the server-side as well as things for which to look for whenever someone is transferring information across the wire.

Continue reading

Abstract Classes, Part 1 – Abstracting Behavior

About a month ago, I wrote about one of the pillars of object-oriented programming (specifically being Abstraction). In the post, I defined abstraction as the following:

Instead, we’re going to be abstracting ideas into their classes. And there’s a key idea here: A class should represent a noun.

And though that’s still true, the idea of abstract classes is something that’s different in object-oriented programming.

It sounds confusing, right? That is:

  • on one level, we have abstraction being defined as the idea that we take an idea and represent it in a class,
  • on another level, we have abstract classes which are used to help define functions that subclasses must implement.

And if that isn’t confusing enough, we mix this in with interfaces which provide a contract implementing classes must follow, and then we mix it with abstract classes which define methods that also must be implemented but can also implement methods of their own.

Confused yet? No worries. The whole point of the next three posts is to do the following:

  1. Define what abstract classes are,
  2. Describe the different in abstract classes and interfaces,
  3. Help decide when you want to use one over the other.

With that said, here’s the whole idea behind abstract classes.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑