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

SettingDefaultDescription
modewarnSafety mode: warn, confirm, or block
protectElementTypes['entry', 'asset', 'category']Element types Homer will guard
highRiskUsageThreshold5Reference count to trigger “high risk” classification
typedConfirmationThreshold20Reference count to require typed “DELETE” confirmation
adminBypasstrueAllow administrators to bypass all checks
deletionSafetytrueEnable deletion safety guards
relationSafetytrueEnable relation safety checks
assetSafetytrueEnable asset-specific safety (rich text scanning)
auditLogtrueEnable audit logging of risky actions
strictEnvironments['production']Environments that force block mode regardless of mode setting
auditLogRetentionDays90Days 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:bypassBlocks permission 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.