Audits & reporting

The review panel tells a writer about the entry in front of them. An audit tells an editor about the whole site.

Pro only.

Running an audit

Go to RedPen → Audits → New audit. Choose the sites and sections to cover, optionally pin a single profile, and start it. The run is queued, so a large site does not tie up a web request; progress appears in Craft’s queue indicator as usual.

What an audit stores:

  • redpen_audits — one row per run: totals by severity, the aggregate health score, and how long it took.
  • redpen_issues — every finding, so the report screens can filter and group them after the fact.

Reading the report

An audit’s report has three parts:

  • The summary — entries checked, issues by severity, and the aggregate health score.
  • The per-rule breakdown — which rules fired and how often. This is the most useful screen on a first run: it usually reveals one or two rules producing most of the volume, which is a signal to tune the rule rather than to fix a thousand entries.
  • The worst offenders — entries ranked by score, each linking to its edit screen. Because the score scales on word count, a short entry with three problems can outrank a long one with ten, which is the right ordering for deciding where to start.

The findings table underneath is filterable by rule, severity, section and site.

The dashboard widget

Add the Content health widget to the Craft dashboard for the current score and its trend across recent audits. It is the cheap way to notice that standards have slipped in a section nobody is watching.

Audits from the command line

The same run is available from the CLI, which is what you want on a large site or on a schedule:

php craft redpen/check --store

--store keeps the run as an audit so it shows up in the control panel alongside the ones started there. Without it the command reports and exits without writing anything. See Console & CI.

A note on ordering

Audit lists are ordered by creation time with the row id as a tiebreak. Two audits started in the same second would otherwise sort arbitrarily, which makes “the latest audit” a coin flip — and the widget’s trend line meaningless.