This is a quick post today. I had been struggling for a while with strict warnings popping up all over my projects since I upgraded my Vagrant box to PHP 5.4. Your initial reaction might be to fix the strict warnings, and you would be right except when you can’t.
It seems that a lot of very popular plugins and even WordPress core throw strict errors. The temptation then is to turn off WP_Debug to avoid scrolling through a long list of errors that you can’t fix anyway.
Before you do that, let me introduce you to a better way. Simply drop the following code into a blank file in the mu-plugin folder (if you don’t already have one, go ahead and create it).
error_reporting( E_ALL & ~E_STRICT );
It is important that this code be added to an MU plugin for the code to get called after WordPress is done defining the error management and before the plugins are loaded.