Configuration

Everything lives under Microscope → Settings, which is admin-only. Nothing here needs setting before the first scan.

Scanning

SettingDefaultWhat it does
Scan templates
scanTemplates
trueWhether to read the site’s Twig templates looking for queries inside loops, unbounded queries and missing eager loading. See Template analysis.
Extra template directories
templateDirectories
emptyAdditional 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 limit
maxTemplates
1500A 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 probes
allowShellProbes
trueLets 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 checks
disabledChecks
emptyHandles 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

SettingDefaultWhat it does
Run scans on a schedule
scheduleEnabled
falseMaster switch for scheduled scans.
Frequency
scheduleFrequency
weeklydaily, weekly or monthly.
Hour
scheduleHour
30–23, in the system timezone.
Day of week
scheduleWeekday
1 (Monday)Used for weekly scans. 1–7, ISO-8601.
Day of month
scheduleDayOfMonth
1Used for monthly scans. Capped at 28 so it lands in every month.
How scans get started
scheduleTrigger
croncron or web. See Scheduled scans.

Notifications

SettingDefaultWhat it does
Email scan results
notifyEnabled
falseMaster switch for notification emails.
Recipients
notifyRecipients
emptyOne address per line. Environment variables such as $SCAN_REPORT_EMAIL are supported and resolved at send time.
When to send
notifyOn
newnew (only when something new or worse appears), problems (any scan with problems) or always.
Attach the PDF report
attachPdf
trueAttaches the rendered PDF, when dompdf is available.

Housekeeping

SettingDefaultWhat it does
Scans to keep
retainScans
50Older scans are deleted after each new one. Keeping some history is what makes the “new since last scan” comparison work.
Log level
logLevel
warningerror, 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.