WordPress.org

Forums

BlackBox Debug Bar
[resolved] My Fix for V0.1.3 (5 posts)

  1. hekigan
    Member
    Posted 2 years ago #

    Hi!

    again thank you for this nifty plugin that speed up our development process!

    The last version pushed throws a notice from this function:

    "public static function init()"

    My fix below:

    /**
         * Initiates BlackBox plugin
         *
         * @return null
         */
        public static function init()
        {
    		// init profiler
            add_filter("all", array("BlackBox_Hook", "profiler"));
            apply_filters('debug', 'Profiler Initiaded');
            apply_filters('debug', 'Profiler Noise');
    
            // scripts and styles
            add_action('init', 'BlackBox::init_scripts_styles');
            add_action('admin_footer', array("BlackBox_Hook", "footer"));
            add_action('wp_footer', array("BlackBox_Hook", "footer"));
    
            set_error_handler(array("BlackBox", "errorHandler"), E_ALL | E_STRICT);
        }
    
        /**
         * Initiates BlackBox scripts and styles
         *
         * @return null
         */
        public static function init_scripts_styles()
        {
    		// scripts and styles
    
            wp_register_script("blackbox-js", plugins_url()."/blackbox-debug-bar/public/highlight.pack.js", array("jquery"));
            wp_register_script("blackbox-highlight", plugins_url()."/blackbox-debug-bar/public/blackbox.js", array("jquery"));
    
            wp_register_style("blackbox-css", plugins_url()."/blackbox-debug-bar/public/styles.css");
    		wp_enqueue_style("blackbox-css");
    
    		wp_enqueue_script("blackbox-js");
    		wp_enqueue_script("blackbox-highlight");
        }

    I believe it's quite easy to fix and push :)

    Have a good day, Laurent

    http://wordpress.org/extend/plugins/blackbox-debug-bar/

  2. hekigan
    Member
    Posted 2 years ago #

    I forgot to specify... What was causing the notice was calling
    wp_register_script

    and

    wp_register_style

    Before the init event was called.

  3. Greg Winiarski
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks @hekigan, i applied the fix it will be in version 0.1.4

  4. CuriousDev
    Member
    Posted 2 years ago #

    Thanks a lot! It was useful for me.

  5. hekigan
    Member
    Posted 2 years ago #

    Glad I could be of help, I do really enjoy this plugin which is super useful!
    Keep up the good work.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • BlackBox Debug Bar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.