Standard files plugin for sitespeed.io.
plugin-standard-files is a plugin for sitespeed.io that checks for the
presence and validity of common "standard files" on a site, using a real
browser to fetch them. It is the sitespeed.io port of the standard_files
test previously implemented in Python in
webperf_core.
It checks:
- robots.txt – exists and contains directives (not an HTML 404 page).
- sitemap(s) – declared in robots.txt, reachable, HTTPS-only, same-domain,
free of duplicates, of known content types, not empty and not over 50 000
items.
sitemapindexfiles are followed. - RSS/Atom/JSON feed – discovered from
<link>elements on the page. - security.txt –
/.well-known/security.txt(falling back to/security.txt) exists and declaresContact:andExpires:.
The rule ids, severities and categories are kept identical to the original Python test so that scores stay continuous.
Standard files are origin-level, so the plugin runs once per site (group):
- On the first
urlfor a group it enqueuesrobots.txtand/.well-known/security.txt. - When
robots.txtcomes back it discoversSitemap:entries and enqueues them;sitemapindexfiles enqueue their children. - If
/.well-known/security.txtis missing/wrong it enqueues/security.txt. - The page itself is used for the RSS/Atom feed check.
- At
sitespeedio.summarizethe findings are finalized and published once per group.
When plugin-webperf-core
is present, results are sent as webPerfCoreSummary and aggregated into the
combined Webperf Core tab; otherwise they render in their own "Standard files"
tab.
npm install plugin-standard-filessitespeed.io https://www.example.com --plugins.add plugin-standard-filesWith the aggregator:
sitespeed.io --plugins.add plugin-webperf-core --plugins.add plugin-standard-files https://www.example.com{
"plugins": {
"plugin-standard-files": {
"enabled": true
}
}
}npm install
npm testThe tests feed pre-built HAR objects through the analyzer, so they need no network.
npm run start-server # serves test/data/ on http://localhost:3000
sitespeed.io -n 1 --plugins.add ./lib/index.js --browsertime.chrome.includeResponseBodies all http://localhost:3000/npm run lint
npm run lint:fixMIT. See LICENSE.