Configuration
Settings live in the control panel, or in config/nuke.php if you would rather they were in version control. Nothing is required — Nuke works on a fresh install without touching any of it.
Guardrails
| Setting | Default | What it does |
|---|---|---|
requireConfirmation | true | Whether a strike must be armed by typing a phrase. |
confirmationPhrase | '{scope}' | What has to be typed. {scope} becomes the source’s handle. An empty phrase is rejected while confirmation is on — it would arm every strike on a stray Enter. |
backupBeforeStrike | true | The default for new strikes. A failed backup stops the run whatever this is set to. |
hardDeleteByDefault | false | Whether the permanent-delete switch starts on. Worth leaving off. |
deleteRelations | false | The default for the relations switch. Only affects non-permanent deletes; a permanent one always clears them. |
runGcAfterStrike | true | Whether Craft’s garbage collector runs when a strike finishes. |
maxElementsPerStrike | 10000 | The ceiling. 0 removes it. |
batchSize | 100 | Elements per transaction. Lower on a site with heavy afterDelete handlers. |
protectedScopes | [] | Handles that may never be targeted. Matched case-insensitively. |
allowUserStrikes | false | Whether users may be deleted at all. |
allowConsoleStrikes | true | Set to false to make the control panel the only route. |
Sweepers
sweeperConfig is a map of sweeper handle to that sweeper’s settings, and it holds overrides only. Anything absent falls back to the task’s own defaults, which is what lets a task added in a later release arrive switched on with sensible settings.
'sweeperConfig' => [
'backups' => ['enabled' => true, 'olderThanDays' => 90, 'keepNewest' => 10],
'unusedAssets' => ['enabled' => true, 'mode' => 'trash', 'olderThanDays' => 365],
'emptyFolders' => ['enabled' => false],
],
Every key is documented in the sweeper reference.
Scheduling and notifications
Pro only; the settings can be filled in on Lite and start working the moment the edition changes.
| Setting | Default | What it does |
|---|---|---|
scheduleEnabled | false | Whether sweeps run on a schedule. |
scheduleFrequency | 'weekly' | daily, weekly or monthly. |
scheduleHour | 3 | 0–23, in the system timezone. |
scheduleWeekday | 7 | 1 (Monday) to 7 (Sunday), ISO-8601. |
scheduleDayOfMonth | 1 | 1–28. Capped deliberately. |
scheduleTrigger | 'cron' | cron or web. See scheduling. |
notifyEnabled | false | Whether to email reports. |
notifyRecipients | [] | Addresses, one per line. Environment variables are supported and are not validated as email addresses. |
notifyOn | 'changes' | always, changes or problems. |
notifyOnStrike | true | Whether a strike emails too, not just a sweep. |
Housekeeping
| Setting | Default | What it does |
|---|---|---|
retainRuns | 100 | How many ledger rows to keep. |
logLevel | 'info' | Minimum level for storage/logs/nuke.log. Higher than the read-only plugins in this family, because a successful deletion is the thing worth recording. |
A config file
<?php
// config/nuke.php
return [
'confirmationPhrase' => '{scope}',
'maxElementsPerStrike' => 2500,
'protectedScopes' => ['homepage', 'globalSettings', 'legal'],
'allowConsoleStrikes' => false,
'retainRuns' => 500,
];
Settings in a config file are locked in the control panel, which is a reasonable way to stop the guardrails being relaxed on a whim.