From ccba83de0131406353595ffb6d2c7b3c201787f2 Mon Sep 17 00:00:00 2001 From: Raul Miller Date: Thu, 29 Mar 2018 17:48:53 -0400 Subject: [PATCH] reduce idle load Do not hook requests where we are not engaged --- wp-action-trace.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-action-trace.php b/wp-action-trace.php index de982ff..adfad53 100644 --- a/wp-action-trace.php +++ b/wp-action-trace.php @@ -104,4 +104,6 @@ function calevans_format_debug_output($actions=[],$showArgs=false, $showTime=fal * 99 = the number of parameters that this method can accept. Honestly, if you have a action approaching this many parameter, you really are doing sometheing wrong. * */ -add_action( 'all', 'calevans_action_trace', 99999, 99 ); +if (isset($_GET['showDebugTrace']) && (bool)$_GET['showDebugTrace']===true) { + add_action( 'all', 'calevans_action_trace', 99999, 99 ); +}