Analytics Charts Are blank

This topic contains 4 replies, has 2 voices, and was last updated by Avatar sdel_nevo 1 month, 3 weeks ago.

  • Author
    Posts
  • #86390
    Avatar
    sdel_nevo
    Participant

    Hi Guys

    I have been working with my web hosts over the last few days to resolve a performance issue with my site.

    it’s in relation to /?wc-ajax=get_refreshed_fragments which has been having quite a significant negative performance hit on the site

    I have got this code which is added to my functions.php file and works brilliantly and massively reduces the load on the server

    ** Disable All WooCommerce Styles and Scripts Except for Shop Pages*/
    add_action( 'wp_enqueue_scripts', 'dequeue_woocommerce_styles_scripts', 99 );
    function dequeue_woocommerce_styles_scripts() {
    if ( function_exists( 'is_woocommerce' ) ) {
    if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) {
    # Styles
    wp_dequeue_style( 'woocommerce-general' );
    wp_dequeue_style( 'woocommerce-layout' );
    wp_dequeue_style( 'woocommerce-smallscreen' );
    wp_dequeue_style( 'woocommerce_frontend_styles' );
    wp_dequeue_style( 'woocommerce_fancybox_styles' );
    wp_dequeue_style( 'woocommerce_chosen_styles' );
    wp_dequeue_style( 'woocommerce_prettyPhoto_css' );
    # Scripts
    wp_dequeue_script( 'wc_price_slider' );
    wp_dequeue_script( 'wc-single-product' );
    wp_dequeue_script( 'wc-add-to-cart' );
    wp_dequeue_script( 'wc-cart-fragments' );
    wp_dequeue_script( 'wc-checkout' );
    wp_dequeue_script( 'wc-add-to-cart-variation' );
    wp_dequeue_script( 'wc-single-product' );
    wp_dequeue_script( 'wc-cart' );
    wp_dequeue_script( 'wc-chosen' );
    wp_dequeue_script( 'woocommerce' );
    wp_dequeue_script( 'prettyPhoto' );
    wp_dequeue_script( 'prettyPhoto-init' );
    wp_dequeue_script( 'jquery-blockui' );
    wp_dequeue_script( 'jquery-placeholder' );
    wp_dequeue_script( 'fancybox' );
    wp_dequeue_script( 'jqueryui' );
    }
    }
    }

    the only problem is, that when this code is in place the main analytics charts are blank with this URL /store-manager/analytics

    do you know what I would need to add to the code above so that these analytics charts showed correctly? I know this issue is nothing to do with your code, but any help would be brilliant

    Steve

    Attachments:
    You must be logged in to view attached files.
  • #86392
    Avatar
    sdel_nevo
    Participant

    Hi

    forgot to attach the error from google console
    steve

    Attachments:
    You must be logged in to view attached files.
  • #86395
    Avatar
    sdel_nevo
    Participant

    Hi

    well well, the minute I posted the above I saw

    wp_dequeue_script( ‘woocommerce’ );

    ive commented that out and it works

    been looking at that for hours lol,

    Steve

  • #86774
    WCFM Forum
    WCFM Forum
    Keymaster

    Hi,

    Well, if you dequeue such js for the site there will be many more issues will come!

    Thank You

  • #86783
    Avatar
    sdel_nevo
    Participant

    Hi guys

    Yeah I have just found that out
    I have removed this code

    Steve

You must be logged in to reply to this topic.