Software, Development, and WordPress

Category: Articles (Page 1 of 234)

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

It’s Okay to Write a Kludge, Sometimes

TL;DR: Don’t avoid writing a kludge of code when the situation necessitates it. Sometimes, factors outside of our control dictate how quickly we can turn a solution around. At the minimum, leave a code comment that explains what the code does and optionally why it’s not included in a way that’s as consistent with the rest of the module in which you’re working.


When I first started in my career (as I imagine most people in our industry do), I was bent on writing the best solutions possible to the problems that I was given.

Nevermind that fact that I may not have had the experience of my peers, managers, or so on. I was bent on making sure that given the level of information I had, I was going to write the best code possible and aim to both prove myself but to show what I was capable of doing.

I was young. 🤷🏻‍♂️

Fast-forward over a decade, and things have changed.

Continue reading

Learn JavaScript, Forget PHP?

The landscape of WordPress has changed.

time lapse photography of green field and clouds

A few years ago, we were all tasked with learning JavaScript deeply and rightly so. With the advent of Gutenberg and projects like Calypso, it’s obvious that JavaScript is becoming a dominant force in WordPress (not to mention the web as a whole), if you don’t consider it to be so already.

And for anyone who has read Coding Horror within the last decade or so, you’re likely familiar with Atwood’s Law:

any application that can be written in JavaScript, will eventually be written in JavaScript.

Jeff Atwood

But as this has happened, it seems as if its created a clearer divide between what constitutes a front-end developer and a back-end developer in the WordPress economy.

Personally, I welcome it as I find myself even more eager to learn, grow, and work on the back-end as PHP grows and changes. But that’s just me and there’s more to examine.

Continue reading

How To Change Local By Flywheel PHP Settings

If you’re using Local by Flywheel to work on your projects, there may be times where you need to make customizations to the PHP configuration when the site starts.

Before getting started, note the following:

  1. At a high-level, Local will start a containerized environment,
  2. A containerized environment will have its own set of configuration every single time it starts
  3. This means that you cannot change any configuration to the OS-level installation to achieve the changes you need.

So what do we do?

Continue reading

Resolving PHP and PHP CodeSniffer Errors

macOS is still shipping with PHP (though how this looks for future versions of the OS is likely going to change in some way.).

Anyway, imagine you’re in a situation where you’re working on a project that requires three different components:

  1. PHP,
  2. A set of coding standards,
  3. PHP CodeSniffer that work with said coding standards,
  4. The inability to properly see results of sniffing the code either in your terminal or your IDE.

When this happens, this is almost always a result of a version of PHP, the version of the various dependencies, and making sure they all play well together.

In short, it’s about making sure the tools like PHP CodeSniffer work well with the same version of PHP you have installed. And in this case, the latest and greatest isn’t necessarily the best course of action.

It is, however, close. And in the following steps, you should be able to get everything working exactly as needed for your specific set up.

Continue reading

Going Nuclear For Unalloyed Benefit

Before I Start

The longer I’ve kept this post in draft, the more work I’ve been doing to try to edit it to make it sound better than it actually does. And one of the things I dislike about blogging for myself, at least, is when I spend too much time trying to write something that doesn’t really sound like me.

And that’s what this post is in danger of becoming. So forget about it. For the sake of hitting publish, I’m going to share what I have and then go with it. No perfect time like the present to hit publish, I suppose.

Okay, Let’s Go

A couple of weeks ago, I came across the phrase “unalloyed benefit” when reading this post:

No half measures here; ditch your habits without abandon and only add back in the things that contribute an unalloyed benefit to your life.

Cal Newport

“Unalloyed benefit,” I thought. And kept thinking. That sounds good. I want that (or at least to aim for that). But here’s the self-deprecating truth: I’d never read those two words together.

  • Unalloyed: Complete; unqualified.
  • Benefit: Something that promotes or enhances well-being; an advantage.

Yes, please.

But let me back up for a moment: It’s been a long time – in Internet time, at least – since I’ve written anything here. That’s a bummer for me because it’s something I really enjoy doing.

Further, it’s been a while since I’ve written a a long-form post. Granted, I try not to do that since it either comes off as rambling, too long, or not as interesting. And maybe this is going to be the same or maybe this is the exception or maybe it’s one of those Schrödinger’s posts where it’s both – its state just depends on who you are.

Further, I was going to publish this in September but there’s no real compelling reason to do so. So here it is.

Continue reading
« Older posts

© 2020 Tom McFarlin

Theme by Anders NorenUp ↑