| @@ 314-319 (lines=6) @@ | ||
| 311 | $scriptsrc = 'try{' . $scriptsrc . '}catch(e){}'; |
|
| 312 | } |
|
| 313 | $tmpscriptsrc = apply_filters( 'autoptimize_js_individual_script', $scriptsrc, $script ); |
|
| 314 | if ( has_filter( 'autoptimize_js_individual_script' ) && ! empty( $tmpscriptsrc ) ) { |
|
| 315 | $scriptsrc = $tmpscriptsrc; |
|
| 316 | $this->alreadyminified = true; |
|
| 317 | } else if ( $this->can_inject_late($script) ) { |
|
| 318 | $scriptsrc = self::build_injectlater_marker($script, md5($scriptsrc)); |
|
| 319 | } |
|
| 320 | $this->jscode .= "\n" . $scriptsrc; |
|
| 321 | }/*else{ |
|
| 322 | //Couldn't read JS. Maybe getpath isn't working? |
|
| @@ 623-628 (lines=6) @@ | ||
| 620 | $css = self::fixurls( $cssPath, file_get_contents( $cssPath ) ); |
|
| 621 | $css = preg_replace( '/\x{EF}\x{BB}\x{BF}/', '', $css ); |
|
| 622 | $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $css, $cssPath ); |
|
| 623 | if ( has_filter( 'autoptimize_css_individual_style' ) && ! empty( $tmpstyle ) ) { |
|
| 624 | $css = $tmpstyle; |
|
| 625 | $this->alreadyminified = true; |
|
| 626 | } elseif ( $this->can_inject_late( $cssPath, $css ) ) { |
|
| 627 | $css = self::build_injectlater_marker( $cssPath, md5( $css ) ); |
|
| 628 | } |
|
| 629 | } else { |
|
| 630 | // Couldn't read CSS. Maybe getpath isn't working? |
|
| 631 | $css = ''; |
|
| @@ 686-691 (lines=6) @@ | ||
| 683 | $code = addcslashes( self::fixurls( $path, file_get_contents( $path ) ), "\\" ); |
|
| 684 | $code = preg_replace( '/\x{EF}\x{BB}\x{BF}/', '', $code ); |
|
| 685 | $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $code, '' ); |
|
| 686 | if ( has_filter( 'autoptimize_css_individual_style' ) && ! empty( $tmpstyle ) ) { |
|
| 687 | $code = $tmpstyle; |
|
| 688 | $this->alreadyminified = true; |
|
| 689 | } elseif ( $this->can_inject_late( $path, $code ) ) { |
|
| 690 | $code = self::build_injectlater_marker( $path, md5( $code ) ); |
|
| 691 | } |
|
| 692 | ||
| 693 | if ( ! empty( $code ) ) { |
|
| 694 | $tmp_thiscss = preg_replace( '#(/\*FILESTART\*/.*)' . preg_quote( $import, '#' ) . '#Us', '/*FILESTART2*/' . $code . '$1', $thiscss ); |
|