|
@@ 836-848 (lines=13) @@
|
| 833 |
|
if ( apply_filters( 'autoptimize_filter_css_critcss_minify', true ) ) { |
| 834 |
|
$iCssHash = md5( $defer_inline_code ); |
| 835 |
|
$iCssCache = new autoptimizeCache( $iCssHash, 'css' ); |
| 836 |
|
if ( $iCssCache->check() ) { |
| 837 |
|
// we have the optimized inline CSS in cache. |
| 838 |
|
$defer_inline_code = $iCssCache->retrieve(); |
| 839 |
|
} else { |
| 840 |
|
$cssmin = new autoptimizeCSSmin(); |
| 841 |
|
$tmp_code = trim( $cssmin->run( $defer_inline_code ) ); |
| 842 |
|
|
| 843 |
|
if ( ! empty( $tmp_code ) ) { |
| 844 |
|
$defer_inline_code = $tmp_code; |
| 845 |
|
$iCssCache->cache( $defer_inline_code, 'text/css' ); |
| 846 |
|
unset( $tmp_code ); |
| 847 |
|
} |
| 848 |
|
} |
| 849 |
|
} |
| 850 |
|
$code_out = '<style type="text/css" id="aoatfcss" media="all">' . $defer_inline_code . '</style>'; |
| 851 |
|
$this->inject_in_html( $code_out, $replaceTag ); |
|
@@ 1037-1047 (lines=11) @@
|
| 1034 |
|
$cache = new autoptimizeCache( $hash, 'css' ); |
| 1035 |
|
|
| 1036 |
|
// If not in cache already, minify... |
| 1037 |
|
if ( ! $cache->check() || $cache_miss ) { |
| 1038 |
|
// Fixurls... |
| 1039 |
|
$contents = self::fixurls( $filepath, $contents ); |
| 1040 |
|
// CDN-replace any referenced assets if needed... |
| 1041 |
|
$contents = $this->replace_urls( $contents ); |
| 1042 |
|
// Now minify... |
| 1043 |
|
$cssmin = new autoptimizeCSSmin(); |
| 1044 |
|
$contents = trim( $cssmin->run( $contents ) ); |
| 1045 |
|
// Store in cache. |
| 1046 |
|
$cache->cache( $contents, 'text/css' ); |
| 1047 |
|
} |
| 1048 |
|
|
| 1049 |
|
$url = $this->build_minify_single_url( $cache ); |
| 1050 |
|
|