diff --git a/.gitattributes b/.gitattributes index 6e9e67f..2629d26 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,4 +4,4 @@ /.eslintrc.js export-ignore /.gitattributes export-ignore /.gitignore export-ignore -/readme.md export-ignore +/readme.md export-ignore \ No newline at end of file diff --git a/includes/system/Environment.php b/includes/system/Environment.php index 627b8b9..2e45a0e 100644 --- a/includes/system/Environment.php +++ b/includes/system/Environment.php @@ -723,25 +723,15 @@ public static function is_updated($old) { } /** - * Is the WP update system enabled? - * - * @since 3.1.3 - */ - public static function is_updatable() { - $result = true; - if (defined('AUTOMATIC_UPDATER_DISABLED')) { - $result = !AUTOMATIC_UPDATER_DISABLED; - } - return $result; - } - - /** - * Is the plugin auto-update enabled? + * Checks if the plugin's auto-update is enabled. * * @since 3.1.3 + * @return bool Returns true if auto-update is enabled, false otherwise. */ public static function is_autoupdatable() { - return (self::is_updatable() && get_option('live_weather_station_auto_update')); + $is_updatable = self::is_updatable(); + $auto_update_option = get_option('live_weather_station_auto_update'); + return ($is_updatable && $auto_update_option); } /** diff --git a/includes/traits/DataUnitConversion.php b/includes/traits/DataUnitConversion.php index 84f014d..d27a8ee 100644 --- a/includes/traits/DataUnitConversion.php +++ b/includes/traits/DataUnitConversion.php @@ -703,16 +703,19 @@ protected function get_reverse_illuminance($value) } /** - * Get the wind angle expressed in its unique unit. - * - * @param mixed $value The value of the wind angle. - * @return string The wind angle expressed in its unique unit. - * @since 1.0.0 - */ - protected function get_wind_angle($value) + * Get the wind angle expressed in its unique unit. + * + * @param mixed $windAngle The value of the wind angle. (Assumed to be numeric) + * @return string The wind angle expressed in its unique unit. + * @since 1.0.0 + */ + protected function get_wind_angle($windAngle) { - $result = $value; - return sprintf('%d', round($result, 0)); + if (is_numeric()) { + return sprintf('%d', round($windAngle, 0)); + } else { + return 'Invalid input'; + } } /**