KAGG Compatibility hides the PHP notices and deprecation messages that WordPress core, plugins and themes produce on newer PHP versions. WooCommerce, Jetpack, Gravity Forms and other popular plugins emit many of them, mostly from the Action Scheduler library. The plugin silences only the folders you list, so the messages of your own code stay visible. KAGG Design develops the plugin.
Features
- Hides deprecation messages, notices and warnings, including the user-level ones raised with
trigger_error() - Only from the folders listed under Settings → KAGG Compatibility: any WordPress core, plugin and theme folders. The default list covers the core, popular plugins and common libraries, and one button brings it back
- Errors from other code are not hidden, which helps to debug your own code
- On activation, it installs the error handler as the mu-plugin
kagg-compatibility-error-handler.php, so it starts before any plugin or theme - Works alongside Query Monitor, Action Scheduler and plugins with error handlers of their own, such as WPForms and Uncanny Automator
- Tested with PHP 8.6 and WordPress 7.2
Links
- The plugin on WordPress.org, with the description and the support forum
- The repository on GitHub for technical discussion and suggestions
For developers
The list of folders goes through the kagg_compatibility_dirs filter, and the error levels through kagg_compatibility_levels. The handler starts while the mu-plugins load, so add the filters in an mu-plugin whose file name comes before kagg-compatibility-error-handler.php in alphabetical order. To switch the handler off, for example while debugging, define KAGG_DISABLE_ERROR_HANDLER as true in wp-config.php.
// Also hide messages from a library outside the default list.
add_filter(
'kagg_compatibility_dirs',
static function ( array $dirs ): array {
$dirs[] = WP_CONTENT_DIR . '/lib/legacy-sdk/';
return $dirs;
}
);
// Keep warnings visible: hide only deprecations and notices.
add_filter(
'kagg_compatibility_levels',
static function (): int {
return E_DEPRECATED | E_USER_DEPRECATED | E_NOTICE | E_USER_NOTICE;
}
);