bobbingwide / oik-bwtrace

debug trace for WordPress
https://www.oik-plugins.com/oik-plugins/oik-bwtrace-debug-trace-for-wordpress/
GNU General Public License v2.0
6 stars 1 forks source link

Improvements for the Daily Trace Summary report #68

Closed bobbingwide closed 4 years ago

bobbingwide commented 6 years ago

The Daily Trace Summary report is currently enabled by selecting the Trace 'shutdown' status report and log in summary file checkbox on the Settings > oik action options admin page.

Creation of the Summary Report is independent of the tracing activity. See https://www.oik-plugins.com/wordpress-plugins-from-oik-plugins/free-oik-plugins/oik-trace-plugin/settings-oik-action-options/trace-shutdown-status-report-and-log-in-summary-file/

It would be nice to extract/copy this trace_status_report checkbox from the bw_action_options settings group and create a separate admin section for it. This could be a meta box on both the oik trace options and oik action options page so that the user could enable/disable the daily trace summary report from either admin page.

Currently there are three capabilities bundled into one.

  1. Trace a summary report.
  2. Return the summary report to the browser / cli
  3. Append a summary record to the daily summary file We could think about splitting these out.

Requirements

Proposed solution

bobbingwide commented 6 years ago

GDPR considerations

The daily trace summary report should only be accessible by authorised users of the output. It's currently written to a file in ABSPATH. It needs to be written to a protected directory.

bobbingwide commented 6 years ago

The option field summary_file will be used to store the prefix of the daily trace summary file, which should include the path. E.g. logs/bwtrace.vt. The date and blog_id ( for Multisite) are appended to create the full file name. E.g. logs/bwtrace.vt.20180516.2 The .htaccess file in the logs folder will protect unauthorised users from accessing the files from the browser.

bobbingwide commented 6 years ago

See #71 for further details / clarification of the requirements and proposed solution.

bobbingwide commented 4 years ago

The meta box the for daily trace summary options looks like this. image

This box is displayed on both oik trace options and oik action options admin pages. There are PHPUnit tests for the dialog display.

The option field summary_file will be used to store the prefix of the daily trace summary file, which should include the path. E.g. logs/bwtrace.vt.

This has been superceded by the solution in #71 The new solution doesn't support subdirectories.

The .htaccess file in the logs folder will protect unauthorised users from accessing the files from the browser.

I didn't implement any logic to automatically create an .htacess file

This issue can now be closed.

bobbingwide commented 4 years ago

See also #53 - we’ll add another column to the trace section.

bobbingwide commented 4 years ago

53's closed. I'll close this when I've updated the documentation,

.

bobbingwide commented 4 years ago

Documented: https://www.oik-plugins.com/wordpress-plugins-from-oik-plugins/free-oik-plugins/oik-trace-plugin/settings-oik-trace-options/daily-trace-summary/

https://www.oik-plugins.com/wordpress-plugins-from-oik-plugins/free-oik-plugins/oik-trace-plugin/viewing-trace-files/