Tom McFarlin

Software Engineering in WordPress, PHP, and Backend Development

Page 86 of 427

Using PHP Coding Standards in Visual Studio Code

So we’ve got the basics set up in Visual Studio Code set up, but we don’t have any practical tools installed to help us with more of the professional side of writing code.

Of course, “professional” can be defined based on the company, team, or environment in which you’re working. For this series, I’ve opted to go with WordPress as the foundation. But that still leaves things such as:

  • coding standards,
  • JavaScript linting,
  • package management,
  • And so on.

And throughout the series, I’m going to cover everything listed above. But to do so, I’m going to cover each component one-by-one.

Today’s post is going to focus on the PHP coding standards. I’ve written plenty of material regarding the WordPress Coding Standards, but in the last year or more, I’ve begun to work more with PSR, and so that’s what will be covered in this post.

As a side note, know that much of what is covered can be translated to the WordPress Coding Standards should you so choose, and it’s going to be clear as to where you’d make the changes.

With that said, let’s get started.

Continue reading

The First Social Media Sabbatical of 2018

A couple of years ago, I started time a little bit of time off of social media here and there just to see what it was like (mainly because it had become such a staple in our lives). I wrote about this a bit last summer, too.

Then, back in December, I took the month off of pretty much every social network of which I was a part and thoroughly enjoyed the time away. But it wasn’t because of anything such as removing myself from something bad.

In fact, it just gave me (that is, not you or anyone else, but for me), room to think.

This isn’t to say I don’t enjoy hanging out with those of you I chat with online on a near-daily basis because I do, nor am I say that using social media is bad because I don’t think it’s an all or nothing thing.

But I do think that there is something to having a social media sabbatical now and again whenever it’s needed. And I’m personally at that point right now.

I know I’m not the only one who deals with this kind of stuff because I’ve talked with enough people to know. So I thought I’d write, again, about it, why I’m doing it, and what I plan to do with the time off.

Continue reading

Working with User Settings in Visual Studio Code

If you’ve not read last weeks post (and you’re a member of the site), then I urge you to do so now as this one picks up exactly where the previous one left off.

In short, we’re going to start talking about configuring Visual Studio Code for professional WordPress development. Of course, that raises a question: What is professional WordPress development?

If you ask ten different people, you’ll probably get 8-10 different answers; however, I’d define it as using professional software development practices within the context of WordPress.

Naturally, right? But what does this entail?

Off the top of my head, I think of:

  • Using proper dependency management tools such as Composer, NPM or Yarn,
  • Debugging using breakpoints (over var_dump and echo),
  • Knowing how to format code using a given standard (PSR in the case that I’ll be using),
  • File organizational structure,
  • Using things like Sass, JavaScript linting, and so on to ease development

But before getting into all of that, I think it’s important to get the IDE set up in such a way that looks good, plays well with the way that we want, and that we understand how it works so we can further tweak it as the need arises.

So in today’s post, we’re going to look at exactly that: Understanding how Visual Studio Code manages settings and a proposed list of configuration options that will help make your experience as solid as possible.

Continue reading

Properly Working with Ajax Requests in WordPress

Whenever you’re working with third-party APIs, and you’re doing so in an asynchronous nature, there is always the chance that whatever it is you’re requesting is going to return a un-desirable result.

Perhaps it’s an error code, perhaps it’s a warning, or maybe it’s a simple message saying something like “We’re still processing your request on our end.”

In each case, you can usually handle them on the server-side just fine and let the client-side know how to handle it. But if you’re dealing with the latter case, that is where you’re blocked by the third-party processing; there are other things you can do to handle this situation better.

For example, in the latter case, it’s better to wait for a little bit then make the request again to see if the API has a different response for you.

But when doing this, it requires Ajax which obviously requires JavaScript. One of the obvious, yet more dated methods of doing this is to use setInterval.

The problem with this, though, is that it creates a stack of requests and then, as the response is ready, each item in the stack will get the same response.

This can drastically impact any given server. And there are better ways to go about doing this.

Continue reading

Getting Work Done at a Team Level (All of Our Software)

Periodically, I’ll be asked about what tools I use to run Pressware. And though I don’t necessarily think there’s a one-size-fits-all solution, I’ve been doing this long enough to where there are plenty of tools I’ve tried, dropped, continue to use, and recommend.

Getting Work Done at a Team Level: Pressware

So I thought it might be worth sharing both some of the digital and analog tools I use to plan my week, get stuff done with a team, and run a [very] small business.

Some stuff I’ve talked about before, others I may have briefly mentioned in passing on Twitter, but I’ll do what I can briefly outline each utility below. And then, perhaps in another post, go deeper with some of the utilities over the others.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑