@@ 787-792 (lines=6) @@ | ||
784 | $css = self::fixurls( $css_path, file_get_contents( $css_path ) ); |
|
785 | $css = preg_replace( '/\x{EF}\x{BB}\x{BF}/', '', $css ); |
|
786 | $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $css, $css_path ); |
|
787 | if ( has_filter( 'autoptimize_css_individual_style' ) && ! empty( $tmpstyle ) ) { |
|
788 | $css = $tmpstyle; |
|
789 | $this->alreadyminified = true; |
|
790 | } elseif ( $this->can_inject_late( $css_path, $css ) ) { |
|
791 | $css = self::build_injectlater_marker( $css_path, md5( $css ) ); |
|
792 | } |
|
793 | } else { |
|
794 | // Couldn't read CSS. Maybe getpath isn't working? |
|
795 | $css = ''; |
|
@@ 850-855 (lines=6) @@ | ||
847 | $code = addcslashes( self::fixurls( $path, file_get_contents( $path ) ), '\\' ); |
|
848 | $code = preg_replace( '/\x{EF}\x{BB}\x{BF}/', '', $code ); |
|
849 | $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $code, '' ); |
|
850 | if ( has_filter( 'autoptimize_css_individual_style' ) && ! empty( $tmpstyle ) ) { |
|
851 | $code = $tmpstyle; |
|
852 | $this->alreadyminified = true; |
|
853 | } elseif ( $this->can_inject_late( $path, $code ) ) { |
|
854 | $code = self::build_injectlater_marker( $path, md5( $code ) ); |
|
855 | } |
|
856 | ||
857 | if ( ! empty( $code ) ) { |
|
858 | $tmp_thiscss = preg_replace( '#(/\*FILESTART\*/.*)' . preg_quote( $import, '#' ) . '#Us', '/*FILESTART2*/' . $code . '$1', $thiscss ); |
@@ 522-527 (lines=6) @@ | ||
519 | $scriptsrc = 'try{' . $scriptsrc . '}catch(e){}'; |
|
520 | } |
|
521 | $tmpscriptsrc = apply_filters( 'autoptimize_js_individual_script', $scriptsrc, $script ); |
|
522 | if ( has_filter( 'autoptimize_js_individual_script' ) && ! empty( $tmpscriptsrc ) ) { |
|
523 | $scriptsrc = $tmpscriptsrc; |
|
524 | $this->alreadyminified = true; |
|
525 | } elseif ( $this->can_inject_late( $script ) ) { |
|
526 | $scriptsrc = self::build_injectlater_marker( $script, md5( $scriptsrc ) ); |
|
527 | } |
|
528 | $this->jscode .= "\n" . $scriptsrc; |
|
529 | } |
|
530 | } |