@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | * be inlined into a data: URI. Defaults to 4096, passed through |
| 440 | 440 | * `autoptimize_filter_css_datauri_maxsize` filter. |
| 441 | 441 | * |
| 442 | - * @return mixed |
|
| 442 | + * @return integer|null |
|
| 443 | 443 | */ |
| 444 | 444 | private function get_datauri_maxsize() |
| 445 | 445 | { |
@@ -460,6 +460,9 @@ discard block |
||
| 460 | 460 | return $max_size; |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | + /** |
|
| 464 | + * @param false|string $url |
|
| 465 | + */ |
|
| 463 | 466 | private function check_datauri_exclude_list( $url ) |
| 464 | 467 | { |
| 465 | 468 | static $exclude_list = null; |
@@ -485,6 +488,9 @@ discard block |
||
| 485 | 488 | return $matched; |
| 486 | 489 | } |
| 487 | 490 | |
| 491 | + /** |
|
| 492 | + * @param false|string $path |
|
| 493 | + */ |
|
| 488 | 494 | private function build_or_get_datauri_image( $path ) |
| 489 | 495 | { |
| 490 | 496 | /** |
@@ -914,6 +920,11 @@ discard block |
||
| 914 | 920 | return true; |
| 915 | 921 | } |
| 916 | 922 | |
| 923 | + /** |
|
| 924 | + * @param string $code |
|
| 925 | + * |
|
| 926 | + * @return string |
|
| 927 | + */ |
|
| 917 | 928 | public function run_minifier_on( $code ) |
| 918 | 929 | { |
| 919 | 930 | if ( ! $this->alreadyminified ) { |
@@ -1135,6 +1146,9 @@ discard block |
||
| 1135 | 1146 | return $code; |
| 1136 | 1147 | } |
| 1137 | 1148 | |
| 1149 | + /** |
|
| 1150 | + * @param string $tag |
|
| 1151 | + */ |
|
| 1138 | 1152 | private function ismovable( $tag ) |
| 1139 | 1153 | { |
| 1140 | 1154 | if ( ! $this->aggregate ) { |
@@ -1164,6 +1178,9 @@ discard block |
||
| 1164 | 1178 | } |
| 1165 | 1179 | } |
| 1166 | 1180 | |
| 1181 | + /** |
|
| 1182 | + * @param string $css |
|
| 1183 | + */ |
|
| 1167 | 1184 | private function can_inject_late( $css_path, $css ) |
| 1168 | 1185 | { |
| 1169 | 1186 | $consider_minified_array = apply_filters( 'autoptimize_filter_css_consider_minified', false, $css_path ); |
@@ -1195,7 +1212,7 @@ discard block |
||
| 1195 | 1212 | * @param string $filepath Filepath. |
| 1196 | 1213 | * @param bool $cache_miss Optional. Force a cache miss. Default false. |
| 1197 | 1214 | * |
| 1198 | - * @return bool|string Url pointing to the minified css file or false. |
|
| 1215 | + * @return false|string Url pointing to the minified css file or false. |
|
| 1199 | 1216 | */ |
| 1200 | 1217 | public function minify_single( $filepath, $cache_miss = false ) |
| 1201 | 1218 | { |
@@ -1256,6 +1273,9 @@ discard block |
||
| 1256 | 1273 | $this->options = $options; |
| 1257 | 1274 | } |
| 1258 | 1275 | |
| 1276 | + /** |
|
| 1277 | + * @param string $name |
|
| 1278 | + */ |
|
| 1259 | 1279 | public function setOption( $name, $value ) |
| 1260 | 1280 | { |
| 1261 | 1281 | $this->options[ $name ] = $value; |
@@ -378,6 +378,9 @@ discard block |
||
| 378 | 378 | } |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | + /** |
|
| 382 | + * @return string |
|
| 383 | + */ |
|
| 381 | 384 | private function get_imgopt_base_url() |
| 382 | 385 | { |
| 383 | 386 | static $imgopt_base_url = null; |
@@ -750,6 +753,9 @@ discard block |
||
| 750 | 753 | return $out; |
| 751 | 754 | } |
| 752 | 755 | |
| 756 | + /** |
|
| 757 | + * @param string $tag |
|
| 758 | + */ |
|
| 753 | 759 | public function add_lazyload( $tag, $placeholder = '' ) { |
| 754 | 760 | // adds actual lazyload-attributes to an image node. |
| 755 | 761 | if ( str_ireplace( $this->get_lazyload_exclusions(), '', $tag ) === $tag ) { |
@@ -832,6 +838,9 @@ discard block |
||
| 832 | 838 | } |
| 833 | 839 | } |
| 834 | 840 | |
| 841 | + /** |
|
| 842 | + * @return string |
|
| 843 | + */ |
|
| 835 | 844 | public function get_cdn_url() { |
| 836 | 845 | // getting CDN url here to avoid having to make bigger changes to autoptimizeBase. |
| 837 | 846 | static $cdn_url = null; |
@@ -935,6 +944,9 @@ discard block |
||
| 935 | 944 | return $out; |
| 936 | 945 | } |
| 937 | 946 | |
| 947 | + /** |
|
| 948 | + * @return string |
|
| 949 | + */ |
|
| 938 | 950 | public function process_bgimage( $in ) { |
| 939 | 951 | if ( strpos( $in, 'background-image:' ) !== false && apply_filters( 'autoptimize_filter_imgopt_lazyload_backgroundimages', true ) ) { |
| 940 | 952 | $out = preg_replace_callback( |
@@ -1279,7 +1291,7 @@ discard block |
||
| 1279 | 1291 | /** |
| 1280 | 1292 | * Determines and returns the service launch status. |
| 1281 | 1293 | * |
| 1282 | - * @return bool |
|
| 1294 | + * @return null|boolean |
|
| 1283 | 1295 | */ |
| 1284 | 1296 | public function launch_ok() |
| 1285 | 1297 | { |