sitecheckultra 2.0.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -6
- package/bin/sitecheckultra.js +65 -12
- package/lib/analyzer.js +162 -11
- package/lib/crawl-error.js +171 -0
- package/lib/crawler.js +297 -186
- package/lib/exporter.js +126 -110
- package/lib/page-preview.js +311 -0
- package/lib/scorer.js +50 -17
- package/package.json +7 -7
- package/public/app.js +490 -58
- package/public/index.html +27 -9
- package/public/styles.css +138 -1
- package/server.js +66 -2
package/lib/scorer.js
CHANGED
|
@@ -24,7 +24,7 @@ export const SCORE_CATEGORIES = {
|
|
|
24
24
|
hygiene: 0.15, // Hygiene (15 %)
|
|
25
25
|
speed: 0.15, // Geschwindigkeit (15 %)
|
|
26
26
|
mobile: 0.15, // Mobile Optimierung (15 %)
|
|
27
|
-
wcag: 0.15 // Barrierefreiheit (15 %)
|
|
27
|
+
wcag: 0.15 // WCAG 2.2 Barrierefreiheit (15 %)
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
function clamp(n, min = 0, max = 100) {
|
|
@@ -60,14 +60,14 @@ export function scorePage(page) {
|
|
|
60
60
|
|
|
61
61
|
// Hard failure if page could not be fetched or returned 4xx/5xx
|
|
62
62
|
if (page.error || page.status === 0 || page.status >= 400) {
|
|
63
|
-
const label = page.error || `HTTP ${page.status}
|
|
63
|
+
const label = page.error || (page.status ? `HTTP ${page.status}` : 'Verbindungsfehler');
|
|
64
64
|
const issue = {
|
|
65
65
|
category: 'seo',
|
|
66
66
|
severity: 'critical',
|
|
67
67
|
points: -100,
|
|
68
68
|
code: 'http_error',
|
|
69
|
-
title: `Seite nicht
|
|
70
|
-
reason: `Die URL
|
|
69
|
+
title: `Seite nicht crawlbar (${label})`,
|
|
70
|
+
reason: `Die URL konnte nicht als HTML-Seite geladen werden: ${label}. Suchmaschinen und Nutzer erhalten keinen gültigen Inhalt.`
|
|
71
71
|
};
|
|
72
72
|
return {
|
|
73
73
|
overall: 0,
|
|
@@ -329,44 +329,77 @@ export function scorePage(page) {
|
|
|
329
329
|
pass();
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
/* ==================== 6. WCAG
|
|
333
|
-
// Language
|
|
332
|
+
/* ==================== 6. WCAG 2.2 BARRIEREFREIHEIT (15 %) ==================== */
|
|
333
|
+
// Language of Page (WCAG 2.2 SC 3.1.1)
|
|
334
334
|
if (!page.lang) {
|
|
335
|
-
addIssue('wcag', 'critical', -25, 'missing_lang', 'HTML lang-Attribut fehlt', 'Ohne <html lang="
|
|
335
|
+
addIssue('wcag', 'critical', -25, 'missing_lang', 'HTML lang-Attribut fehlt', 'Ohne <html lang="…"> können Screenreader die Seitensprache nicht korrekt bestimmen (WCAG 2.2 SC 3.1.1 Language of Page).');
|
|
336
336
|
} else {
|
|
337
337
|
pass();
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
//
|
|
340
|
+
// Non-text Content (WCAG 2.2 SC 1.1.1)
|
|
341
341
|
const missingAlt = page.imagesMissingAltCount || 0;
|
|
342
342
|
if (imgCount > 0 && missingAlt > 0) {
|
|
343
343
|
const ratio = missingAlt / imgCount;
|
|
344
344
|
const penalty = ratio > 0.5 ? -30 : ratio > 0.2 ? -18 : -8;
|
|
345
|
-
addIssue('wcag', ratio > 0.5 ? 'critical' : ratio > 0.2 ? 'warning' : 'info', penalty, 'missing_alt', `${missingAlt} von ${imgCount} Bildern ohne Alt-
|
|
345
|
+
addIssue('wcag', ratio > 0.5 ? 'critical' : ratio > 0.2 ? 'warning' : 'info', penalty, 'missing_alt', `${missingAlt} von ${imgCount} Bildern ohne Alt-Attribut`, 'Inhaltliche Bilder brauchen ein alt-Attribut (WCAG 2.2 SC 1.1.1 Non-text Content). Dekorative Bilder mit alt="" sind korrekt und werden nicht beanstandet.');
|
|
346
346
|
} else if (imgCount > 0) {
|
|
347
347
|
pass();
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
//
|
|
350
|
+
// Info and Relationships – empty headings (WCAG 2.2 SC 1.3.1)
|
|
351
351
|
if ((hIssues.emptyCount || 0) > 0) {
|
|
352
|
-
addIssue('wcag', 'warning', -12, 'empty_headings', `${hIssues.emptyCount} leere H-Tags`, 'Leere Überschriften-Tags erscheinen als Sprünge ohne Inhalt in Screenreader-Navigation.');
|
|
352
|
+
addIssue('wcag', 'warning', -12, 'empty_headings', `${hIssues.emptyCount} leere H-Tags`, 'Leere Überschriften-Tags erscheinen als Sprünge ohne Inhalt in der Screenreader-Navigation (WCAG 2.2 SC 1.3.1 Info and Relationships).');
|
|
353
353
|
} else {
|
|
354
354
|
pass();
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
-
//
|
|
357
|
+
// Link Purpose (In Context) – generic link texts (WCAG 2.2 SC 2.4.4)
|
|
358
358
|
const genericLinks = page.genericLinkTextCount || 0;
|
|
359
359
|
if (genericLinks >= 5) {
|
|
360
|
-
addIssue('wcag', 'warning', -14, 'generic_link_text', `${genericLinks} nichtssagende Linktexte`, 'Linktexte wie „hier", „mehr" oder „weiterlesen" verraten Screenreader-Nutzern nicht das Ziel (WCAG 2.4.4).');
|
|
360
|
+
addIssue('wcag', 'warning', -14, 'generic_link_text', `${genericLinks} nichtssagende Linktexte`, 'Linktexte wie „hier", „mehr" oder „weiterlesen" verraten Screenreader-Nutzern nicht das Ziel (WCAG 2.2 SC 2.4.4 Link Purpose).');
|
|
361
361
|
} else if (genericLinks > 0) {
|
|
362
|
-
addIssue('wcag', 'info', -6, 'generic_link_text', `${genericLinks} nichtssagende Linktexte`, 'Prägnante Linktexte (z. B. „Preise vergleichen" statt „hier") verbessern
|
|
362
|
+
addIssue('wcag', 'info', -6, 'generic_link_text', `${genericLinks} nichtssagende Linktexte`, 'Prägnante Linktexte (z. B. „Preise vergleichen" statt „hier") verbessern Orientierung (WCAG 2.2 SC 2.4.4).');
|
|
363
363
|
} else {
|
|
364
364
|
pass();
|
|
365
365
|
}
|
|
366
366
|
|
|
367
|
-
// Heading hierarchy skipped levels
|
|
367
|
+
// Heading hierarchy skipped levels (WCAG 2.2 SC 1.3.1)
|
|
368
368
|
if ((hIssues.skippedLevels?.length || 0) > 0) {
|
|
369
|
-
addIssue('wcag', 'info', -6, 'wcag_h_levels', 'Übersprungene H-Ebenen', 'Lückenlose Überschriften-Hierarchien erleichtern die Navigation per Screenreader (WCAG 1.3.1).');
|
|
369
|
+
addIssue('wcag', 'info', -6, 'wcag_h_levels', 'Übersprungene H-Ebenen', 'Lückenlose Überschriften-Hierarchien erleichtern die Navigation per Screenreader (WCAG 2.2 SC 1.3.1).');
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// Empty accessible name on links (WCAG 2.2 SC 2.4.4 / 4.1.2)
|
|
373
|
+
const emptyLinks = page.emptyAccessibleLinkCount || 0;
|
|
374
|
+
if (emptyLinks >= 3) {
|
|
375
|
+
addIssue('wcag', 'warning', -12, 'empty_link_name', `${emptyLinks} Links ohne zugänglichen Namen`, 'Links ohne Text, aria-label oder Bild-Alt haben keinen erkennbaren Zweck (WCAG 2.2 SC 2.4.4 / 4.1.2 Name, Role, Value).');
|
|
376
|
+
} else if (emptyLinks > 0) {
|
|
377
|
+
addIssue('wcag', 'info', -5, 'empty_link_name', `${emptyLinks} Links ohne zugänglichen Namen`, 'Jeder Link braucht einen zugänglichen Namen (Text, aria-label oder Bild-Alt) – WCAG 2.2 SC 2.4.4 / 4.1.2.');
|
|
378
|
+
} else {
|
|
379
|
+
pass();
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// iframe / frame without accessible name (WCAG 2.2 SC 4.1.2)
|
|
383
|
+
const iframeNoTitle = page.iframeMissingTitleCount || 0;
|
|
384
|
+
if (iframeNoTitle > 0) {
|
|
385
|
+
addIssue('wcag', 'warning', -10, 'iframe_missing_title', `${iframeNoTitle} iframe(s) ohne title`, 'Eingebettete Frames brauchen ein title- oder aria-label-Attribut, damit Screenreader den Zweck nennen können (WCAG 2.2 SC 4.1.2).');
|
|
386
|
+
} else {
|
|
387
|
+
pass();
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// Positive tabindex risks unpredictable focus order (WCAG 2.2 SC 2.4.3)
|
|
391
|
+
const posTab = page.positiveTabindexCount || 0;
|
|
392
|
+
if (posTab > 0) {
|
|
393
|
+
addIssue('wcag', 'info', -5, 'positive_tabindex', `${posTab}× tabindex > 0`, 'Positive tabindex-Werte können die natürliche Tastatur-Reihenfolge stören (WCAG 2.2 SC 2.4.3 Focus Order). Bevorzugt tabindex="0" oder die DOM-Reihenfolge nutzen.');
|
|
394
|
+
} else {
|
|
395
|
+
pass();
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// Main landmark supports structure / bypass blocks (WCAG 2.2 SC 1.3.1 / 2.4.1)
|
|
399
|
+
if (!page.hasMainLandmark) {
|
|
400
|
+
addIssue('wcag', 'info', -5, 'missing_main', 'Kein main-Landmark', 'Ein <main>-Bereich (oder role="main") markiert den Hauptinhalt und erleichtert Sprungnavigation (WCAG 2.2 SC 1.3.1 / 2.4.1 Bypass Blocks).');
|
|
401
|
+
} else {
|
|
402
|
+
pass();
|
|
370
403
|
}
|
|
371
404
|
|
|
372
405
|
const categories = {
|
|
@@ -394,7 +427,7 @@ export function scorePage(page) {
|
|
|
394
427
|
const warningCount = t.issues.filter((i) => i.severity === 'warning').length;
|
|
395
428
|
|
|
396
429
|
const summary = t.issues.length === 0
|
|
397
|
-
? 'Alle geprüften SEO-, AEO-, Hygiene-, Speed-, Mobile- und WCAG-Kriterien erfüllt.'
|
|
430
|
+
? 'Alle geprüften SEO-, AEO-, Hygiene-, Speed-, Mobile- und WCAG 2.2-Kriterien erfüllt.'
|
|
398
431
|
: t.issues.slice(0, 3).map((i) => i.title).join(' · ') + (t.issues.length > 3 ? ` (+${t.issues.length - 3} weitere)` : '');
|
|
399
432
|
|
|
400
433
|
return {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sitecheckultra",
|
|
3
|
-
"version": "2.0
|
|
4
|
-
"description": "Site Check Ultra – Website Audit Tool (SEO, AEO, Speed, Mobile, WCAG, H-Baum, Redirects, Schema, Tracking, Link-Check)",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Site Check Ultra – Website Audit Tool (SEO, AEO, Speed, Mobile, WCAG 2.2, H-Baum, Redirects, Schema, Tracking, Link-Check)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "server.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"sitecheckultra": "
|
|
9
|
-
"scu": "
|
|
8
|
+
"sitecheckultra": "bin/sitecheckultra.js",
|
|
9
|
+
"scu": "bin/sitecheckultra.js"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
12
|
"start": "node server.js"
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
33
|
-
"url": "https://github.com/
|
|
33
|
+
"url": "git+https://github.com/iamthamanic/sitecheckultra.git"
|
|
34
34
|
},
|
|
35
35
|
"bugs": {
|
|
36
|
-
"url": "https://github.com/
|
|
36
|
+
"url": "https://github.com/iamthamanic/sitecheckultra/issues"
|
|
37
37
|
},
|
|
38
|
-
"homepage": "https://github.com/
|
|
38
|
+
"homepage": "https://github.com/iamthamanic/sitecheckultra#readme",
|
|
39
39
|
"files": [
|
|
40
40
|
"bin/",
|
|
41
41
|
"lib/",
|