{"id":19012760,"date":"2026-09-06T13:02:38","date_gmt":"2026-09-06T13:02:38","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/trp_debug_mode_off-ignores-custom-wp_debug_log\/"},"modified":"2026-09-06T13:02:38","modified_gmt":"2026-09-06T13:02:38","slug":"trp_debug_mode_off-ignores-custom-wp_debug_log","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/trp_debug_mode_off-ignores-custom-wp_debug_log\/","title":{"rendered":"trp_debug_mode_off() ignores custom WP_DEBUG_LOG"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">When <code>WP_DEBUG<\/code> is true, the plugin runs:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ini_set('display_errors', 0);<br \/>ini_set('log_errors', 1);<br \/>ini_set('error_log', WP_CONTENT_DIR . '\/debug.log');<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This ignores a custom <code>WP_DEBUG_LOG<\/code> path. WordPress documents that constant as either <code>true<\/code> or a file path. Core <code>wp_debug_mode()<\/code> honours the path. TranslatePress then overwrites it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>wp-content\/debug.log<\/code> is inside the web root. Unless the server blocks it, the PHP error log is publicly downloadable. That is a security issue: the file often contains paths, plugin versions, and request data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The method only needs <code>display_errors<\/code> off so notices are not stored as translation strings. It does not need to change <code>error_log<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not call <code>ini_set('error_log', \u2026)<\/code> at all, or use <code>WP_DEBUG_LOG<\/code> when it is a non-empty string:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if ( defined( 'WP_DEBUG_LOG' ) &amp;&amp; is_string( WP_DEBUG_LOG ) &amp;&amp; WP_DEBUG_LOG !== '' ) {<br \/>    ini_set( 'error_log', WP_DEBUG_LOG );<br \/>}<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-19012760","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19012760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19012760\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19012760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}