• Resolved mpcee123

    (@michaelpcook)


    Sexy Bookmarks doesn’t play nice with W3’s JavaScript Minification–many of us know this already.

    But how can I enable minification for all of the other JavaScript on my site, leaving out only Sexy Bookmarks’ JavaScript? It seems as though the only option is to select “Manual Mode” for my minify settings on the “General Settins” tab, and then specify every single JavaScript file that I want minified on the “Minify” tab.

    Can I just exclude a couple JavaScript files (i.e. the Sexy Bookmarks JavaScript files) without having to go into W3’s Manual Mode (and thus, have to specify every JavaScript file I actually want minified)? Can I somehow use the “Never minify these files” feature on the “Minify” tab without using “Manual Mode” for minify?

    Mike

    http://wordpress.org/extend/plugins/w3-total-cache/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The only way to really set up the js minification is to do it manually. Open up your site in a separate browser window and view source then just go down the page and copy and paste over the links to all the javascript files in the same order they are on the page one by one to W3 Total Cache.

    Save and test your page using webkit developer tools or firebug and look for the javascript errors. Remove the files with the errors one by one from W3 Until your page loads without any errors.

    Depending on your plugins you can put some of the js in the footer but if any plugins or your theme output js directly to the browser you most likely will have to keep everything in before <body>.

    It’s a trial and error process and is really the only way to accomplish unless your theme and all your plugins use the proper wp_enqueue_script technique.

    *Note for sexy bookmarks make sure you check the box to NOT INCLUDE JQUERY. The plugin loads it’s own version and totally ignores WordPress best practices. I contacted the author about this and they didn’t care because they think doing it there way improves compatibility with users using outdated versions of WordPress.

    Thread Starter mpcee123

    (@michaelpcook)

    Chris,

    Thanks for your response!

    Manual setup: Wow, what a hassle. Seems as though it would be a lot easier to just copy the scripts I want to exclude from getting minified, rather than find all of those I want to minify.

    Good call on disabling the jQuery from SexyB….

    I tried an alternate method as my solution. I’m using CloudFlare with its minify functionality disabled, since I use W3’s minify code (well, except for JavaScript, as we’ve seen here). I’m letting W3 handle minifying the HTML and CSS, and I turned on the CloudFlare’s JS minify functionality.

    And guess what? Everything works fine. Perhaps CloudFlare’s JS minify algorithm isn’t in conflict with SexyB.

    I’m going to roll with this solution for the time being.

    Cheers!

    Mike

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    There’s a suggestion tool for manual mode that will help you populate the manual settings. Manual mode also gives you control over some additional optimizations.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sexy Bookmarks, W3 Total Cache, and JS Minification’ is closed to new replies.