Support » Plugin: Autoptimize » Problems enabling the javascript and CSS options

  • I have installed for first time autoptimize plugin and after activate it, I enabled the 3 options one by one, to see if there were any troubleshooting with any of them:

    -Option html- no problem. Everything looks ok.

    -Option CSS- Very big problem because after anable this option my webside doesn’t load. Just appear on the top of the screen this message:

    Fatal error: Cannot redeclare class Minify_CSS_Compressor in /home4/ftworld/public_html/sala-fw/wp-content/themes/website/drone/ext/minify/css.php on line 21

    So, I tried the option: “Look for scripts only in head?” but the same consecuences, white screen with same message.

    -Option javascript: My website loads but some things doesn’t load properly: the slideshows created with the plugin NextGen Gallery, the facebook box widget (included in my theme) don’t load, the featured image in the posts in the homepage is empty, doesn’t load, and some other images with link in homepage doesn’t load. And the facebook, twitter and google+ like butons that are at the end of every post doesn’t load neither.
    I tried the option: “Look for scripts only in head?” but same consecuences.

    So there are anything that could I do?
    Now I only have enabled the html option

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Frank Goossens


    Hi Sandy;
    Based on the error message (“Fatal error: Cannot redeclare class Minify_CSS_Compressor in /home4/ftworld/public_html/sala-fw/wp-content/themes/website/drone/ext/minify/css.php on line 21”) you have a theme that tries to do CSS minification itself. That means you’ll have to choose to use that one, or (if you can disable CSS minimization in your theme) Autoptimize’s CSS minification.

    As far as javascript is concerned; you’ll have to exclude certain scripts from being Autoptimized. To do that you’ll have to dive in the HTML, checking which javascript is loaded and in the JavaScript error console to see which scripts are complaining and play around with the exclude options until it works.

    Hope this helps,

    Thanks for you quick answer.

    About javascript option, I no have idea about HTML, so I will try to contact with the theme developer and with the nextgen plugin developer, maybe they can help me

    Plugin Author Frank Goossens


    for javascript; I just released a new version which has an ‘force javascript in head’ option. it could help solve some (jQuery-related) javascript problems.

    I’ve tried the new version; I’ve enabled the javascript optimization and the “force javascript in head” but the slideshow of my theme doesn’t work properly, the images of the slideshow loads distorted.

    I only can enable the html optimization.

    Plugin Author Frank Goossens


    Did you try with “search in head” and “force in head” combined? That might work, as a last resort?

    Yes, I tried, but it doesn’t work, same issue with the slideshow images

    Plugin Author Frank Goossens


    In that case I’m afraid you’ll have to resort to excluding specific scripts from being Autoptimized.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Problems enabling the javascript and CSS options’ is closed to new replies.