Configuration
Homer can be configured via the Control Panel under Settings → Plugins → Homer, or by creating a config/homer.php file.
Config File
Create config/homer.php to override settings per environment:
<?php
return [
'mode' => 'warn',
'protectElementTypes' => ['entry', 'asset', 'category'],
'highRiskUsageThreshold' => 5,
'typedConfirmationThreshold' => 20,
'adminBypass' => true,
'deletionSafety' => true,
'relationSafety' => true,
'assetSafety' => true,
'auditLog' => true,
'strictEnvironments' => ['production'],
'auditLogRetentionDays' => 90,
];
Multi-Environment Config
Use Craft’s multi-environment config pattern to set different modes per environment:
<?php
return [
'*' => [
'mode' => 'warn',
'deletionSafety' => true,
'auditLog' => true,
],
'production' => [
'mode' => 'block',
],
'staging' => [
'mode' => 'confirm',
],
];
Settings Reference
| Setting | Default | Description |
|---|---|---|
mode | warn | Safety mode: warn, confirm, or block |
protectElementTypes | ['entry', 'asset', 'category'] | Element types Homer will guard |
highRiskUsageThreshold | 5 | Reference count to trigger “high risk” classification |
typedConfirmationThreshold | 20 | Reference count to require typed “DELETE” confirmation |
adminBypass | true | Allow administrators to bypass all checks |
deletionSafety | true | Enable deletion safety guards |
relationSafety | true | Enable relation safety checks |
assetSafety | true | Enable asset-specific safety (rich text scanning) |
auditLog | true | Enable audit logging of risky actions |
strictEnvironments | ['production'] | Environments that force block mode regardless of mode setting |
auditLogRetentionDays | 90 | Days to retain audit log entries before automatic cleanup |
Safety Modes
Homer supports three safety modes:
- Warn — Shows a warning modal with impact details, but allows the action to proceed.
- Confirm — Requires the user to acknowledge the impact before the action can proceed.
- Block — Prevents the action entirely. Only users with the
homer:bypassBlockspermission can override.
Risk Classification
Homer classifies every deletion into one of four risk levels based on reference count:
- Safe — No references. Delete freely.
- Low Risk — Few references. Warning shown.
- High Risk — References meet the
highRiskUsageThreshold. Confirmation required. - Critical — References meet the
typedConfirmationThreshold. Must type “DELETE” to proceed.