From 4c5d8b07dc561e46ec79b3a9bc41dc9ebc1148e1 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Sun, 15 Mar 2026 09:46:21 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20og:image=20header=20extraction=20?= =?UTF-8?q?=E2=80=94=20header=20is=20manual=20upload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- api/setup/analyzeMenuUrl.php | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/api/setup/analyzeMenuUrl.php b/api/setup/analyzeMenuUrl.php index d60ecb0..0f7c391 100644 --- a/api/setup/analyzeMenuUrl.php +++ b/api/setup/analyzeMenuUrl.php @@ -292,31 +292,6 @@ JSEOF; } $siteName = $bizInfo['name'] ?? ''; - // 3. Extract header image from og:image or JSON-LD image - $headerImageUrl = ''; - // Try og:image meta tag first (most common for restaurants) - if (preg_match('#]*type=["\']application/ld\+json["\'][^>]*>([^<]+)#i', $html, $ldImgMatches)) { - foreach ($ldImgMatches[1] as $ldJson) { - $ld = json_decode($ldJson, true); - if (!is_array($ld)) continue; - $entries = isset($ld['@graph']) ? $ld['@graph'] : [$ld]; - foreach ($entries as $entry) { - if (!empty($entry['image'])) { - $img = $entry['image']; - if (is_string($img)) { $headerImageUrl = $img; break 2; } - if (is_array($img) && !empty($img['url'])) { $headerImageUrl = $img['url']; break 2; } - if (is_array($img) && isset($img[0])) { $headerImageUrl = is_string($img[0]) ? $img[0] : ($img[0]['url'] ?? ''); break 2; } - } - } - } - } - // Parse address into components if only full string if (!empty($bizInfo['address']) && empty($bizInfo['addressLine1'])) { $addr = $bizInfo['address']; @@ -468,7 +443,6 @@ JSEOF; 'platformPages' => $platformPages, 'hasPlatform' => $hasPlatform, 'totalPagesFound' => count($menuPages), - 'headerImageUrl' => $headerImageUrl, ]); }