Easy code troubleshooting in wordpress

The best way to troubleshoot/debug your PHP code for WordPress is to use the XDEBUG debugger for PHP coupled with an IDE/editor that can leverage XDEBUG. By far my favorite IDE for PHP/XDEBUG is PhpStorm (best money I have ever spent), but you can use for free on the bleeding edge with their EAP (Early … Read more

Debug.log file is never created?

I found the problem. In the Apache server, inside the php.ini, the variable… track_errors = Off To get this information, you can do in a phpfile phpinfo();. So, to write the debug log file, you need to set track_errors as ‘On’.

Debugging in WordPress

Debugging in wordpress can be a bit difficult when your first starting out, while I don’t use breakpoints such as what Visual Studio offers, I can offer advice on how to debug php in general, as well as turning on the debugging output from wordpress. First start by opening up your wp-config.php and finding the … Read more

Suppress deprecated notices

As mmm stated: in which file appears the first notice? Wherever the notice is mentioning the location of this deprecated function (path/to/some/file.php), you would insert the following just below the <?php tag which starts off the file: error_reporting(0); I’ve tried the above functions you mentioned and inserted them in my wp-config.php when I experience something … Read more

Control verbosity level of WP DEBUG?

When WP_DEBUG is set, WordPress sets (via wp_debug_mode() call early in core load process) the error reporting level to E_ALL & ~E_DEPRECATED & ~E_STRICT. This means all warnings and errors except strict errors and PHP deprecated functions (not WordPress ones). You can define your own level in a custom mu-plugin (the override needs to be … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)