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

Add WP-CLI support to enable/disable tracing #54

Open bobbingwide opened 7 years ago

bobbingwide commented 7 years ago

It would be nice if we could turn tracing on and off from the command line.

Proposed solution

One way of achieving this is to provide some WP-CLI commands.

bobbingwide commented 7 years ago

Additionally, we should support logging in the daily trace summary of requests invoked from the command line using a wp-cli .phar file.

bobbingwide commented 6 years ago

Note: bw_trace_status_report() can be invoked before WordPress has fully initialised. This can lead to Notices being produced

Notice: Undefined index: wp_post_types in oik-bwtrace\includes\oik-actions.php on line 318
Notice: Undefined index: wp_taxonomies in oik-bwtrace\includes\oik-actions.php on line 319

The following lines need to cater for global variables not having been set. $func( count( $GLOBALS['wp_post_types'] ), "Post types", false ); $func( count( $GLOBALS['wp_taxonomies'] ), "Taxonomies", false );

bobbingwide commented 6 years ago

Commands to support in oik-bwtrace include:

Command Args assoc_args Notes
status detail Displays status for each trace type, followed by trace record details
on type --file= --reset --limit= Turns tracing on
off type Turns tracing off
detail Just displays the trace record details

To be considered

Command Args assoc_args Notes
info Displays the same as the Information block
actions tbc Displays trace actions
summary on/off Enables / disables Daily trace summary processing
logs Actions related to trace log output files
reset type Resets the trace file

where type = browser | ajax | rest | cli

bobbingwide commented 4 years ago

This work has been on hold for a while.