• Resolved Website Rob

    (@website-rob)


    Greetings,

    Hoping you can help me with a slight problem I’m having.

    When I enable the Debug Log Widget, the widget only seems to work if using the WP default location: /wp-content/debug.log

    That will kick off a Warning in Site Health so thought I’d move it like so.

    Edit the wp-config.php with the following:

    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);
    define('WP_DEBUG_LOG', '/somewhere/debug.log');

    The WP Support Docs say the above is allowed, which does not appear to be true as Site Health still disapproves. Even if in a protected area.

    Or could I use define('WP_DEBUG_LOG', '/home/$Username/debug.log'); which would definitely be secure. Mind you, I don’t know if an absolute path can be used in wp-config.php. Yes | No ?

    As the Error Log Widget allows for providing an absolute path to the Error Log Location, would updating your plugin to do the same for Debug Log Widget help solve the above? Or would that leave other Plugins wondering where the ‘debug.log’ went to?

    Setting up a declaration in .htaccess to limit access wherever I put it, I can do, but not sure if it would be picked up by WP.

    Did I miss something, am I whistling Dixie here or is the above just one of those situations one has to live with? (Site Health + false positive = bad)

    • This topic was modified 1 year, 10 months ago by Website Rob.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Glad to help.

    I am not seeing any errors reported via Site Health. Running only DWS and using default settings. What is the specific error you’re getting?

    Thread Starter Website Rob

    (@website-rob)

    Create /wp-content/debug.log and enable Debug in in DWS.

    DWS reports no problem nor does Site Health but is Debug actually working? I don’t know. Will debug within DWS work without having to enable it in wp-config.php?

    WP Docs say debug must be enabled in wp-config.php it order to work and once that is done Site Health says: The value, WP_DEBUG_LOG, has been added to this website’s configuration file. This means any errors on the site will be written to a file which is potentially available to all users.

    Plugin Author Jeff Starr

    (@specialk)

    Correct, /wp-content/debug.log is the default location of the debug log. So yeah it definitely works.

    “Will debug within DWS work without having to enable it in wp-config.php?”

    No, debug log must be enabled for it to work.

    Thread Starter Website Rob

    (@website-rob)

    And that takes use back to the original post.

    If Debug is enabled in wp-config.php then Site Health will say there is a problem – even if ‘debug.log’ is protected by other means or stored somewhere else. So then, as outlined in original post, is it possible to recode DWS Debug to use a custom path, similar to the same option as the DWS Error Log?

    Plugin Author Jeff Starr

    (@specialk)

    So you’re asking how to change the debug path?

    Use the provided hook, for example:

    function dashboard_widgets_suite_log_debug_path($log) {
    
    	return '/whatever/path/debug.log'; 
    
    }
    add_filter('dashboard_widgets_suite_log_debug_path', 'dashboard_widgets_suite_log_debug_path');
    Thread Starter Website Rob

    (@website-rob)

    Although your code would probably work, I have no idea what file to edit.

    I was hoping that if it was possible, the next or future update of DWS would include the ability to manually insert a Log Location, such as the DWS Error log does.

    I guess you did answer the question though.

    Thanks

    Plugin Author Jeff Starr

    (@specialk)

    Here is a guide that explains how to add custom code to WordPress. Basically you can add via theme or simple plugin.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Debug Widget and false positives’ is closed to new replies.