Software Engineering in WordPress, PHP, and Backend Development

Category: Articles (Page 43 of 258)

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

What Are Source Maps (And Are They Needed)?

If you work on the front-end of a site in any capacity – be it for a plugin, a theme, or even something outside of WordPress – you’re likely working with minification tools.

The benefits are obvious, right?

  • it lessens the payload,
  • it allows us to focus on development on our local environments

But one of the features that come with working with these technologies and that’s the ability to generate source maps.

And this raises a question (or maybe two): What are source maps? And are they even needed?

You can claim it’s late to the game to talk about this, but there are always people entering the industry that may not know this material.

So why not cover it?

Continue reading

WordPress Widgets: Refactoring, Part 6

You should be well-versed in the refactoring we’re doing regarding the WordPress Widget Boilerplate. If not, I recommend catching up on the series thus far by:

As far as the code base goes, we’re in a good place right now. We’ve begun to refactor much of the code into smaller, more focused classes. And we’ve just set up a Registry so that we can begin working with instances of objects throughout the plugin without the need for too much coupling.

But there’s still a problem we’re facing and it deals with namespaces and autoloading. I’ve talked a bit about this a couple of years ago but not as it relates to Composer.

And that’s what we’re going to look at in this post.

Continue reading

Writing Loops in PHP: Two Ways; Same Thing

When you’re working with a collection in PHP, most notably, arrays in PHP, there are two ways in which you primarily see the information manipulated:

  1. through for loops,
  2. through a variety of the array functions that PHP provides.

For what it’s worth, I think the array functions provide greater readability but they have been shown to be slower (especially with larger data – with smaller data, it’s naturally going to be negligible).

I often work with for loops and related functions to achieve the same thing but I thought it might be worth look at an example from the previous post and how I used the array functions to achieve the same things as a for loop.

Ultimately, this is is a comparison post but I think it’s good to see how the same code can be written in different ways.

Continue reading

Migrating From Bitbucket to GitHub: The Complete Guide

When it comes to Bitbucket and GitHub, each offers their advantages and disadvantages. I’ve used them both and like them each for different reasons.

Migrating From Bitbucket to GitHub: Bitbucket

But I prefer GitHub for a few more reasons than Bitbucket (the least of which is not that my organization was hosted there). And I like to have everything, more or less, under the same service.

Migrating From Bitbucket to GitHub: GitHub

I’ve spent some time over the past week migrating from Bitbucket to GitHub. I currently maintain two personal accounts:

  • one for myself,
  • one for Pressware.

I’ve opted to downgrade my organization account to a personal account to save money and because I’m more or a less a company of one who occasionally has collaborators.

Various guides online leave something to be desired when it comes to walking through how to go about migrating from Bitbucket to Github, so I thought I’d share my experience for doing that.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑