Handling Polluted JSON in AJAX

5 minute read The bane of all Javascript code using jQuery.ajax() is polluted JSON responses: when some HTML or other junk gets into your JSON response, making it unparsable and bringing the whole system to a screeching halt. In this post, I’ll show what you can do with polluted JSON to keep everything working. How It’s Supposed to […]

Read More Handling Polluted JSON in AJAX

How to Make Horrible Software Comparisons

3 minute read Software comparison articles can be helpful, but most are horrible. They should educate, compare, and recommend. But usually, they’re just filler words that convey no actual meaning. Here are some common mistakes of horrible software comparisons… Universally Picking a Winner It’s ridiculous to pick a universal winner. Eg, if you’re comparing Event Espresso to EventBrite, […]

Read More How to Make Horrible Software Comparisons

PHP's array_shift Performance

1 minute read PHP’s array_shift is a relatively slow way to fetch the first item from an array; it’s much better to use reset. array_shift() modifies the original array and can be pretty slow because it needs to completely reindex the array (remove first element then shuffle everything else forward by one “slot”), so unless you specifically need […]

Read More PHP's array_shift Performance

Getting Started Contributing Code to WordPress Gutenberg in Laragon

7 minute read This post documents how I setup WordPress Gutenberg for local development on Windows 7, using Laragon instead of Docker, and made my first pull request to the project. Most folks wanting to test and modify WordPress’ Gutenberg use Docker to manage their environment. That’s great because it’s especially consistent. But I’ve been happy using Laragon […]

Read More Getting Started Contributing Code to WordPress Gutenberg in Laragon

URL Validation in WordPress

3 minute read If your WordPress website/theme/plugin allows users to submit URLs, and you’re not sanitizing them properly, you could have a whole host of security problems. On the flipside, if you’re removing too much, you might not be allowing valid URLs either. This issue is pretty complex, and there’s quite a bit of confusion surrounding it, but […]

Read More URL Validation in WordPress