['siteProfile' => $siteProfile]], null, true ); $description = self::text($response['response']['heroDescription'] ?? ''); if ($description === '') { // Leave the option unset so a failed reply retries on the next open. return ''; } \update_option('extendify_hero_description', Sanitizer::sanitizeText($description)); return $description; } /** * A trimmed string, whatever the value was. * * @param mixed $value - The value to read. * @return string */ private static function text($value) { return is_string($value) ? trim($value) : ''; } }