diff --git a/classes/class-ep-debug-bar-elasticpress.php b/classes/class-ep-debug-bar-elasticpress.php index e105522..f1e92b5 100755 --- a/classes/class-ep-debug-bar-elasticpress.php +++ b/classes/class-ep-debug-bar-elasticpress.php @@ -36,8 +36,12 @@ public function init() { * Enqueue scripts for front end and admin */ public function enqueue_scripts_styles() { - wp_enqueue_script( 'debug-bar-elasticpress', plugins_url( '../assets/js/main.js', __FILE__ ), array( 'wp-dom-ready' ), EP_DEBUG_VERSION, true ); - wp_enqueue_style( 'debug-bar-elasticpress', plugins_url( '../assets/css/main.css', __FILE__ ), array(), EP_DEBUG_VERSION ); + if ( ! is_user_logged_in() ) { + return; + } + + wp_enqueue_script( 'debug-bar-elasticpress', EP_DEBUG_URL . 'assets/js/main.js', array( 'wp-dom-ready' ), EP_DEBUG_VERSION, true ); + wp_enqueue_style( 'debug-bar-elasticpress', EP_DEBUG_URL . 'assets/css/main.css', array(), EP_DEBUG_VERSION ); } /** diff --git a/debug-bar-elasticpress.php b/debug-bar-elasticpress.php index 75bbaed..d6eb454 100755 --- a/debug-bar-elasticpress.php +++ b/debug-bar-elasticpress.php @@ -14,6 +14,7 @@ */ define( 'EP_DEBUG_VERSION', '2.0.0' ); +define( 'EP_DEBUG_URL', plugin_dir_url( __FILE__ ) ); /** * Register panel