$option) { if (!get_option(self::appendPrefix($key) and self::validateValue($option['default']))) { add_option(self::appendPrefix($key), $option['default'], '', ($option['autoload'] ?? 'no')); } } update_option(self::appendPrefix('version'), \AlpacaBot\VERSION); } public static function validateValue($value, $default = false) { if (is_string($value) and in_array(strtolower($value), ['true', 'false'])) { return filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); } elseif (is_string($value) and empty($value)) { return $default; } return $value; } }