Monday 23 October 2017

WordPress Development Environment and Developers’ Best Practices


When we’ve decided to change the development environment from CodeIgniter and Symfony to WordPress, first of all, we reviewed the code, current WordPress development environment and started searching the best WordPress development practices. The main findings of our analysis are in this article.
WordPress Debugging
Debagging is a very important part of WordPress development environment. Currently, the main problems with debugging in WordPress are the following:
Debugging variables through var_dump()
When you just need to output the content of the variable, you can use var_dump() within the <pre> tag:
However, this is not very convenient as a part of the data is not visible behind the layout, and it is unrealistic to debug a large array of data, e.g.:
Logging through WP_DEBUG_LOG
You also can enable logging by defining the WP_DEBUG_LOG constant in the wp-config.php file
and put the data into the log via error_log(). Although it’s handy to use for the ajax queries logging, the large amounts of data are hard to read and the log file size increases very fast.
Using xdebug
You can also use xdebug, but it’s not always convenient as it’s quite bulky for checking
Source: https://managewp.org/articles/16361/wordpress-development-environment-and-developers-best-practices




source https://williechiu40.wordpress.com/2017/10/23/wordpress-development-environment-and-developers-best-practices/

No comments:

Post a Comment