From 5a4115222ef2c7d289b235fc29f418089694aa5a Mon Sep 17 00:00:00 2001 From: M_Viper Date: Mon, 30 Mar 2026 18:42:37 +0000 Subject: [PATCH] Upload via Git Manager GUI - test-api-key.php --- Minecraft-Modern-Theme/test-api-key.php | 196 ++++++++++++------------ 1 file changed, 98 insertions(+), 98 deletions(-) diff --git a/Minecraft-Modern-Theme/test-api-key.php b/Minecraft-Modern-Theme/test-api-key.php index a320528..436647b 100644 --- a/Minecraft-Modern-Theme/test-api-key.php +++ b/Minecraft-Modern-Theme/test-api-key.php @@ -1,98 +1,98 @@ - 10)); - -if (is_wp_error($response)) { - echo "❌ Fehler beim API Request: " . $response->get_error_message() . "\n"; - exit; -} - -$status_code = wp_remote_retrieve_response_code($response); -echo "HTTP Status: $status_code\n\n"; - -if ($status_code !== 200) { - echo "❌ API Fehler (Status $status_code)\n"; - $body = wp_remote_retrieve_body($response); - $data = json_decode($body, true); - - if (isset($data['error']['message'])) { - echo "Fehlermeldung: " . $data['error']['message'] . "\n"; - - if (strpos($data['error']['message'], 'API key not valid') !== false) { - echo "\n⚠️ Der API Key ist ungültig!\n"; - echo "Bitte überprüfe den Key im Customizer oder erstelle einen neuen.\n"; - } - } - exit; -} - -$body = wp_remote_retrieve_body($response); -$data = json_decode($body, true); - -if (empty($data['items'])) { - echo "❌ Video nicht gefunden oder nicht verfügbar\n"; - exit; -} - -echo "✅ API Key funktioniert!\n\n"; - -$video = $data['items'][0]; -$title = $video['snippet']['title'] ?? 'Unbekannt'; -$state = $video['snippet']['liveBroadcastContent'] ?? 'none'; - -echo "Video Titel: $title\n"; -echo "Live Status: $state\n"; - -if ($state === 'live') { - echo "🔴 Das Video ist LIVE!\n"; -} elseif ($state === 'upcoming') { - echo "⏰ Das Video ist geplant (noch nicht live)\n"; -} else { - echo "⚫ Das Video ist NICHT live (aufgezeichnet oder offline)\n"; -} - -echo "\n=== Test erfolgreich ===\n"; + 10)); + +if (is_wp_error($response)) { + echo "❌ Fehler beim API Request: " . $response->get_error_message() . "\n"; + exit; +} + +$status_code = wp_remote_retrieve_response_code($response); +echo "HTTP Status: $status_code\n\n"; + +if ($status_code !== 200) { + echo "❌ API Fehler (Status $status_code)\n"; + $body = wp_remote_retrieve_body($response); + $data = json_decode($body, true); + + if (isset($data['error']['message'])) { + echo "Fehlermeldung: " . $data['error']['message'] . "\n"; + + if (strpos($data['error']['message'], 'API key not valid') !== false) { + echo "\n⚠️ Der API Key ist ungültig!\n"; + echo "Bitte überprüfe den Key im Customizer oder erstelle einen neuen.\n"; + } + } + exit; +} + +$body = wp_remote_retrieve_body($response); +$data = json_decode($body, true); + +if (empty($data['items'])) { + echo "❌ Video nicht gefunden oder nicht verfügbar\n"; + exit; +} + +echo "✅ API Key funktioniert!\n\n"; + +$video = $data['items'][0]; +$title = $video['snippet']['title'] ?? 'Unbekannt'; +$state = $video['snippet']['liveBroadcastContent'] ?? 'none'; + +echo "Video Titel: $title\n"; +echo "Live Status: $state\n"; + +if ($state === 'live') { + echo "🔴 Das Video ist LIVE!\n"; +} elseif ($state === 'upcoming') { + echo "⏰ Das Video ist geplant (noch nicht live)\n"; +} else { + echo "⚫ Das Video ist NICHT live (aufgezeichnet oder offline)\n"; +} + +echo "\n=== Test erfolgreich ===\n";