Support » Plugin: Autoptimize » Autoptimize & jQuery

  • Resolved Rudolph Smits

    (@rudolph-smits)


    There was a discussion on another forum that became off-topic there. I got advice from Autoptimize plugin author that is worth while to be shared.

    My jQuery-javascripts did not work anymore because: https://wordpress.org/support/topic/jquery-is-not-defined-if-autoptimize-plugin-aggregate-js-files/

    I was advised to exclude the jquery.js from aggregating. I tried to but got no improvement. Then I activated Autoptimize button “minify javascript”. And then all scripts worked again but the loadtime increased (compared to aggregate).

    Then the author wrote: If ever you want to improve more; I see youโ€™re loading 2 versions of jQuery; the one that ships with WordPress (/wp-includes/js/jquery/jquery.js) and https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js. Excluding the 2nd one is not needed or useful as AO does not aggregate/ optimize 3rd party hosted scripts, but excluding the first one _should_ work.

    OK, so far.

    Frank: I added ,jquery.js to the list of scripts to be excluded. But that made no difference. Did I do something wrong?

    Regards,
    Rudolph Smits

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    hard to say as it’s not active now, would you happen to have a non-production site where you could leave things broken for me to check?

    Rudolph Smits

    (@rudolph-smits)

    Yep, has been done (I am just an amateur, no test site… ;-(

    On this page a 12 month list with availability of my chalet does not appear anymore:
    https://www.magoster.nl/beschikbaarheid/

    The variable not shown is called KalenderBlock.

    Rudolph Smits

    (@rudolph-smits)

    I have found this:
    https://www.magoster.nl/wp/wp-includes/js/jquery/jquery.js

    I tried to use that one in stead of http://code.jquery.com/jquery-2.2.4.js but apparently they are not the same.

    By the way, the jquery software under WordPress is not maintained, seems obsolete because consists of old versions. Is this a (future) threat?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    re. JS optimization; can you untick “force JS in head”?

    re. old jQuery & threat; security fixes have been (and will be backported), but there is work under way to switch to jQuery 3.

    Rudolph Smits

    (@rudolph-smits)

    Hurray champion, it looks like all is functioning again!

    We have friends overhere so please allow me to test the entire site on monday again. If all works well I will mark this issue as “resolved”

    Thanks a lot!!

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Geen probleem, ik lees het morgen wel ๐Ÿ™‚

    Rudolph Smits

    (@rudolph-smits)

    It took some time, there is a 2 years old little girl overhere… ๐Ÿ˜‰

    On my site(s) WordPress and all plugins are up to date. Coincidentally also an update for Contact Form 7 Redirection appeared this weekend and has been updated.
    I am using Contact Form 7 plugins for booking forms and contact form. After sending a “thank you”-page appears which is done by CF7 Redirection.

    All site content including sending a form functions allright. CF7 does give a confirmation that an email has been sent and I get that email in my inbox. So far so good but the redirection to this “thank you”-page doesn’t work any more.

    Possibly I could/should exclude a certain.js file but no idea which one.

    Looks this familiar to you or should I post this as a new issue on the CF7 Redirection forum?

    Regards
    Rudolph Smits

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Try disabling JS optimization for a couple of minutes to see if the redirect works without AO;
    -> if yes: try excluding CF7-redirection’s JS from optimazation
    -> if not you’ll indeed need to create a new CF7-redirection issue

    Rudolph Smits

    (@rudolph-smits)

    Thank you.

    Redirection works:
    – with AO
    – with AO javascript minimized

    Redirection does not work:
    – with AO all javascript merged

    OK, so I understand I have an issue for CF7 Redirection because I do not know what JS-file to exclude.

    Thank you for all your help so far, it has improved loadtime of my sites!

    Regards
    Rudolph Smits

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    If you can share the URL on which the form is used, I can check what exclusion you could try?

    Rudolph Smits

    (@rudolph-smits)

    I am getting a little confused.

    I wanted to give you the most simple form, the contact form. But hey, it DOES give a thank-you page.
    https://www.magoster.nl/contact/.

    Then the booking form, I tested it once more. Two times it gave an error by sending but pushing the buttum again the form sended. The third attempt went without out error. But in all three cases NO thank-you page.
    https://www.magoster.nl/boeking-eerste-keer/

    Rudolph Smits

    (@rudolph-smits)

    On a blog that suddenly fails I see this:

    Doing Ctrl-u on the page I see at the end:
    <!–noptimize–><!– Autoptimize found a problem with the HTML in your Theme, tag /body missing –><!–/noptimize–>

    It has been seen by Google on 9th of february. When I remember things right I had not started activating AO already.
    It is a “tag-problem. The blogs themselves end good however the end woth the same hidden remark.

    blog: https://www.magoster.nl/tag/golf/

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    re. the redirect issue; try adding wpcf7_redirect_forms, plugins/wpcf7-redirect to the comma-separated JS optimization exclusion list.

    re. the blog page: it indeed is missing the closing </body></head> tags (also when AO is not active, cfr. the HTML when adding ?ao_noptimize=1 to the URL)?

    Rudolph Smits

    (@rudolph-smits)

    Unbelievable, you did it again.

    My asked me to go oytside with the little girl. To be honest, that’s fun! And less stressing then this all. So forgive, some radio silence will follow now, I will try your suggestion for the blog later.

    For the moment, I don’t know what I should do, the blogs themselves are alright, it’s only when then appear with the tag.

    Wrong = tag: https://www.magoster.nl/tag/golf/
    Right = blog: https://www.magoster.nl/2012/06/spa-parel-van-de-ardennen/

    Ticking all tags under that blog gave that error. Theme error? But is has not been reported by Google before.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    probably a (small) issue in a theme template.

Viewing 15 replies - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.