• Resolved Alfo

    (@alfonsberger)


    Hello,

    great plugin for sure, but it brings down the performance grade due to many external javascript and css files loaded from cdn.datatables.net as well as many query strings from static resources.

    Any idea how to fix this? As we only need the plugin on a couple pages it does not really make sense to have this stuff loaded on every single page. Is there a way to limit the plugin just to certain pages?

    Thanks for your help
    Alfons

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

    (@meitar)

    Did you consider reading this plugin’s FAQ to see if your question was answered there? (Hint: it is.)

    Thread Starter Alfo

    (@alfonsberger)

    Thanks for the hint. I read through the FAQ, but I guess not thoroughly enough.

    Would this then be the correct way to use in the functions.php?

    // Inline Google Sheet Plugin - reduce external files
    function igsv_dequeue_google_charts_script ($scripts) {
        unset($scripts['igsv-gvizcharts']);
        return $scripts;
    }
    add_filter('gdoc_enqueued_front_end_scripts', 'igsv_dequeue_google_charts_script');
    
    function igsv_dequeue_datatables_buttons_script ($scripts) {
        unset($scripts['datatables-buttons']);
        return $scripts;
    }
    add_filter('gdoc_enqueued_front_end_scripts', 'igsv_dequeue_datatables_buttons_script');
    
    function igsv_dequeue_datatables_fixedcolumns_script ($scripts) {
        unset($scripts['datatables-fixedcolumns']);
        return $scripts;
    }
    add_filter('gdoc_enqueued_front_end_scripts', 'igsv_dequeue_datatables_fixedcolumns_script');
    
    function igsv_dequeue_datatables_buttons_style ($scripts) {
        unset($scripts['datatables-buttons']);
        return $scripts;
    }
    add_filter('gdoc_enqueued_front_end_styles', 'igsv_dequeue_datatables_buttons_style');
    
    function igsv_dequeue_datatables_select_style ($scripts) {
        unset($scripts['datatables-select']);
        return $scripts;
    }
    add_filter('gdoc_enqueued_front_end_styles', 'igsv_dequeue_datatables_select_style');
    
    function igsv_dequeue_datatables_responsive_style ($scripts) {
        unset($scripts['datatables-responsive']);
        return $scripts;
    }
    add_filter('gdoc_enqueued_front_end_styles', 'igsv_dequeue_datatables_responsive_style');
    
    function igsv_dequeue_datatables_fixedheader_style ($scripts) {
        unset($scripts['datatables-fixedheader']);
        return $scripts;
    }
    add_filter('gdoc_enqueued_front_end_styles', 'igsv_dequeue_datatables_fixedheader_style');
    
    function igsv_dequeue_datatables_fixedcolumns_style ($scripts) {
        unset($scripts['datatables-fixedcolumns']);
        return $scripts;
    }
    add_filter('gdoc_enqueued_front_end_styles', 'igsv_dequeue_datatables_fixedcolumns_style');
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Only active on particular page’ is closed to new replies.