I was reading a recent article on WPTavern and thought to myself, “Hey, this is a great little plugin but doesn’t Jetpack already handle this?”

More or less it does but there are a few “local” conditions that may have been over-looked and I thought I would offer a patch to pick up on some of those conditions.

Currently Jetpack looks to the site_url() for its conditional test on whether or not the TLD has a “.” (dot, period, point, etc.) which is all well and fine but what about “.dev” or “.local” or even certain IP address ranges that are considered “local”?

My initial patch was just expanding the existing conditional statement to include the “.dev” and “.local” extensions but after some discussions I also included a filterable case to also be available for the environment test conditions.

Here’s a link to the pull request on GitHub, what do you think?