WordPress.org

Ready to get started?Download WordPress

Forums

Autoptimize
[resolved] Confict with Dynamic To Top (5 posts)

  1. Franck160
    Member
    Posted 1 year ago #

    Hi Frank,

    I tried to add "Dynamic To Top", but it conflicts & result in a blank page when using with Autoptimize... If I unset "Optimized CSS code", then all goes right. However, I can't see any css file downloaded from this plugin that I can excluded from optimization...

    If you could have a look... Prio near 0 at this plugin is just for comfort... Disabled it at the moment ;) But nice to be :)

    If that help, I notice a
    public function minify($source)
    into dtt/inc/cssminxxx.php...

    I didn't go in more details...

    Thanks in advance for feedback ;)

    BR - Franck

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

  2. Frank Goossens
    Member
    Plugin Author

    Posted 1 year ago #

    It's a minifier-conflict (dynamic to top doesn't only have CSS, it has its a minifier baked in) resulting in a PHP fatal error, I'll look into it.

  3. Frank Goossens
    Member
    Plugin Author

    Posted 1 year ago #

    If you can open up wp-content/plugins/autoptimize/classes/autoptimizeStyles.php and on line 271 replace

    //Minify
    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));
    }

    with:

    //Minify
    if (class_exists('Minify_CSS_Compressor')) {
    	// legacy
    	$tmp_code = trim(Minify_CSS_Compressor::process($code));
    } else if(class_exists('CSSmin')) {
    	$cssmin = new CSSmin();
    	if (method_exists($cssmin->run)) {
    		$tmp_code = trim($cssmin->run($code));
    	}
    }

    This should fix the "white page of death issue" that was due to a CSS minifier conflict.

    If this is confirmed to be working, I'll add it to 1.8.2 which should be out later this month.

  4. Frank Goossens
    Member
    Plugin Author

    Posted 1 year ago #

    Darn, there's a bug in the bugfix ...

    The correct code is;

    //Minify
    if (class_exists('Minify_CSS_Compressor')) {
    	// legacy
    	$tmp_code = trim(Minify_CSS_Compressor::process($code));
    } else if(class_exists('CSSmin')) {
    	$cssmin = new CSSmin();
    	if (method_exists($cssmin,"run")) {
    		$tmp_code = trim($cssmin->run($code));
    	}
    }

    sorry about that :-)

  5. Franck160
    Member
    Posted 1 year ago #

    Hi Frank,

    thanks for the advise, I'll try it;) I the mean time, I modified the other plugin to not call minify... Let's do plugin what they do the best ;)

    Have a good week :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.