Appearance
PageCleaner (Developer Guide)
The PageCleaner plugin handles the cleanup of local Waravel pages.
Architecture & Core Files
PageCleanerPlugin.php: The main plugin class. Registers routes, views, settings, and schedules the auto-prune command.Controllers/DashboardController.php: Handles dashboard view rendering, local scans, and page pruning execution.Console/Commands/AutoPruneLocalCommand.php: The scheduled command that executes the background pruning.
Database & Settings
The plugin stores its configuration in the core waravel_plugin_settings table. Key settings include:
local_auto_prune_enabledlocal_auto_prune_frequencylocal_auto_prune_min_age_dayslocal_auto_prune_action
Scanning Logic (DashboardController::scanLocal)
The local scanner builds an Eloquent query on the Waravel\Models\Page model:
- Filters: Applies status, date ranges, and age restrictions.
- Target Rules: Uses
LIKEor=to enforce URL inclusion criteria. - Protect Rules: Uses
NOT LIKEor!=to enforce URL exclusion criteria. - Ancestor Protection: By default, it builds a tree of all published pages and removes parents of healthy pages from the deletion candidates. This is bypassed if
restructure_urlsis enabled.
Pruning Execution (DashboardController::purge)
When executing a purge:
- If URL Restructuring is enabled, it delegates to
UrlRestructuringService(from PRO/RedirectManager) to resolve and write 301 redirects before deletion. - If
PageCleanerProis active, it delegates toPruningServicefor advanced cascading deletions. - Otherwise, it falls back to basic
delete()orforceDelete()on the Eloquent model.
Hooks & Commands
- Cron Schedule: Registers
waravel:page-cleaner:auto-prune-localinPageCleanerPlugin::scheduleTasks().