When I was getting started in web development, I remember how conceptually overwhelming it was to understand the whys, whats, and hows around things like unit testing. And to make it even more difficult, WordPress was the environment in which I spent most of my time — a platform not... Read It
It’s a well-established truth of the universe that JavaScript’s Array.prototype.map() is one of the best parts of the language, allowing us to write cleaner, simpler code to manipulate array values, instead of using something like forEach().For example, let’s say we want to create a copy of an array with values... Read It
Hearken back, for a moment, to what it was like merging objects in 2014. There was no support for the feature in JavaScript runtimes themselves, and it was quite common to find a solution to the problem by wading through StackOverflow to find something like this:Despite the advancements JavaScript has... Read It
For quite some time now, I’ve been working with a PHP application that, up until recently, had no clearly-defined coding standards in place. At some point, the decision was made to enforce PSR-2, and to do so at an incremental level. When a file is touched, format to PSR-2.To do... Read It
I’ve often needed to quickly spin up a local instance of MySQL. Docker Compose this makes it stupid easy. Rather than running a long, convoluted docker command, I can configure an image just the way I want it while maintaining the ability to turn it easily turn it on and... Read It
A while back, I wrote about building your own lazy loading functionality into WordPress. In that post, I use a regular expression to add a lazy-load class to image tags that don’t already have any class.It failed. Rather than adding it to images with no preexisting class, it was added... Read It
Resource hints (preload, prefetch, prerender, etc.) have breathed some fresh life into the front-end performance game, especially as browsers are coming to support them more & more. For a traditional server-rendered application, a lot of these hints are pretty straightforward in terms of knowing when to implement them. For example,... Read It
It’s easy to rattle off a bunch of ways you can improve the performance of your website: minify your CSS & JS optimize your images cache the crap out of it use a CDN etc. Those are all important, but there’s also a more modern, less-discussed approach that can almost... Read It
If you’ve spent 20 seconds in WordPress development, you’ve likely worked with, cursed, and fallen in love with the WP\_Query class – one of the most useful, commonly used tools in any given WordPress website or application.Aside from being responsible for the main query on any given page or post,... Read It