Software Engineering in WordPress, PHP, and Backend Development

Author: Tom (Page 107 of 427)

WordPress Queries with IN Clauses (Who Knew)?

A little over a year ago, I wrote a post on how to use WP_Meta_Query whenever you have a set of keys you want to use to help pull back information from the database.

What about the case, though, when you have a number of different keys that would result in creating a really long array for the WP_Meta_Query class? For example, what if you had to loop through a collection of data before even setting up the query?

On some level, it might feel that like the natural thing to do would be to:

  1. iterate through the collection of keys,
  2. dynamically build up the results,
  3. combine them into a single result set,
  4. then work with whatever you’re given.

But doesn’t that sound a bit cumbersome (let alone slow)?

When it comes to using the WordPress API, I do what I can to stick to it before talking, say, directly to the database but there are also times where it makes sense to write a raw query than to write some type of clever code just to get the WordPress API to work. Continue reading

An Option for a PhpStorm WordPress Theme

Since talking about making the switch to PhpStorm, I’ve gotten feedback:

  • from “the first thing you need to do is to change your theme,”
  • to “what’s one of the first things I should learn.”

And I think all of that’s great because the whole point of starting off with a post about PhpStorm in general – as I have with other editors – is simply start from the ground up and show others how I’ve opted to setup my environment.

Obviously, this doesn’t mean that I think that choices I make are the ones others should make. But, at the very least, it gives an idea as to some of the tweaks I’ve made and as to why.

Over time, I’ll get into more technical things that I’ve chosen to do but, for now, I thought talking about the theme – a PhpStorm WordPress Theme, perhaps? – that I’ve been using as a place to start.

Continue reading

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

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑