I\'ve recently inherited a WordPress plugin that has a few bugs in it. My problem is that I\'m also new to WordPress and I don\'t know how to log debug messages so that I ca
According to your comment where you Much rather use a system where debug messages can be turned off and on in one place:
It can be done in WordPress. There is a constant called WP_DEBUG that you can set to true or false from your wp-config.php file in your WordPress folder (that file where you add database parameters
).
So, you can use:
if( WP_DEBUG ){
echo "";
}
The alert will show only when you have WP_DEBUG set to true (for example on a development version of the website like on your localhost) while it won't show on your production version of the website(You just have to set WP_DEBUG to false there).