• Hi!
    I think you can implement an improvment. When you use the Autoptimize, this plugin don’t work (as intended). But you can do it better, like this:

    add this function:

    function fbacb_is_exludes_in_autopmize($src, $ao_excludes) {
    	$excludes = array_map('trim', explode(',', $ao_excludes));
    	foreach ($excludes as $exclude) {
    		if (strpos($src, $exclude) !== false) {
    			return true;
    		}	
    	}
    	return false;
    }

    and change begening of code to this:

    		if (preg_match('/\.js($|\?)/i', $src) && $ao_conf->get('autoptimize_js') && !fbacb_is_exludes_in_autopmize ($src, $ao_conf->get('autoptimize_js_exclude'))) {
    			$skip = true;
    		}
    		if (preg_match('/\.css($|\?)/i', $src) && $ao_conf->get('autoptimize_css') && !fbacb_is_exludes_in_autopmize ($src, $ao_conf->get('autoptimize_css_exclude'))) {
    			$skip = true;
    		}
    • This topic was modified 7 years, 1 month ago by rechandler.

The topic ‘Improvment for integration with Autoptimize’ is closed to new replies.