Third-Party Script Performance (third-party-script-perf)
Summary
Analyzes external scripts for blocking behavior, payload size, latency, and category (Playwright).
Classification
- Category:
PERFORMANCE - Plugin id:
third-party-script-perf - Version:
1.0.0 - Target types:
WEBSITE,WEBSHOP - Weight class:
MEDIUM - Risk level: not set on plugin object
- Browser required: Yes (Playwright)
- Tier / group: Tier 2 — Browser (Playwright)
Schedule
- scheduleHints:
{ defaultInterval: '0 */6 * * *', priority: 5 } - Prerequisites: None declared on this plugin.
Configurable inputs
Public keys are derived from inputSchema: z.object({ ... }) (underscore-prefixed keys are runtime-only and omitted here).
| Field | Notes |
|---|---|
timeout |
Default 30000 ms page load timeout. |
slowThresholdMs |
Default 1000 ms — scripts slower than this are flagged. |
largeThresholdKb |
Default 100 KB transfer size per script. |
Runtime / injected config
- None documented beyond standard worker context (
target,config,logger,reportProgress). Underscore-prefixed keys are internal.
Checks that produce findings
These checks run inside this plugin during a single test run. They are not separate tests in the database — each becomes a Finding linked to the Run for third-party-script-perf.
| Check | Typical severity | Why |
|---|---|---|
Render-blocking third-party scripts (renderBlockingStatus === 'blocking') |
INFO if ≤3 scripts; WARNING if >3 | Parser-blocking third-party JS delays first paint and directly worsens LCP/FCP. |
Oversized scripts (transfer size > largeThresholdKb, default 100 KB) |
WARNING | Heavy tag-manager/analytics bundles inflate download time on mobile networks. |
Slow scripts (resource duration > slowThresholdMs, default 1000 ms) |
INFO if ≤5 scripts; WARNING if >5 | Long-running third-party loads block the main thread and delay interactivity. |
| Total third-party script payload > 500 KB | WARNING | Aggregate tag bloat is a common root cause of poor Core Web Vitals on marketing-heavy sites. |
How each check works
- Load page — Playwright
networkidlenavigation (default 30s), then 2s extra wait. - Collect scripts — Reads
PerformanceResourceTimingentries whereinitiatorType === 'script'or URL ends with.js. Excludes same-origin scripts (includingwww.variants). - Categorize — Regex buckets: Tag Manager, Analytics, Ad Pixel, Chat, Heatmap, Consent/CMP, A/B Testing, Social, Video, Font, CDN, Other.
- Apply thresholds — Blocking count severity splits at >3; slow script severity splits at >5; large scripts always WARNING; total size >512 000 bytes triggers aggregate WARNING.
- Score and status — Starts at 100, −5 per blocking script, −8 per large script, −3 per slow script, −15 if total >500 KB (floor 0). Status
warningif any WARNING finding.
Caveats and concerns
- Same-origin excluded — First-party JS is not analyzed; only cross-domain scripts count.
- Transfer size caveats —
transferSizemay be 0 for opaque/cached responses, under-reporting weight. - Blocking API support —
renderBlockingStatusis not available in all browser versions; may under-detect blockers. - Lab snapshot — One load from the worker; ad tags that load conditionally may be missed or over-sampled.
- Triggered by CWV failures — Adaptive orchestrator queues this after failed
core-web-vitalsruns.
Source
packages/test-plugins/src/plugins/third-party-script-perf.ts