@@ 185-194 (lines=10) @@ | ||
182 | // Should we minify the non-aggregated script? |
|
183 | // -> if aggregate is on and exclude minify is on |
|
184 | // -> if aggregate is off and the file is not in dontmove. |
|
185 | if ( $path && $this->minify_excluded ) { |
|
186 | $consider_minified_array = apply_filters( 'autoptimize_filter_js_consider_minified', false ); |
|
187 | if ( ( false === $this->aggregate && str_replace( $this->dontmove, '', $path ) === $path ) || ( true === $this->aggregate && ( false === $consider_minified_array || str_replace( $consider_minified_array, '', $path ) === $path ) ) ) { |
|
188 | $minified_url = $this->minify_single( $path ); |
|
189 | // replace orig URL with minified URL from cache if so. |
|
190 | if ( ! empty( $minified_url ) ) { |
|
191 | $newTag = str_replace( $url, $minified_url, $newTag ); |
|
192 | } |
|
193 | } |
|
194 | } |
|
195 | ||
196 | if ( $this->ismovable($newTag) ) { |
|
197 | // can be moved, flags and all. |
@@ 222-231 (lines=10) @@ | ||
219 | // Excluded CSS, minify that file: |
|
220 | // -> if aggregate is on and exclude minify is on |
|
221 | // -> if aggregate is off and the file is not in dontmove. |
|
222 | if ( $path && $this->minify_excluded ) { |
|
223 | $consider_minified_array = apply_filters( 'autoptimize_filter_css_consider_minified', false ); |
|
224 | if ( ( false === $this->aggregate && str_replace( $this->dontmove, '', $path ) === $path ) || ( true === $this->aggregate && ( false === $consider_minified_array || str_replace( $consider_minified_array, '', $path ) === $path ) ) ) { |
|
225 | $minified_url = $this->minify_single( $path ); |
|
226 | if ( ! empty( $minified_url ) ) { |
|
227 | // Replace orig URL with cached minified URL. |
|
228 | $new_tag = str_replace( $url, $minified_url, $tag ); |
|
229 | } |
|
230 | } |
|
231 | } |
|
232 | ||
233 | // Optionally defer (preload) non-aggregated CSS. |
|
234 | $new_tag = $this->optionally_defer_excluded( $new_tag, $url ); |