Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 85 of 258)

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

A Primer in Bash for WordPress Developers

Now and then, I end up installing a piece of software via Composer or that places some of its binaries in directories other than the usual places that macOS expects to find them.

That is, if you’re running an app from within Terminal or that an application with a GUI expects to be in a certain location on disk, then it’s likely going to expect it in one of five places:

  1. /usr/bin
  2. /bin
  3. /usr/sbin
  4. /sbin
  5. /usr/local/bin

But, as I said, over time we end up installing things using third-party tools, or we end up installing things that place binaries outside of one of these directories.

Case in point: What happens if you want to install WP-CLI globally? Or what if you want to use a version of MySQL that ships with MAMP?

In those cases, those binaries are not going to be included in any of the aforementioned directories. When that happens, you have to modify your profile. If you’ve never done that, it can be daunting. And it can get messy if you don’t do it methodically over time.

So here’s a primer on Bash for WordPress developers for what your bash_profile is and how to manage third-party software with it.

Continue reading

How I See WordPress (In 2017): Apps, JavaScript, & Tools

When it comes to the content of this blog, I try to focus on a handful of distinct areas:

  1. WordPress Development
  2. Business
  3. Blogging
  4. Resources

And sure, there are some other things that I’ll occasionally share but I don’t often venture outside of that. I’ve my reasons but one of the reasons that I don’t bother offering any type of social commentary on the state of WordPress is simple:

Perhaps those reasons are two sides of the same coin but the point remains. In the last few weeks, though, there have been a few things I’ve been reflecting on primarily as it relates to my career, the status of WordPress, and some of the other things that are related to all of that.

And since I know I’m not the only one that works in this industry, and that sees how certain things are playing out, I thought it worth at least sharing how I see WordPress regarding some of these things.

Here’s the disclaimer: This particular post is not a dramatic take on anything hot that’s happening in WordPress, so if you’re looking for some type of gossip or some firestarter, go elsewhere.

Continue reading

PhpStorm for WordPress Development: A Few Reasons

Yesterday, I shared this whole little mini-rant about all of the various IDEs I’ve tried (like Coda, Atom, and Visual Studio Code) over the past few years.

You can click through to read the whole thing, but this gist of it is that I’ve tried PhpStorm off and on for years, but it was never at a point that I enjoyed using it until the latest release (being 2017.1).

Using PhpStorm for WordPress Development: PhpStorm 2017.1

I think it’s important that if you’re going to be living in an IDE for a long project, let alone the majority of your day, it’s important that…

  • you’re comfortable,
  • that you enjoy it,
  • that it stays out of your way,
  • and that it helps you get stuff done well.

But if it’s slow and it’s in your way, and the interface is no good, and it’s generally all of the above things are not, then what’s the point of using it? So yes, I’ve been willing to sacrifice some of its power for lighter editors because I didn’t like how it handled certain things.

But that’s not the case anymore.

And originally, this post was going to be about how to achieve something within the context of PhpStorm. But I thought it might be worth doing some type of introductory post as to why I’ve finally started using PhpStorm for WordPress development in my day-to-day, why I’m [finally] enjoying it, and some other resources you may find useful.

Then I’ll get back to my usual “here’s how to do stuff using it” or “here’s how to do something in WordPress” type of posts.

Continue reading

WP_Query Readability Improvements (For Maintenance)

Working with WP_Query, especially when you’re doing some custom work outside of the usual “get some posts and display them on a template” can be powerful. This is especially true of some of the advanced arguments (like using WP_Meta_Query, for example).

It’s also kind of nice that setting up the process has a standard way of doing things. Namely:

  1. Define the arguments,
  2. Instantiate WP_Query,
  3. Check if there are posts,
  4. Loop through them,
  5. Finish Them.

But if you get to where you’re doing any advanced work such as working with a custom post type from a third-party solution, having to sideload media, determine if something exists before actually doing any work with it, then it can be a little more complicated to work with, can’t it?

I’ve found that, like with anything in programming, breaking it down into much more readable modules (or functions or pieces or whatever you’d like to call them) can make it much easier to work with.

So here’s one way that I go about working to make WP_Query readability improvements in a variety of the stuff I’ve done lately.

Continue reading

Project Guardrails: Writing To Production

In the past few articles, I’ve talked about a couple of things (saved for actually writing to production) that help to run a successful project:

  1. The dangers in “design by committee,”
  2. Considerations for provisioning an environment.

The last thing I want to address the learning I’ve experienced thus far is about maintaining the proverbial keys to the kingdom of writing to production and why that matters.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑