This plugin is now deprecated as of WordPress 2.3.2. WordPress 2.3.2 has error messages disable by default. This plugin may still be useful for those running older versions.
WordPress by default has error messaging turned on:
function show_errors() {
$this->show_errors = true;
}
It is important to note, that database errors will still be displayed to users even when PHP errors have been turned off. This plugin disables WP DB error messages.
The recent WordPress information disclosure vulnerability demonstrates the potential dangers of having these error messages displayed to the user. It leaks the database prefix and may aid an attacker in further exploitation. In short, for live blogs, you really want this turned off. In fact, I’d suggest WordPress have this disabled by default.
So what we need is a WP action that allows us to turn error messaging off. We can then put this into a plugin.
parse_query - Runs at the end of query parsing.
This is what we want. Once a query has been executed we turn error messaging off for that query. I wrote a quick proof of concept plugin to test this.
The plugin wpdberrors is available here. There may be a better way to do this, suggestions and feedback welcome.
The latest versions will be released as ‘bs-wp-noerrors’ to remain consistent with other BlogSec projects.