diff --git a/lib/css_js_min/minify/css.cls.php b/lib/css_js_min/minify/css.cls.php index 6ec8893cf..89a11d959 100644 --- a/lib/css_js_min/minify/css.cls.php +++ b/lib/css_js_min/minify/css.cls.php @@ -230,9 +230,9 @@ protected function combineImports($source, $content, $parents) } /** - * Import files into the CSS, base64-ized. + * Import files into the CSS, base64 encoded. * - * @url(image.jpg) images will be loaded and their content merged into the + * Included images @url(image.jpg) will be loaded and their content merged into the * original file, to save HTTP requests. * * @param string $source The file to import files for @@ -282,7 +282,7 @@ protected function importFiles($source, $content) * Minify the data. * Perform CSS optimizations. * - * @param string[optional] $path Path to write the data to + * @param string|null $path Path to write the data to [optional] * @param string[] $parents Parent paths, for circular reference checks * * @return string The minified data diff --git a/src/admin-settings.cls.php b/src/admin-settings.cls.php index 02c4656d0..a34feac4d 100644 --- a/src/admin-settings.cls.php +++ b/src/admin-settings.cls.php @@ -335,7 +335,7 @@ public static function widget_save_err($location) * @param array $instance The new settings. * @param array $new_instance * @param array $old_instance The original settings. - * @param WP_Widget $widget The widget + * @param \WP_Widget $widget The widget * @return mixed Updated settings on success, false on error. */ public static function validate_widget_save($instance, $new_instance, $old_instance, $widget) diff --git a/src/crawler.cls.php b/src/crawler.cls.php index 6b0a3ee88..d8d66ce2c 100644 --- a/src/crawler.cls.php +++ b/src/crawler.cls.php @@ -621,7 +621,7 @@ private function _prepare_running() private function _take_over_lane() { self::debug('Take over lane as lane is free: ' . $this->json_local_path() . '.pid'); - file::save($this->json_local_path() . '.pid', LITESPEED_LANE_HASH); + File::save($this->json_local_path() . '.pid', LITESPEED_LANE_HASH); } /** @@ -662,7 +662,7 @@ private function _check_valid_lane($strict_mode = false) return false; } } - $pid = file::read($lane_file); + $pid = File::read($lane_file); if ($pid && LITESPEED_LANE_HASH != $pid) { // If lane file is older than 1h, ignore if (time() - filemtime($lane_file) > 3600) { @@ -1420,7 +1420,7 @@ public function display_status($status_row, $reason_set) * * @since 1.1.0 * @access protected - * @param string $error Error info + * @param string $msg Error info */ protected function output($msg) { diff --git a/src/debug2.cls.php b/src/debug2.cls.php index a2e103c7c..82d3591be 100644 --- a/src/debug2.cls.php +++ b/src/debug2.cls.php @@ -59,7 +59,7 @@ private function _maybe_init_folder() if (file_exists(self::$log_path_prefix . 'index.php')) { return; } - file::save(self::$log_path_prefix . 'index.php', '_cfg_debug != BASE::VAL_ON2) { + if (!$show_error && $this->_cfg_debug != Base::VAL_ON2) { return; } diff --git a/src/optimize.cls.php b/src/optimize.cls.php index bfb3664f6..63cf2799f 100644 --- a/src/optimize.cls.php +++ b/src/optimize.cls.php @@ -443,7 +443,7 @@ private function _optimize() $this->html_head .= $this->_build_js_inline(File::read(LSCWP_DIR . self::LIB_FILE_CSS_ASYNC), true); } else { $css_async_lib_url = LSWCP_PLUGIN_URL . self::LIB_FILE_CSS_ASYNC; - $this->html_head .= $this->_build_js_tag($css_async_lib_url, 'litespeed-css-async-lib'); // Don't exclude it from defer for now + $this->html_head .= $this->_build_js_tag($css_async_lib_url); // Don't exclude it from defer for now } } diff --git a/src/purge.cls.php b/src/purge.cls.php index 74133d2ac..b225e840c 100644 --- a/src/purge.cls.php +++ b/src/purge.cls.php @@ -768,7 +768,7 @@ public function purge_tag($val) return; } $term = get_term_by('slug', $val, 'post_tag'); - if ($term == 0) { + if ($term === false) { self::debug("$val tag not exist"); return; } diff --git a/src/str.cls.php b/src/str.cls.php index fb6db126e..535bd4e1b 100644 --- a/src/str.cls.php +++ b/src/str.cls.php @@ -60,8 +60,8 @@ public static function safe_html($html) * * @since 1.3 * @access public - * @param int $len Length of string - * @param int $type 1-Number 2-LowerChar 4-UpperChar + * @param int $len Length of string + * @param int $type 1-Number 2-LowerChar 4-UpperChar * @return string */ public static function rrand($len, $type = 7) diff --git a/src/utility.cls.php b/src/utility.cls.php index 536e55993..84455b08a 100644 --- a/src/utility.cls.php +++ b/src/utility.cls.php @@ -459,8 +459,8 @@ public static function url2uri($url, $keep_qs = false) * * @since 3.0 * @access public - * @param string `https://aa.com/bbb/wp-content/upload/2018/08/test.jpg` or `/bbb/wp-content/upload/2018/08/test.jpg` - * @return string `2018/08/test.jpg` + * @param string $url `https://aa.com/bbb/wp-content/upload/2018/08/test.jpg` or `/bbb/wp-content/upload/2018/08/test.jpg` + * @return string `2018/08/test.jpg` */ public static function att_short_path($url) { @@ -567,8 +567,8 @@ public static function domain_const() * * @since 1.3 * @access public - * @param string $content - * @param bool $type String handler type + * @param array|string $arr + * @param string|null $type String handler type * @return string|array */ public static function sanitize_lines($arr, $type = null) diff --git a/src/vary.cls.php b/src/vary.cls.php index 96f2d19bd..0684c45e7 100644 --- a/src/vary.cls.php +++ b/src/vary.cls.php @@ -766,11 +766,11 @@ private function _get_cookie_val($key) * * @since 1.0.4 * @access private - * @param integer $val The value to update. - * @param integer $expire Expire time. - * @param boolean $path False if use wp root path as cookie path + * @param int|false $val The value to update. + * @param int $expire Expire time. + * @param bool $path False if use wp root path as cookie path */ - private function _cookie($val = false, $expire = false, $path = false) + private function _cookie($val = false, $expire = 0, $path = false) { if (!$val) { $expire = 1;