Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 66 of 258)

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

Developing Plugins and Themes Against WordPress Trunk

When developing plugins or themes for WordPress, one of the strategies that I often recommend is doing so against trunk (or the current snapshot of the code) of WordPress.

For those who are more experienced developers, you’re already on the up-and-up on the lingo and the caveats that come with doing this. But if you’re someone who is looking for ways to better their development practices, then perhaps this will help.

Remember that because WordPress is open source software, you can view the source code on the web at anytime.

Developing Against WordPress Trunk: trunk

Not only that, but you can download it to your local computer and work with it, as well. This will require certain pieces of software, and I’ll get into that momentarily; however, the ultimate purpose of this post is to talk about:

  • how to work with the current snapshot of code with WordPress,
  • how and why it may be beneficial to use this codebase when working on projects for others.

As stated above, there are caveats for doing this, and sometimes it’s a good idea to use the latest stable version of the codebase. And I’ll address that later in the article, as well.

Continue reading

Installing PHPUnit in Visual Studio Code

Once you’ve got the PHP Coding Standards set up in Visual Studio Code, I think it’s also important to make sure that you have PHPUnit installed so that you get in the practice of writing testable code.

If you wait to start doing this until after you’ve started a project, you’re far less likely to start doing it. I’m saying this both from experience and from working with other developers.

So before I start covering how to handle front-end linting and things like that, I want to walk through the process of setting up PHPUnit. If you’ve not yet read how we’re managing packages or how we’re using Visual Studio Code, I recommend catching up by reading the following articles:

  1. A WordPress Development Environment (Using a Package Manager)
  2. An IDE for WordPress Development
  3. Working with User Settings in Visual Studio Code

Once you’re caught up, head back to this post.

Continue reading

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

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑