Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 38 of 258)

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

Tools for Writing Better WordPress Code: Composer

Although I think the title of this series and the articles for each are clear enough, there are other things I’m aiming to do with this series in contrast to the other series I’ve written up to this point, too.

Specifically, two of the things that I’m trying to do is to two:

  1. keep each article relatively succinct (in comparison to how previous articles have been),
  2. focus on one thing at a time and keep the description of it short.

Since this is membership content, I don’t mind it being a bit longer than usual, but I also don’t want it to be so long that it’s hard to follow. I’d rather it be a short read with something practical that you can implement after reading each post.

And one of the things that greatly helps with writing better WordPress code is Composer.

Continue reading

Finding the Destination of a Redirect with PHP

Recently, I was working on a project that was communicating with a third-party API that, like many APIs, sends back a lot of data part of which includes a URL for the product associated with the API.

The thing about the API that was being returned was not the proper destination URL. Instead, it was a URL that ultimately redirected to another URL.

So imagine hitting, say, acme.site-info.com and having it direct to acme.com. We do this manually all the time, but I needed to get the actual – or the final – destination of the direct from the URL.

And finding the destination of a redirect with PHP is easy; however, this does assume there’s only a single redirect.

Nonetheless, here’s how to do it.

Continue reading

Time Off 2019: Part 1 of 4 of Social Media Sabbaticals

It’s been a while since I’ve published anything on a Monday (I don’t know if that’s notable or not but, as I’m writing this, it came to mind 🙃).

But since today officially starts the second quarter of the year it’s that time in which I also opt-out of social media, for the most part, and recap some of the things I’ve done and plan to do over the next month.

For those who haven’t read about this stuff before, you can see what I did last year in the following posts:

  1. The First Social Media Sabbatical of 2018
  2. The Second Social Media Sabbatical of 2018
  3. The Third Social Media Sabbatical of 2018

Every time I end up taking time off of social media in general, I never regret it. At the same time, I also find new things I want to do during that time.

And, this time, one of the things (among others I’ll discuss in a moment) is I want to work on really slimming down on the number of applications I have installed on my mobile device.

I’m already pretty good with managing my time (thanks to Screen Time and turning off notifications), but I have a good friend who said it like this:

I’m trying to Marie Kondo the number of apps on my phone.

And I liked that. So that’s part of what I’m planning to do over the coming month.

But that’s not all.

Continue reading

Privacy is Hard: Web Browsing

Two weeks ago, I started talking a bit about my concerns regarding privacy – which may be the same as yours – and decided I’d start running down a list of things that I’m trying, using, and doing to adhere more to privacy-centric software and services.

Here’s the thing though:

  • what I’m comfortable with using may not be the same for you (and vice versa),
  • and privacy and security are not terms that I use interchangeably.

Going into this series, I want to make sure I’m working off of a consistent definition of privacy. You can see the whole definition here but for the purpose of these articles, I’m going to be using the following:

Privacy grants us freedom from the public; concealed.

So any service that compromises that definition on any level would be something that violates privacy. Furthermore, it’s hard to find things that are purely private is near impossible so we have to make tradeoffs.

And I’m going to lead with that.

Continue reading

Tools for Writing Better WordPress Code: Introduction

Over the last few years, I’ve talked a lot about the nature of code quality and various tools, processes, and libraries that I recommend using when it comes to writing code for WordPress.

I’m also open that that majority of the work that I do is in backend development. This means that I work predominately on WordPress plugins using object-oriented programming and don’t work much with templates nor as much with front-end technologies.

It’s by choice, and I’m really happy with where I am. But I digress.

If you’re in the business of doing the same thing (or doing it as a hobby), it’s not just about writing the code. It’s about having proper tooling in place.

I’ve alluded to a few in these in previous posts, but I’ve not walked through the tools I use and the set up I use whenever I’m building a solution for myself or someone else.

At least not in an organized manner.

In this series, I’m going to do exactly that:

I’m going to cover the tools I use, the libraries I use, and how I use them.

Ultimately, the goal is that those of you who read this can incorporate them in your day-to-day work to write better code.

Continue reading

« Older posts Newer posts »

© 2026 Tom McFarlin

Theme by Anders NorenUp ↑