Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 58 of 219)

Articles, tips, and resources for WordPress-based development.

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

Latitude and Longitude in PHP: A Few Useful Practices

In previous posts, I wrote a good bit about working with the Google Maps API. Truthfully, I haven’t worked with it since that post.

However, I have had to work with latitude and longitude in PHP, and there are some practices that I’ve begun to use that I think can serve us well when working with coordinates or floating point values, in general.

In the following bit of code, I’ll break down the approach I’ve used and why I’ve done so. But I do want to be clear that if you’re reading this in relationship to the Google Maps API, there’s not much I can offer in the way of how this works and the current version of their API.

Continue reading

On Immutable Values in WordPress Plugins

If you’ve done any work – or even any reading – on object-oriented programming, then you’ve likely come across the idea of immutability. That is the idea of something being unchanging.

Sometimes you can have immutable values, and sometimes you can have immutable objects (at least after they are instantiated).

Immutable Values in WordPress Plugins

The opposite of immutable (but he was my favorite ninja turtle, anyway).

The thing is, the more I work with object-oriented code, the less I tend to work with immutable variables. Sure, I’ll use constants as defined in a configuration file, but you’re not likely to find me storing values within a class as a const.

That probably implies something about me and my abilities, but it’s true. Thankfully, code reviews are great at helping you see opportunities on where to leverage strategies you normally wouldn’t. And such is the case with immutable values in WordPress plugins.

Of course, this is one of those things that was brought to my attention by a friend when reviewing my code.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑