Configuration
Everything lives under Microscope → Settings, which is admin-only. Nothing here needs setting before the first scan.
Scanning
| Setting | Default | What it does |
|---|---|---|
Scan templatesscanTemplates | true | Whether to read the site’s Twig templates looking for queries inside loops, unbounded queries and missing eager loading. See Template analysis. |
Extra template directoriestemplateDirectories | empty | Additional directories to read, one per line. Relative paths are resolved from the Craft base path; the site’s own templates/ directory is always included. |
Template limitmaxTemplates | 1500 | A ceiling on how many templates one scan will read, so a large vendored template library can’t turn a scan into a filesystem crawl. |
Allow shell probesallowShellProbes | true | Lets the server checks run short read-only commands (nproc, free, nginx -V) to report CPU, memory and web server details. With this off, those checks skip rather than guess — many hosts disable it anyway, and Microscope handles that gracefully either way. |
Disabled checksdisabledChecks | empty | Handles of checks that should never run. Managed from Microscope → Checks rather than typed by hand. |
Checks are opted out of rather than into. Because the stored list is of disabled handles and starts empty, a check added in a later release starts working on upgrade instead of sitting silently disabled because it wasn’t in a list written before it existed.
Scheduling
| Setting | Default | What it does |
|---|---|---|
Run scans on a schedulescheduleEnabled | false | Master switch for scheduled scans. |
FrequencyscheduleFrequency | weekly | daily, weekly or monthly. |
HourscheduleHour | 3 | 0–23, in the system timezone. |
Day of weekscheduleWeekday | 1 (Monday) | Used for weekly scans. 1–7, ISO-8601. |
Day of monthscheduleDayOfMonth | 1 | Used for monthly scans. Capped at 28 so it lands in every month. |
How scans get startedscheduleTrigger | cron | cron or web. See Scheduled scans. |
Notifications
| Setting | Default | What it does |
|---|---|---|
Email scan resultsnotifyEnabled | false | Master switch for notification emails. |
RecipientsnotifyRecipients | empty | One address per line. Environment variables such as $SCAN_REPORT_EMAIL are supported and resolved at send time. |
When to sendnotifyOn | new | new (only when something new or worse appears), problems (any scan with problems) or always. |
Attach the PDF reportattachPdf | true | Attaches the rendered PDF, when dompdf is available. |
Housekeeping
| Setting | Default | What it does |
|---|---|---|
Scans to keepretainScans | 50 | Older scans are deleted after each new one. Keeping some history is what makes the “new since last scan” comparison work. |
Log levellogLevel | warning | error, warning, info or debug. Microscope writes to storage/logs/microscope.log. |
Setting these from a config file
Microscope uses a standard Craft settings model, so a config/microscope.php file overrides the control panel values in the usual way — and, as with any Craft plugin, the settings screen then shows those fields as read-only:
true,
'scheduleFrequency' => 'weekly',
'scheduleHour' => 3,
'notifyEnabled' => true,
'notifyRecipients' => ['$SCAN_REPORT_EMAIL'],
'notifyOn' => 'new',
'retainScans' => 100,
'disabledChecks' => ['queryCache'],
];
This is the right approach when the schedule should differ per environment — scanning production weekly and never scanning staging, for instance.
A note on validation
No setting is marked required. A required rule on any one of them would make saving the settings fail wholesale, so on a fresh install no setting could be saved until that one was filled in. Values are validated for correctness only when they are present.