SEO Dashboard
Initiating Crawl…
Evaluating 25+ Technical SEO checks, tags, and Core Web Vitals.
Overall SEO Health
—
Run audit to start
Critical Errors
0
Requires immediate fix
Warnings
0
Optimization opportunities
Passed Checks
0
Fully compliant
Category Audit Performance
Technical SEO
0%
On-Page SEO
0%
PageSpeed & UX
0%
Indexability & Crawlability
0%
Audit Distribution
High Priority Fixes
No audit performed yet. Enter a URL above to inspect website.
Recent Saved Audits
No previous audits found in storage.
Enterprise Cloud Monitoring
Features
`
}
};
// Initialize Application
window.onload = function() {
initTheme();
initCharts();
renderEducationHub();
loadHistoryFromStorage();
};
// Navigation Switching
function switchTab(tabId) {
state.currentTab = tabId;
document.querySelectorAll('.tab-content').forEach(el => el.classList.add('hidden'));
document.querySelectorAll('.nav-item').forEach(el => {
el.classList.remove('bg-sky-50', 'dark:bg-sky-900/40', 'text-sky-600', 'dark:text-sky-400');
el.classList.add('text-slate-600', 'dark:text-slate-400');
});
document.getElementById(`tab-${tabId}`).classList.remove('hidden');
const activeNav = document.getElementById(`nav-${tabId}`);
if (activeNav) {
activeNav.classList.add('bg-sky-50', 'dark:bg-sky-900/40', 'text-sky-600', 'dark:text-sky-400');
}
const titles = {
dashboard: 'SEO Dashboard',
audit: 'Full SEO Technical Audit',
'fix-center': 'AI-Powered Fix Center',
education: 'SEO Knowledge Hub',
reports: 'Audit Reports & Export'
};
document.getElementById('page-title').innerText = titles[tabId] || 'SEO Tool';
}
// Theme Toggle
function toggleTheme() {
state.theme = state.theme === 'light' ? 'dark' : 'light';
document.documentElement.classList.toggle('dark', state.theme === 'dark');
reRenderGauge();
}
function initTheme() {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
state.theme = 'dark';
document.documentElement.classList.add('dark');
}
}
function toggleHtmlInput() {
const container = document.getElementById('html-input-container');
container.classList.toggle('hidden');
}
// Preset Benchmark Loader
function loadPresetSite(presetKey) {
if (!presetKey || !benchmarkPresets[presetKey]) return;
const preset = benchmarkPresets[presetKey];
document.getElementById('target-url').value = preset.url;
document.getElementById('pasted-html').value = preset.html.trim();
document.getElementById('html-input-container').classList.remove('hidden');
runAuditEngine(preset.url, preset.html);
}
// Handle Form Submission
async function handleAuditSubmit(e) {
e.preventDefault();
const url = document.getElementById('target-url').value.trim();
const pastedHtml = document.getElementById('pasted-html').value.trim();
if (!url) return;
runAuditEngine(url, pastedHtml);
}
// MAIN AUDIT EXECUTION ENGINE
async function runAuditEngine(targetUrl, directHtml = '') {
// MAIN AUDIT EXECUTION ENGINE (100% Client-side with Fallback Scrapers)
async function runAuditEngine(targetUrl, directHtml = '') {
showLoading(true);
state.fixedIssues.clear();
let rawHtml = directHtml;
// Attempt live fetch if direct HTML isn't pasted
if (!rawHtml) {
try {
updateLoadingStep('Fetching target website DOM via public gateway...');
const proxyUrl = `https://api.allorigins.win/get?url=${encodeURIComponent(targetUrl)}`;
const response = await fetch(proxyUrl);
if (response.ok) {
const data = await response.json();
rawHtml = data.contents;
}
} catch (err) {
console.warn('Proxy fetch failed, falling back to simulated document parser:', err);
}
}
updateLoadingStep('Analyzing 25+ Technical & On-Page SEO Checks...');
await new Promise(r => setTimeout(r, 600));
// Parse HTML DOM
const parser = new DOMParser();
const doc = rawHtml ? parser.parseFromString(rawHtml, 'text/html') : document;
// Execute Audit Suite Rules
const auditResults = performChecks(targetUrl, doc, rawHtml);
state.auditData = auditResults;
// Save to localStorage
saveAuditToHistory(targetUrl, auditResults.scores.overall);
// Render Views
renderDashboard(auditResults);
renderAuditModule(auditResults);
renderFixCenter(auditResults);
renderReport(targetUrl, auditResults);
showLoading(false);
}
function updateLoadingStep(text) {
document.getElementById('loading-step').innerText = text;
}
function showLoading(isLoading) {
document.getElementById('loading-state').classList.toggle('hidden', !isLoading);
document.getElementById('analyze-btn').disabled = isLoading;
document.getElementById('btn-text').innerText = isLoading ? 'Analyzing...' : 'Analyze Website';
}
// 25+ TECHNICAL SEO AUDIT CHECKS PARSER
function performChecks(url, doc, rawHtml) {
const checks = [];
// 1. Title Tag Check
const titleEl = doc.querySelector('title');
const titleText = titleEl ? titleEl.innerText.trim() : '';
if (!titleText) {
checks.push({
id: 'title-missing',
category: 'On-Page SEO',
name: 'Title Tag Presence',
severity: 'critical',
status: 'failed',
description: 'The page is missing an HTML 
`
});
} else {
checks.push({
id: 'img-alt-ok',
category: 'Image SEO',
name: 'Image Alt Attribute Coverage',
severity: 'passed',
status: 'passed',
description: `All ${images.length} images contain valid alt tags.`
});
}
// 6. HTTPS Security Check
if (!url.startsWith('https://')) {
checks.push({
id: 'https-check',
category: 'Technical SEO',
name: 'HTTPS / SSL Encryption',
severity: 'critical',
status: 'failed',
description: 'Website is served over unencrypted HTTP protocol.',
url: url,
why: 'HTTPS is a confirmed Google ranking signal and essential web security standard.',
fix: 'Install an SSL certificate and redirect all HTTP traffic to HTTPS.',
code: `// Apache .htaccess redirect rule\nRewriteEngine On\nRewriteCond %{HTTPS} off\nRewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]`
});
} else {
checks.push({
id: 'https-ok',
category: 'Technical SEO',
name: 'HTTPS / SSL Encryption',
severity: 'passed',
status: 'passed',
description: 'Page is securely delivered over HTTPS.'
});
}
// 7. Mobile Viewport Meta Tag
const viewport = doc.querySelector('meta[name="viewport"]');
if (!viewport) {
checks.push({
id: 'viewport-missing',
category: 'Mobile SEO',
name: 'Mobile Responsive Viewport',
severity: 'critical',
status: 'failed',
description: 'Missing responsive viewport meta tag.',
url: url,
why: 'Without a viewport tag, mobile browsers render desktop width, damaging mobile user experience.',
fix: 'Add standard mobile viewport meta tag.',
code: ``
});
} else {
checks.push({
id: 'viewport-ok',
category: 'Mobile SEO',
name: 'Mobile Responsive Viewport',
severity: 'passed',
status: 'passed',
description: 'Mobile viewport tag properly configured.'
});
}
// 8. Open Graph & Social Cards
const ogTitle = doc.querySelector('meta[property="og:title"]');
if (!ogTitle) {
checks.push({
id: 'og-missing',
category: 'On-Page SEO',
name: 'Open Graph Social Tags',
severity: 'warning',
status: 'warning',
description: 'Missing Open Graph (og:title) markup.',
url: url,
why: 'Open Graph tags control visual preview cards when shared on social platforms.',
fix: 'Add Open Graph meta tags to header.',
code: `\n\n`
});
} else {
checks.push({
id: 'og-ok',
category: 'On-Page SEO',
name: 'Open Graph Tags',
severity: 'passed',
status: 'passed',
description: 'Open Graph metadata is present.'
});
}
// 9. Schema Markup Check
const schemaJson = doc.querySelector('script[type="application/ld+json"]');
if (!schemaJson) {
checks.push({
id: 'schema-missing',
category: 'Technical SEO',
name: 'Structured Data / Schema Markup',
severity: 'warning',
status: 'warning',
description: 'No JSON-LD structured data schema detected.',
url: url,
why: 'Structured data enables Google Rich Snippets (star ratings, price, FAQs).',
fix: 'Add JSON-LD schema markup block to document.',
code: `