I'm creating a public use Wordpress plugin and working on general error handling/logging. I've struggled to find any sort of "best practices" when it comes to Wordpress plugins.
In the realm of regular PHP, it seems good practice to set your error_reporting
, create a custom error handler using set_error_handler
and then trigger_error
to capture/log details about an error. Is this a BAD idea in Wordpress plugins?
In the large number of plugins I've looked at, it seems no one is using this practice, which is why I wonder. Do setting custom handlers like this interfere with other plugins or something? Is there a better way to handle/log errors in a Wordpress plugin?
Thanks!