| @@ -27,9 +27,9 @@ | ||
| 27 | 27 | * |
| 28 | 28 | * @return bool |
| 29 | 29 | */ |
| 30 | 30 | public function is_enabled() { |
| 31 | - return $this->get('enabled'); | |
| 31 | + return (bool) $this->get('enabled'); | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Removes all Minify settings from the Database if 'preserve_settings_on_uninstall' is false |
| @@ -48,9 +48,9 @@ | ||
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Get config from file or cache |
| 51 | 51 | * |
| 52 | - * @param string $option - An option name | |
| 52 | + * @param ?string $option - An option name | |
| 53 | 53 | * @param mixed $default - A default for the option |
| 54 | 54 | * @return array|string |
| 55 | 55 | */ |
| 56 | 56 | public function get($option = null, $default = false) { |
| @@ -118,19 +118,20 @@ | ||
| 118 | 118 | 'emoji_removal' => true, |
| 119 | 119 | 'merge_google_fonts' => true, |
| 120 | 120 | 'enable_display_swap' => true, |
| 121 | 121 | 'remove_googlefonts' => false, |
| 122 | + 'host_local_google_fonts' => false, | |
| 122 | 123 | 'disable_google_fonts_processing' => false, |
| 123 | 124 | 'gfonts_method' => 'inherit', // inline, async, exclude |
| 124 | 125 | 'fawesome_method' => 'inherit', // inline, async, exclude |
| 125 | 126 | 'enable_css' => true, |
| 126 | 127 | 'enable_css_minification' => true, |
| 127 | - 'enable_merging_of_css' => true, | |
| 128 | + 'enable_merging_of_css' => false, | |
| 128 | 129 | 'remove_print_mediatypes' => false, |
| 129 | 130 | 'inline_css' => false, |
| 130 | 131 | 'enable_js' => true, |
| 131 | 132 | 'enable_js_minification' => true, |
| 132 | - 'enable_merging_of_js' => true, | |
| 133 | + 'enable_merging_of_js' => false, | |
| 133 | 134 | 'enable_defer_js' => 'individual', |
| 134 | 135 | 'defer_js_type' => 'defer', |
| 135 | 136 | 'defer_jquery' => true, |
| 136 | 137 | 'enable_js_trycatch' => false, |
| @@ -137,8 +138,12 @@ | ||
| 137 | 138 | 'exclude_defer_login' => true, |
| 138 | 139 | 'cdn_url' => '', |
| 139 | 140 | 'cdn_force' => false, |
| 140 | 141 | |
| 142 | + 'enable_delay_js' => false, | |
| 143 | + 'enable_preload_js' => false, | |
| 144 | + 'exclude_delay_js' => '', | |
| 145 | + | |
| 141 | 146 | 'async_css' => '', |
| 142 | 147 | 'async_js' => '', |
| 143 | 148 | 'disable_css_inline_merge' => true, |
| 144 | 149 | /** |
| @@ -169,8 +174,10 @@ | ||
| 169 | 174 | |
| 170 | 175 | 'enable_analytics' => false, |
| 171 | 176 | 'analytics_method' => 'gtagv4', |
| 172 | 177 | 'tracking_id' => '', |
| 178 | + | |
| 179 | + 'enable_unused_css' => false, | |
| 173 | 180 | ); |
| 174 | 181 | return apply_filters('wpo_minify_defaults', $defaults); |
| 175 | 182 | } |
| 176 | 183 | |
| @@ -184,9 +191,10 @@ | ||
| 184 | 191 | * Filters the result of always_purge_everything |
| 185 | 192 | * |
| 186 | 193 | * @return boolean |
| 187 | 194 | */ |
| 188 | - return apply_filters('wpo_minify_always_purge_everything', 0 === intval($this->get('cache_lifespan')) || (defined('WPO_ADVANCED_CACHE') && defined('WP_CACHE') && WP_CACHE)); | |
| 195 | + $filtered_value = apply_filters('wpo_minify_always_purge_everything', 0 === intval($this->get('cache_lifespan')) || (defined('WPO_ADVANCED_CACHE') && defined('WP_CACHE') && WP_CACHE)); | |
| 196 | + return is_bool($filtered_value) ? $filtered_value : false; | |
| 189 | 197 | } |
| 190 | 198 | |
| 191 | 199 | /** |
| 192 | 200 | * Get the instance |