$indexStatus `inspectionResult.indexStatusResult` der URL Inspection API */ public static function fromIndexStatus(array $indexStatus): self { $verdict = strtoupper((string) ($indexStatus['verdict'] ?? '')); $coverage = mb_strtolower((string) ($indexStatus['coverageState'] ?? '')); $indexing = strtoupper((string) ($indexStatus['indexingState'] ?? '')); $robots = strtoupper((string) ($indexStatus['robotsTxtState'] ?? '')); $fetch = strtoupper((string) ($indexStatus['pageFetchState'] ?? '')); $crawled = ! empty($indexStatus['lastCrawlTime']); if ($verdict === 'PASS' || (str_contains($coverage, 'indexed') && ! str_contains($coverage, 'not indexed'))) { return self::Indexed; } if ($robots === 'DISALLOWED' || in_array($indexing, ['BLOCKED_BY_META_TAG', 'BLOCKED_BY_HTTP_HEADER', 'BLOCKED_BY_ROBOTS_TXT'], true) || ($fetch !== '' && $fetch !== 'SUCCESSFUL' && $crawled) || str_contains($coverage, 'duplicate') || str_contains($coverage, 'canonical') || str_contains($coverage, 'redirect') || str_contains($coverage, 'noindex') || str_contains($coverage, 'blocked')) { return self::Excluded; } if (! $crawled) { return $verdict === '' && $coverage === '' ? self::Unknown : self::NotCrawled; } return self::CrawledNotIndexed; } public function label(): string { return match ($this) { self::Indexed => 'indexiert', self::CrawledNotIndexed => 'gecrawlt, nicht indexiert', self::NotCrawled => 'noch nicht gecrawlt', self::Excluded => 'ausgeschlossen', self::Unknown => 'unbekannt', }; } }