@@ -139,6 +139,10 @@ discard block |
||
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | // hide everything between noptimize-comment tags |
| 142 | + |
|
| 143 | + /** |
|
| 144 | + * @param string $noptimize_in |
|
| 145 | + */ |
|
| 142 | 146 | protected function hide_noptimize($noptimize_in) { |
| 143 | 147 | if ( preg_match( '/<!--\s?noptimize\s?-->/', $noptimize_in ) ) { |
| 144 | 148 | $noptimize_out = preg_replace_callback( |
@@ -267,6 +271,9 @@ discard block |
||
| 267 | 271 | return $url; |
| 268 | 272 | } |
| 269 | 273 | |
| 274 | + /** |
|
| 275 | + * @param string $payload |
|
| 276 | + */ |
|
| 270 | 277 | protected function inject_in_html($payload,$replaceTag) { |
| 271 | 278 | if (strpos($this->content,$replaceTag[0])!== false) { |
| 272 | 279 | if ($replaceTag[1]==="after") { |
@@ -286,6 +293,9 @@ discard block |
||
| 286 | 293 | } |
| 287 | 294 | } |
| 288 | 295 | |
| 296 | + /** |
|
| 297 | + * @param string $tag |
|
| 298 | + */ |
|
| 289 | 299 | protected function isremovable($tag, $removables) { |
| 290 | 300 | foreach ($removables as $match) { |
| 291 | 301 | if (strpos($tag,$match)!==false) { |
@@ -296,6 +306,10 @@ discard block |
||
| 296 | 306 | } |
| 297 | 307 | |
| 298 | 308 | // inject already minified code in optimized JS/CSS |
| 309 | + |
|
| 310 | + /** |
|
| 311 | + * @return string |
|
| 312 | + */ |
|
| 299 | 313 | protected function inject_minified($in) { |
| 300 | 314 | if ( strpos( $in, '%%INJECTLATER%%' ) !== false ) { |
| 301 | 315 | $out = preg_replace_callback( |
@@ -340,6 +354,9 @@ discard block |
||
| 340 | 354 | return $out; |
| 341 | 355 | } |
| 342 | 356 | |
| 357 | + /** |
|
| 358 | + * @param string $pathIn |
|
| 359 | + */ |
|
| 343 | 360 | protected function minify_single($pathIn) { |
| 344 | 361 | // determine JS or CSS and set var (also mimetype), return false if neither |
| 345 | 362 | if ( $this->str_ends_in($pathIn,".js") === true ) { |
@@ -403,6 +420,9 @@ discard block |
||
| 403 | 420 | return $_CachedMinifiedUrl; |
| 404 | 421 | } |
| 405 | 422 | |
| 423 | + /** |
|
| 424 | + * @param string $needle |
|
| 425 | + */ |
|
| 406 | 426 | protected function str_ends_in($haystack,$needle) { |
| 407 | 427 | $needleLength = strlen($needle); |
| 408 | 428 | $haystackLength = strlen($haystack); |
@@ -656,6 +656,9 @@ |
||
| 656 | 656 | return $code; |
| 657 | 657 | } |
| 658 | 658 | |
| 659 | + /** |
|
| 660 | + * @param string $tag |
|
| 661 | + */ |
|
| 659 | 662 | private function ismovable($tag) {
|
| 660 | 663 | if (apply_filters('autoptimize_filter_css_dontaggregate',false)) {
|
| 661 | 664 | return false; |