@@ -1,5 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
|
2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
3 | + exit; |
|
4 | +} |
|
5 | +// Exit if accessed directly |
|
3 | 6 | |
4 | 7 | class autoptimizeStyles extends autoptimizeBase { |
5 | 8 | |
@@ -25,7 +28,9 @@ discard block |
||
25 | 28 | //Reads the page and collects style tags |
26 | 29 | public function read($options) { |
27 | 30 | $noptimizeCSS = apply_filters( 'autoptimize_filter_css_noptimize', false, $this->content ); |
28 | - if ($noptimizeCSS) return false; |
|
31 | + if ($noptimizeCSS) { |
|
32 | + return false; |
|
33 | + } |
|
29 | 34 | |
30 | 35 | $whitelistCSS = apply_filters( 'autoptimize_filter_css_whitelist', '' ); |
31 | 36 | if (!empty($whitelistCSS)) { |
@@ -139,7 +144,7 @@ discard block |
||
139 | 144 | if($path!==false && preg_match('#\.css$#',$path)) { |
140 | 145 | // Good link |
141 | 146 | $this->css[] = array($media,$path); |
142 | - }else{ |
|
147 | + } else{ |
|
143 | 148 | // Link is dynamic (.php etc) |
144 | 149 | $tag = ''; |
145 | 150 | } |
@@ -202,8 +207,9 @@ discard block |
||
202 | 207 | } |
203 | 208 | |
204 | 209 | foreach($media as $elem) { |
205 | - if(!isset($this->csscode[$elem])) |
|
206 | - $this->csscode[$elem] = ''; |
|
210 | + if(!isset($this->csscode[$elem])) { |
|
211 | + $this->csscode[$elem] = ''; |
|
212 | + } |
|
207 | 213 | $this->csscode[$elem] .= "\n/*FILESTART*/".$css; |
208 | 214 | } |
209 | 215 | } |