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

Uncaught Error: Call to undefined function kv() #117

Open bobbingwide opened 5 months ago

bobbingwide commented 5 months ago

Problem detected in PHP debug.log when updating a plugin on gvg.co.uk

[22-Jun-2024 10:07:44 UTC] PHP Fatal error: Uncaught Error: Call to undefined function kv() in C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\oik-actions.php:850

Stack trace:
#0 C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\oik-actions.php(839): bw_trace_trace_file_link()
#1 C:\apache\htdocs\gardenvista\wp-includes\class-wp-hook.php(324): bw_trace_url_link('')
#2 C:\apache\htdocs\gardenvista\wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#3 C:\apache\htdocs\gardenvista\wp-includes\plugin.php(517): WP_Hook->do_action(Array)
#4 C:\apache\htdocs\gardenvista\wp-includes\load.php(1270): do_action('shutdown')
#5 [internal function]: shutdown_action_hook()
#6 {main}
  thrown in C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\includes\oik-actions.php on line 850
bobbingwide commented 2 months ago

I didn't try reproducing the problem in a traceable local environment. Instead, I've added code to ensure that the bobbfunc shared library is loaded before the action hooks for shutdown are assigned. bobbfunc contains the kv() function that's used in bw_trace_trace_file_link() to set the link to target=_blank and some inline styling.