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

Call to undefined function bw_flush() during shutdown #65

Closed bobbingwide closed 5 years ago

bobbingwide commented 6 years ago

When oik-bwtrace is not itself active but trace shutdown summary is selected a Fatal error is logged to the PHP Error log.

Expected output

oik-bwtrace should not produce Fatal errors during shutdown processing

Actual output

Fatal error: Uncaught Error: Call to undefined function bw_flush() in C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\oik-actions.php:348

Stack trace:
#0 C:\apache\htdocs\szerelmey\wp-includes\class-wp-hook.php(286): bw_trace_status_report('')
#1 C:\apache\htdocs\szerelmey\wp-includes\class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
#2 C:\apache\htdocs\szerelmey\wp-includes\plugin.php(453): WP_Hook->do_action(Array)
#3 C:\apache\htdocs\szerelmey\wp-includes\load.php(679): do_action('shutdown')
#4 [internal function]: shutdown_action_hook()
#5 {main}
  thrown in C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\oik-actions.php on line 348

Temporary solution

Perform an function_exists( "bw_flush" ) before calling it in bw_trace_status_report()

bobbingwide commented 5 years ago

The Temporary solution, which was implemented in 97b186e5d56dd491cb823b063c636a7cbe798c87, is now the permanent solution.