Title: Blank Screen after Activating CSS-Optimization
Last modified: August 21, 2016

---

# Blank Screen after Activating CSS-Optimization

 *  Resolved [pmcm](https://wordpress.org/support/users/pmcm/)
 * (@pmcm)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/blank-screen-after-activating-css-optimization/)
 * Hi,
 * i tried to install your plugin on my site [http://www.baby-cool.de](http://www.baby-cool.de)
   but if i try to activate css-optimization, i just see a white blank screen. Even
   if i try to active “just look in head” the error is the same.
 * html and js optimization are activated right now and work fine. but i don’t know
   why css doesn’t work.
 * PS: I’m also usin WP Super Cache with mod_rewrite.
 * [http://wordpress.org/plugins/autoptimize/](http://wordpress.org/plugins/autoptimize/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/blank-screen-after-activating-css-optimization/#post-4251225)
 * In some -rare, this is only the 2nd time I see this- cases [the new CSS optimizer](https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port)
   backfires, leaving nothing but a blank page. In that case you can force Autoptimize
   to use the legacy CSS minifier by adding this to your wp-config.php:
 *     ```
       define("AUTOPTIMIZE_LEGACY_MINIFIERS","true");
       ```
   
 * hope this helps,
    frank
 *  Thread Starter [pmcm](https://wordpress.org/support/users/pmcm/)
 * (@pmcm)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/blank-screen-after-activating-css-optimization/#post-4251253)
 * That works! Thanks a lot!!!
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/blank-screen-after-activating-css-optimization/#post-4251384)
 * [@pmcm](https://wordpress.org/support/users/pmcm/); I’m working on 1.7.1 and 
   would like Autoptimize to fail less … visible. Would you be willing make a small
   temporary change to autoptimizeStyles.php to see if that “fixes” the white screen?
 *  Thread Starter [pmcm](https://wordpress.org/support/users/pmcm/)
 * (@pmcm)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/blank-screen-after-activating-css-optimization/#post-4251389)
 * [@futtta](https://wordpress.org/support/users/futtta/): Yes, no problem. What
   should i change?
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/blank-screen-after-activating-css-optimization/#post-4251390)
 * 2 changes actually;
 * 1. seeing if we get an error on the actual inclusion of the cssmin-library;
    1. in wp-content/plugins/autoptimize/autoptimize.php on line 117 change
    2.     ```
           @include(WP_PLUGIN_DIR.'/autoptimize/classes/external/php/yui-php-cssmin-2.4.8-1.php');
           ```
       
    3. to
    4.     ```
           include(WP_PLUGIN_DIR.'/autoptimize/classes/external/php/yui-php-cssmin-2.4.8-1.php');
           ```
       
    5. in wp-config.php remove
        `define("AUTOPTIMIZE_LEGACY_MINIFIERS","true");`
    6. empty autoptimize cache and see if you get an ugly error instead of a white 
       screen
    7. if so, revert the 2 above changes
    8. if not, revert 1st change and continue to (2)
 * 2. if you still have a white screen (i.e. no ugly error), this change aims to
   have autoptimize fail more gracefully.
    1. open wp-content/plugins/autoptimize/classes/autoptimizeStyles.php and on line
       275 change
    2.     ```
           //Minify
           if (class_exists('Minify_CSS_Compressor')) {
           	// legacy
           	$code = trim(Minify_CSS_Compressor::process($code));
           } else if(class_exists('CSSmin')) {
           	$cssmin = new CSSmin();
           	$code = trim($cssmin->run($code));
           }
           ```
       
    3. into the safer
    4.     ```
           //Minify
           try {
           	if (class_exists('Minify_CSS_Compressor')) {
           		// legacy
           		$tmp_code = trim(Minify_CSS_Compressor::process($code));
           	} else if(class_exists('CSSmin')) {
           		$cssmin = new CSSmin();
           		$tmp_code = trim($cssmin->run($code));
           	}
           } catch (Exception $e) {
           	$CSSMinError = $e->getMessage();
           	$this->ao_logger("Could not minimize because: ".$CSSMinError);
           }
       
           if (!empty($tmp_code)) {
           	$code=$tmp_code;
           	unset($tmp_code);
           }
           ```
       
    5. with the AUTOPTIMIZE_LEGACY_MINIFIERS still removed from wp-config.php, empty
       the autoptimize cache and try if you get a white page now
 * After these tests you can revert all changes, off course!
 * thanks for your help!
 * frank
 *  Thread Starter [pmcm](https://wordpress.org/support/users/pmcm/)
 * (@pmcm)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/blank-screen-after-activating-css-optimization/#post-4251391)
 * Hi,
 * if i do first changes, i get an “HTTP500: Internal Server Error”.
 * An if i do the second changes, i just get a blank screen without any error message.
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/blank-screen-after-activating-css-optimization/#post-4251392)
 * weird … an internal server error upon including the new cssmin-library?
 * could you try to change
 *     ```
       @include(WP_PLUGIN_DIR.'/autoptimize/classes/external/php/yui-php-cssmin-2.4.8-1.php');
       ```
   
 * in wp-content/plugins/autoptimize/autoptimize.php into
 *     ```
       try{
       	include(WP_PLUGIN_DIR.'/autoptimize/classes/external/php/yui-php-cssmin-2.4.8-1.php');
       } catch (Exception $e) {
       	$CSSMinError = $e->getMessage();
       	$this->ao_logger("Could not load minimizer: ".$CSSMinError);
       }
       ```
   
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/blank-screen-after-activating-css-optimization/#post-4251397)
 * The internal server error is pretty weird, as it is caused by a simple inclusion
   of the cssmin-component (and not the minimization of CSS), so I’m thinking there
   might be a problem that is not purely related to the code here.
 * What system are you running your WordPress on? OS (Linux/ Windows/ …), webserver(
   Apache, IIS, ngix, ligthttpd, …), what version of PHP, what amount of memory 
   available for PHP, …?
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/blank-screen-after-activating-css-optimization/#post-4251424)
 * I’ve just pushed a first test-version of 1.7.2 to the plugin repository with 
   some extra checks before loading the minifiers, so it might fix the blank screen
   problem. You can [download the test-version here](http://downloads.wordpress.org/plugin/autoptimize.zip).
   Looking forward to your feedback!
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/blank-screen-after-activating-css-optimization/#post-4251425)
 * and 1.7.2 is now live, fingers crossed the improvements in minifier-loading fix
   the blank screen problem.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Blank Screen after Activating CSS-Optimization’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/blank-screen-after-activating-css-optimization/#post-4251425)
 * Status: resolved