From 615f720b55c6112582143760d474a9c2294680cc Mon Sep 17 00:00:00 2001 From: Max Lyuchin Date: Thu, 12 May 2022 08:45:21 +0300 Subject: [PATCH 1/2] Move plugin setup to the later init hook --- includes/core.php | 5 +++-- sophi-debug-bar.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/core.php b/includes/core.php index 74dd824..e852641 100755 --- a/includes/core.php +++ b/includes/core.php @@ -40,8 +40,9 @@ function setup() { // Early initialization of the panel before main debug bar plugin. require_once SOPHI_DEBUG_BAR_PATH . '/includes/class-sophi-debug-bar-panel.php'; - add_action( 'init', $n( 'i18n' ) ); - add_action( 'init', $n( 'init' ) ); + i18n(); + init(); + add_action( 'wp_enqueue_scripts', $n( 'scripts' ) ); add_action( 'wp_enqueue_scripts', $n( 'styles' ) ); add_action( 'admin_enqueue_scripts', $n( 'admin_scripts' ) ); diff --git a/sophi-debug-bar.php b/sophi-debug-bar.php index 1f0cef8..cbcb8f5 100755 --- a/sophi-debug-bar.php +++ b/sophi-debug-bar.php @@ -43,4 +43,4 @@ register_deactivation_hook( __FILE__, '\SophiDebugBar\Core\deactivate' ); // Bootstrap. -add_action( 'plugins_loaded', 'SophiDebugBar\Core\setup' ); +add_action( 'init', 'SophiDebugBar\Core\setup' ); From 84f5e799223881336963ca947964e44baf0e6f38 Mon Sep 17 00:00:00 2001 From: Max Lyuchin Date: Thu, 12 May 2022 08:46:00 +0300 Subject: [PATCH 2/2] Force activate Debug Bar on WP VIP --- sophi-debug-bar.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sophi-debug-bar.php b/sophi-debug-bar.php index cbcb8f5..271d71c 100755 --- a/sophi-debug-bar.php +++ b/sophi-debug-bar.php @@ -42,5 +42,8 @@ register_activation_hook( __FILE__, '\SophiDebugBar\Core\activate' ); register_deactivation_hook( __FILE__, '\SophiDebugBar\Core\deactivate' ); +// Activate Debug Bar on WP VIP. +add_filter( 'debug_bar_enable', '__return_true' ); + // Bootstrap. add_action( 'init', 'SophiDebugBar\Core\setup' );