Hi,
I am using the Security Ninja plugin for security checks and here it is recommended to remove the debug.log file. Is there a way to do this eg. via the Code snippets extension? Or is there another recommended way to do this automatically or semiautomatically? Just an easy way without the need to access the File Manager.
I think this should be possible with some code using this function:
For the path you can use the ABSPATH constant to get the main folder of the site or WP_CONTENT_DIR to get the path to the wp-content folder. Append the debug.log filename and you’re almost there.
I haven’t tested this yet (so use at your own risk), but it would be a snippet as simple as this:
wp_delete_file(WP_CONTENT_DIR . '/debug.log');
As code snippets type you would use “Return info from Child Sites”, so it would be executed once.