Steve Grunwell

Open-source contributor, speaker, and coffee snob

Announcing WP404

I’ve been behind on announcing new projects, but I wanted to make sure I shared this one: WP404 is a framework for capturing additional information and details about WordPress 404 errors, packaged as a WordPress plugin.

The plugin was born out of a need to capture tricky, time-based 404s on a client site. I figured I could either throw something together quickly on the client’s dime or spend my lunchtime and evening building something the community could use. Guess who didn’t want a half-assed tool??

At its core, WP404 is a library of “reporters”, callbacks hooked onto the “wp404_report_data” filter. Each reporter is passed the current $report array, as well as the current WP_Query object. At the end, the $report array is sent to the PHP error log for diagnostics.

Building custom WP404 reporters

There are a handful of reporters built-in, but the power of WP404 is that it lets you write whatever reporters you might need:

Obviously the more you’re logging, the bigger your logs will be, so be conservative in how you use WP404. It’s not meant to be a “pedal to the metal” plugin all the time, but when you’re trying to track down mysterious 404 errors it can be a tremendous help.

Contributing to WP404

Naturally, WP404 is available on GitHub under the MIT License, and contributions via pull request are more than welcome. There are no plans at this point to submit the plugin to WordPress.org (it uses PHP namespaces, which aren’t supported by servers running old versions of PHP, though if you’re still on PHP 5.2 stop what you’re doing and upgrade/move your site!), but it should run swimmingly on servers running PHP 5.3 or higher.

Previous

Walking Columbus

Next

Software for the Greater Good: Apretaste Brings the Internet to Cuba

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Be excellent to each other.