WordPress.org

Ready to get started?Download WordPress

Forums

Autoptimize
[resolved] Javascript optimize breaks Twentythirteen mobile menu (8 posts)

  1. p33t3r
    Member
    Posted 9 months ago #

    I'm using a child theme of Twentythirteen for my site http://www.machautmachine.com, but when I have javascript optimization enabled the menu breaks when on a small screen.
    I have tried each one of the javascript options, and I have also tried adding functions.js, which I believe contains the offending javascript, to the exclusion list, but the only way to get the menu working properly is to turn off javascript optimization entirely.
    Any ideas?

    http://wordpress.org/plugins/autoptimize/

  2. futtta
    Member
    Plugin Author

    Posted 9 months ago #

    Well, twentythirteen uses jquery so that complicates things. I'd start off by excluding jquery.js and functions.js (which indeed depends on jquery) and see where that brings you.

    that being said; it does work for me (testblog) with the outofthebox twentythirteen and all optimizations active (albeit using what is to become autoptimize 1.7.0), so it might be another jquery-dependancy messing with you ... ;-)

  3. p33t3r
    Member
    Posted 8 months ago #

    The problem seems to be the Use Google libraries plugin. When i deactivate it javascript optimization works fine with the default settings, both in the 1.7.0 beta and in 1.6.6.

  4. futtta
    Member
    Plugin Author

    Posted 8 months ago #

    Interesting, I'll give that a try and see if I can reproduce & fix.

  5. futtta
    Member
    Plugin Author

    Posted 8 months ago #

    Wow, that was a blast; the "use google libraries" plugin uses protocol-less url's for the javascript source (which is perfectly acceptable). the getpath-function didn't understand that and had as a result that jQuery wasn't loaded at all.

    I've got it working now with this little fix in wp-content/plugins/autoptmize/classes/autoptimzeBase.php on line 33 or 34, where you'll have to change

    if(preg_match('#^(https?|ftp)://#i',$path))

    into

    if(preg_match('#^((https?|ftp):)?//#i',$path))

    I'll make sure to include this in 1.7.0. And thanks for reporting mate!

  6. p33t3r
    Member
    Posted 8 months ago #

    Great, thanks!

  7. futtta
    Member
    Plugin Author

    Posted 8 months ago #

    1.7.0 is live and includes this fix. hope you like it!

  8. p33t3r
    Member
    Posted 8 months ago #

    Thanks!
    Have been running the beta with no problems for a while and installed the proper 1.7.0 release this morning. Everything's running great.

Reply

You must log in to post.

About this Plugin

About this Topic