<?php
function temaKontrol($siteUrl) {
echo "<h2>🛠 $siteUrl İncelemesi</h2>";
$icerik = @file_get_contents($siteUrl);
if (!$icerik) {
echo "❌ Siteye ulaşılamadı: $siteUrl<br>";
return;
}
// Başlık kontrolü
if (preg_match("/<title>(.*?)<\/title>/i", $icerik, $m)) {
echo "✅ <strong>Başlık:</strong> " . htmlspecialchars($m[1]) . "<br>";
} else {
echo "❌ <strong>Başlık etiketi eksik.</strong><br>";
}
// Meta açıklama
if (preg_match('/<meta\s+name=["\']description["\']\s+content=["\'](.*?)["\']/i', $icerik, $m)) {
echo "✅ <strong>Açıklama:</strong> " . htmlspecialchars($m[1]) . "<br>";
} else {
echo "❌ Meta description bulunamadı.<br>";
}
// Meta keywords
if (preg_match('/<meta\s+name=["\']keywords["\']\s+content=["\'](.*?)["\']/i', $icerik, $m)) {
echo "✅ <strong>Anahtar Kelimeler:</strong> " . htmlspecialchars($m[1]) . "<br>";
} else {
echo "❌ Meta keywords etiketi yok.<br>";
}
// H1 etiketleri
if (preg_match_all("/<h1[^>]*>(.*?)<\/h1>/i", $icerik, $h1s)) {
echo "✅ <strong>H1 Etiketi:</strong> " . count($h1s[1]) . " adet bulundu<br>";
} else {
echo "❌ H1 etiketi yer almıyor.<br>";
}
// Favicon
if (preg_match('/<link[^>]+rel=["\']icon["\'][^>]*>/i', $icerik)) {
echo "✅ Favicon mevcut.<br>";
} else {
echo "❌ Favicon eksik.<br>";
}
// Mobil uyumluluk
if (preg_match('/<meta\s+name=["\']viewport["\']\s+content=["\'].*?width=device-width.*?["\']/i', $icerik)) {
echo "✅ Mobil uyum etiketi var.<br>";
} else {
echo "❌ Mobil uyumlu değil (viewport etiketi yok).<br>";
}
// SSL Kontrol
if (parse_url($siteUrl, PHP_URL_SCHEME) === 'https') {
echo "✅ Güvenli bağlantı (HTTPS).<br>";
} else {
echo "❌ Site HTTPS kullanmıyor.<br>";
}
// Sayfa boyutu
echo "📦 Dosya Boyutu: " . round(strlen($icerik) / 1024, 2) . " KB<br>";
// Açılış süresi
$start = microtime(true);
$ch = curl_init($siteUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
$loadTime = microtime(true) - $start;
curl_close($ch);
echo "⏱️ Açılış Süresi: " . round($loadTime, 2) . " saniye<br>";
// Link kontrolü
echo "<br><strong>🔗 Link Analizi:</strong><br>";
preg_match_all('/<a[^>]+href=["\'](.*?)["\']/i', $icerik, $links);
$kirik = 0;
foreach ($links[1] as $link) {
if (strpos($link, 'http') === 0) {
$header = @get_headers($link);
if (!$header || strpos($header[0], '200') === false) {
echo "❌ Bozuk bağlantı: $link<br>";
$kirik++;
}
}
}
if ($kirik === 0) {
echo "✅ Tüm bağlantılar çalışıyor.<br>";
}
// SEO puanı
$puan = 0;
$puan += preg_match("/<title>(.*?)<\/title>/i", $icerik) ? 10 : 0;
$puan += preg_match('/description/i', $icerik) ? 10 : 0;
$puan += preg_match('/<h1[^>]*>.*?<\/h1>/i', $icerik) ? 10 : 0;
$puan += preg_match('/viewport/i', $icerik) ? 10 : 0;
$puan += preg_match('/<link[^>]+rel=["\']icon["\'][^>]*>/i', $icerik) ? 10 : 0;
$puan += (parse_url($siteUrl, PHP_URL_SCHEME) === 'https') ? 10 : 0;
$puan += ($kirik === 0) ? 10 : 0;
$puan = min($puan, 70);
echo "<br><strong>🎯 SEO Skoru: $puan / 70</strong><br>";
}
// Buraya kendi sitenizin adresini yazın:
$kontrolEdilecekSite = "https://www.ornekwebsitem.com";
temaKontrol($kontrolEdilecekSite);
?>