{"id":30938,"date":"2010-04-24T17:10:02","date_gmt":"2010-04-24T21:10:02","guid":{"rendered":"http:\/\/wpmu.org\/?p=30938"},"modified":"2012-10-02T23:12:37","modified_gmt":"2012-10-03T03:12:37","slug":"daily-tip-enable-wordpress-debugging-for-efficient-plugin-development","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/daily-tip-enable-wordpress-debugging-for-efficient-plugin-development\/","title":{"rendered":"Enable WordPress Debugging For Efficient Plugin Development"},"content":{"rendered":"<p>Enable WP_DEBUG and start seeing PHP notices and also WordPress-generated debug messages.<\/p>\n<p>This is helpful when building plugins. WP_DEBUG tells PHP to report more errors, specifically \u201cnotices,&#8221; since WordPress normally instructs PHP to only report warnings and fatal errors. It also will help you to know if you&#8217;re using a deprecated function, deprecated file, or an old API.<\/p>\n<p>Simply open wp-config.php and define:<\/p>\n<p><code>define( 'WP_DEBUG', true );<\/code><\/p>\n<p>You can also define WP_DEBUG_DISPLAY and WP_DEBUG_LOG to suppress the notices and log them to a wp-content\/debug.log file if you&#8217;re debugging on a production site:<\/p>\n<p><code>define( 'WP_DEBUG', true );<\/code><br \/>\n<code>define( 'WP_DEBUG_LOG', true );<\/code><br \/>\n<code>define( 'WP_DEBUG_DISPLAY', false );<\/code><br \/>\n<code>ini_set( 'display_errors', 0 );<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Enable WP_DEBUG and start seeing PHP notices and also WordPress-generated debug messages. This is helpful when building plugins. WP_DEBUG tells PHP to report more errors, specifically \u201cnotices,&#8221; since WordPress normally instructs PHP to only report warnings and fatal errors. It also will help you to know if you&#8217;re using a deprecated function, deprecated file, or [&hellip;]<\/p>\n","protected":false},"author":4099,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[1,557],"tags":[4005,131,778],"tutorials_categories":[],"class_list":["post-30938","post","type-post","status-publish","format-standard","hentry","category-news-community","category-development","tag-debugging","tag-developers","tag-functions"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/30938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/4099"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=30938"}],"version-history":[{"count":1,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/30938\/revisions"}],"predecessor-version":[{"id":181580,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/30938\/revisions\/181580"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=30938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=30938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=30938"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=30938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}