• Hi,
    Autoptimize functionality to aggregate JS-files reduces my load time dramatically, but it breaks the functionality of woocommerce products images.
    Aggregating JS-Files will stop showing product images in my shop. I could narrow it down to the ACF Plugin. When disabling it all seems to work fine. So it seems to me that I have to add the ACF plugin to be excluded from aggregating. Unfortunately I do not really nknow how to do so. Can someone give me a hint please?

Viewing 10 replies - 16 through 25 (of 25 total)
  • Thread Starter sautaroc

    (@sautaroc)

    thanks for yout help. It’s a pitty aggregating is not working. That brings my site from a good A on GT-metrix to a D ??
    Further the google search console complains to be not mobile friendly, because they stop asking for the .css at a certain number.

    The point is, that all of this started with one update of one of my plugins, but unfortunately I don’t find the right one. Before everything worked like a charm.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, if I were you I would try asyncing the JS to make sure it is not render-blocking using the Async JavaScript plugin?

    re. google mobile friendly; can you try enabling the “404 fallback” option?

    Thread Starter sautaroc

    (@sautaroc)

    update:

    I could get it running when aggregating JS with the following options:

    – forcing js to head
    – add try-catch block

    To work both options are needed, disabeling one will break the site again.
    This is not very elegant, but I could not find the script hurting. Is there a usual way how to find problem scripts, to then exclude them from autoptimize?

    • This reply was modified 4 years, 6 months ago by sautaroc.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Is there a usual way how to find problem scripts, to then exclude them from autoptimize?

    that’s the process we started earlier, but it can be a hassle sometimes and yours is particularly stubborn I’m afraid. Lots of trial and error.

    just to make sure; did you disable “also minify excluded css/js” when trying the exclusions?

    Thread Starter sautaroc

    (@sautaroc)

    it was not disabled, so I did disable it. The error remains, when I disable either force to head or the try catch block ??

    the strange thing is, that I excluded ACF scripts, but they seem to be still there:

    Uncaught TypeError: Cannot read property 'timepicker' of undefined
        at jquery-ui-timepicker-addon.min.js?ver=1.6.1:1
        at jquery-ui-timepicker-addon.min.js?ver=1.6.1:1
        at jquery-ui-timepicker-addon.min.js?ver=1.6.1:1
    (index):47 Uncaught ReferenceError: ECS_update_admin_bar_menu is not defined
        at (index):47
    acf-input.min.js?ver=5.9.0:3 Uncaught TypeError: Cannot read property 'autop' of undefined
        at acf.Model.onReady (acf-input.min.js?ver=5.9.0:3)
        at u (acf.min.js?ver=5.9.0:1)
        at Object.n (acf.min.js?ver=5.9.0:1)
        at Object.n.doAction (acf.min.js?ver=5.9.0:1)
        at HTMLDocument.<anonymous> (acf.min.js?ver=5.9.0:1)
        at i (jquery.js?ver=1.12.4-wp:2)
        at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
        at Function.ready (jquery.js?ver=1.12.4-wp:2)
        at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)

    this is my exclude list:

    wp-includes/js/dist/, wp-includes/js/tinymce/, js/jquery/jquery.js, wp-content/plugins/advanced-custom-fields-pro, wp-content/plugins/acf-frontend-form-element

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    and if you add wp-includes/js to the exclusion list, what does that do (to the JS errors)?

    Thread Starter sautaroc

    (@sautaroc)

    that will give me the following console errors (force to head and try/catch activated):

    thickbox.js?ver=3.1-20121105:304 Uncaught ReferenceError: TB_WIDTH is not defined
        at tb_position (thickbox.js?ver=3.1-20121105:304)
        at autoptimize_939077614c495b155f8debac08c4a8c0.js:655
        at dispatch (jquery.js?ver=1.12.4-wp:3)
        at r.handle (jquery.js?ver=1.12.4-wp:3)
        at Object.trigger (jquery.js?ver=1.12.4-wp:3)
        at jquery.js?ver=1.12.4-wp:3
        at Function.each (jquery.js?ver=1.12.4-wp:2)
        at n.fn.init.each (jquery.js?ver=1.12.4-wp:2)
        at n.fn.init.trigger (jquery.js?ver=1.12.4-wp:3)
        at autoptimize_939077614c495b155f8debac08c4a8c0.js:125

    the options disactivated will give this:

    (index):47 Uncaught ReferenceError: ECS_update_admin_bar_menu is not defined
        at (index):47
    (anonymous) @ (index):47
    acf-input.min.js?ver=5.9.0:3 Uncaught TypeError: Cannot read property 'autop' of undefined
        at acf.Model.onReady (acf-input.min.js?ver=5.9.0:3)
        at u (acf.min.js?ver=5.9.0:1)
        at Object.n (acf.min.js?ver=5.9.0:1)
        at Object.n.doAction (acf.min.js?ver=5.9.0:1)
        at HTMLDocument.<anonymous> (acf.min.js?ver=5.9.0:1)
        at i (jquery.js?ver=1.12.4-wp:2)
        at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
        at Function.ready (jquery.js?ver=1.12.4-wp:2)
        at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)
    • This reply was modified 4 years, 6 months ago by sautaroc.
    • This reply was modified 4 years, 6 months ago by sautaroc.
    • This reply was modified 4 years, 6 months ago by sautaroc.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, so you’re excluding wp-content/plugins/advanced-custom-fields-pro, wp-content/plugins/acf-frontend-form-element, but might you have other ACF-related plugins that might also need excluding?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    any news sautaroc ?

    Thread Starter sautaroc

    (@sautaroc)

    I fiddled around for quite a while, but couldn’t find the error. In the end I switched to an alternative plugin. Not so efficient but working without trouble…

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘problem aggregating js-files’ is closed to new replies.