Support » Plugin: Query Monitor » Missing scripts and styles affect performance?

  • Resolved Marco Panichi

    (@marcopanichi)


    Hi,

    first of all thank you for the impressive and useful plugin!

    Here the situation: following these suggestions I deregistered some scripts of a plugin.

    The code added to functions.php is:

    add_action ( 'wp_enqueue_scripts', 'crunchify_disable_crayon_js_css' );
    function crunchify_disable_crayon_js_css() {
    	wp_deregister_style( 'crayon-font-courier-new' );
    	wp_deregister_style( 'crayon-theme-sublime-text' );
    }

    The hack work like a charm but Query Monitor returns a red alert.

    Questions are:
    1) Can this hack hurt performance?
    2) Red alerts in Query Monitor represent always code blocks that slow down (or is just my immagination?)
    3) Is the red alert justified in this case or is it just a false positive?

    Thank you for every suggestions!

    https://wordpress.org/plugins/query-monitor/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Hi Marco,

    The red warning in QM is telling you that something on your site is enqueuing one (or both) of these styles, but they don’t exist because they’ve been deregistered. It won’t slow down your site, but it does mean there is an error that could cause a major problem (in this case, something is expecting those styles to be available but they’re not).

    The article you linked to contains incorrect information. wp_dequeue_style() should be used instead of wp_deregister_style().

    Sorry for the late reply by the way.

    Thread Starter Marco Panichi

    (@marcopanichi)

    Hi Jonh,

    no problem for the late response – it was very helpful!

    Thank you very much.

    Marco

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Missing scripts and styles affect performance?’ is closed to new replies.