@@ -128,26 +128,26 @@ discard block |
||
128 | 128 | // should we add flags? |
129 | 129 | foreach ($excludeJS as $exclTag => $exclFlags) { |
130 | 130 | if ( strpos($origTag,$exclTag)!==false && in_array($exclFlags,array("async","defer")) ) { |
131 | - $newTag = str_replace('<script ','<script '.$exclFlags.' ',$newTag); |
|
131 | + $newTag = str_replace('<script ','<script '.$exclFlags.' ',$newTag); |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
136 | - // should we minify the non-aggregated script? |
|
137 | - if ($path && apply_filters('autoptimize_filter_js_minify_excluded',false)) { |
|
138 | - $_CachedMinifiedUrl = $this->minify_single($path); |
|
136 | + // should we minify the non-aggregated script? |
|
137 | + if ($path && apply_filters('autoptimize_filter_js_minify_excluded',false)) { |
|
138 | + $_CachedMinifiedUrl = $this->minify_single($path); |
|
139 | 139 | |
140 | - // replace orig URL with minified URL from cache if so |
|
141 | - if (!empty($_CachedMinifiedUrl)) { |
|
142 | - $newTag = str_replace($url, $_CachedMinifiedUrl, $newTag); |
|
143 | - } |
|
140 | + // replace orig URL with minified URL from cache if so |
|
141 | + if (!empty($_CachedMinifiedUrl)) { |
|
142 | + $newTag = str_replace($url, $_CachedMinifiedUrl, $newTag); |
|
143 | + } |
|
144 | 144 | |
145 | - // remove querystring from URL in newTag |
|
146 | - $_querystr = next(explode('?',$source[2],2)); |
|
147 | - $newTag = str_replace("?".$_querystr,"",$newTag); |
|
148 | - } |
|
145 | + // remove querystring from URL in newTag |
|
146 | + $_querystr = next(explode('?',$source[2],2)); |
|
147 | + $newTag = str_replace("?".$_querystr,"",$newTag); |
|
148 | + } |
|
149 | 149 | |
150 | - // should we move the non-aggregated script? |
|
150 | + // should we move the non-aggregated script? |
|
151 | 151 | if( $this->ismovable($newTag) ) { |
152 | 152 | // can be moved, flags and all |
153 | 153 | if( $this->movetolast($newTag) ) { |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | |
261 | 261 | //$this->jscode has all the uncompressed code now. |
262 | 262 | if ($this->alreadyminified!==true) { |
263 | - if (class_exists('JSMin') && apply_filters( 'autoptimize_js_do_minify' , true)) { |
|
263 | + if (class_exists('JSMin') && apply_filters( 'autoptimize_js_do_minify' , true)) { |
|
264 | 264 | if (@is_callable(array("JSMin","minify"))) { |
265 | 265 | $tmp_jscode = trim(JSMin::minify($this->jscode)); |
266 | 266 | if (!empty($tmp_jscode)) { |
@@ -274,10 +274,10 @@ discard block |
||
274 | 274 | $this->jscode = $this->inject_minified($this->jscode); |
275 | 275 | return false; |
276 | 276 | } |
277 | - } else { |
|
278 | - $this->jscode = $this->inject_minified($this->jscode); |
|
277 | + } else { |
|
278 | + $this->jscode = $this->inject_minified($this->jscode); |
|
279 | 279 | return false; |
280 | - } |
|
280 | + } |
|
281 | 281 | } |
282 | 282 | return true; |
283 | 283 | } |
@@ -339,8 +339,8 @@ discard block |
||
339 | 339 | |
340 | 340 | // Checks against the white- and blacklists |
341 | 341 | private function ismergeable($tag) { |
342 | - if (apply_filters('autoptimize_filter_js_dontaggregate',false)) { |
|
343 | - return false; |
|
342 | + if (apply_filters('autoptimize_filter_js_dontaggregate',false)) { |
|
343 | + return false; |
|
344 | 344 | } else if (!empty($this->whitelist)) { |
345 | 345 | foreach ($this->whitelist as $match) { |
346 | 346 | if(strpos($tag,$match)!==false) { |