@@ 340-353 (lines=14) @@ | ||
337 | // Excluded CSS, minify that file: |
|
338 | // -> if aggregate is on and exclude minify is on |
|
339 | // -> if aggregate is off and the file is not in dontmove. |
|
340 | if ( $path && $this->minify_excluded ) { |
|
341 | $consider_minified_array = apply_filters( 'autoptimize_filter_css_consider_minified', false ); |
|
342 | if ( ( false === $this->aggregate && str_replace( $this->dontmove, '', $path ) === $path ) || ( true === $this->aggregate && ( false === $consider_minified_array || str_replace( $consider_minified_array, '', $path ) === $path ) ) ) { |
|
343 | $minified_url = $this->minify_single( $path ); |
|
344 | if ( ! empty( $minified_url ) ) { |
|
345 | // Replace orig URL with cached minified URL. |
|
346 | $new_tag = str_replace( $url, $minified_url, $tag ); |
|
347 | } elseif ( apply_filters( 'autoptimize_filter_ccsjs_remove_empty_minified_url', false ) ) { |
|
348 | // Remove the original style tag, because cache content is empty but only if |
|
349 | // filter is true-ed because $minified_url is also false if file is minified already. |
|
350 | $new_tag = ''; |
|
351 | } |
|
352 | } |
|
353 | } |
|
354 | ||
355 | if ( '' !== $new_tag ) { |
|
356 | // Optionally defer (preload) non-aggregated CSS. |
@@ 366-379 (lines=14) @@ | ||
363 | // Should we minify the non-aggregated script? |
|
364 | // -> if aggregate is on and exclude minify is on |
|
365 | // -> if aggregate is off and the file is not in dontmove. |
|
366 | if ( $path && $this->minify_excluded ) { |
|
367 | $consider_minified_array = apply_filters( 'autoptimize_filter_js_consider_minified', false ); |
|
368 | if ( ( false === $this->aggregate && str_replace( $this->dontmove, '', $path ) === $path ) || ( true === $this->aggregate && ( false === $consider_minified_array || str_replace( $consider_minified_array, '', $path ) === $path ) ) ) { |
|
369 | $minified_url = $this->minify_single( $path ); |
|
370 | if ( ! empty( $minified_url ) ) { |
|
371 | // Replace original URL with minified URL from cache. |
|
372 | $new_tag = str_replace( $url, $minified_url, $new_tag ); |
|
373 | } elseif ( apply_filters( 'autoptimize_filter_ccsjs_remove_empty_minified_url', false ) ) { |
|
374 | // Remove the original script tag, because cache content is empty but only if filter |
|
375 | // is trued because $minified_url is also false if original JS is minified already. |
|
376 | $new_tag = ''; |
|
377 | } |
|
378 | } |
|
379 | } |
|
380 | ||
381 | if ( $this->ismovable( $new_tag ) ) { |
|
382 | // can be moved, flags and all. |