# 404-solution/trunk/includes/admin/actions/RunMaintenanceHandler.php

404 Solution, version trunk. 30 lines.

- Page: https://pluginprobe.com/plugins/404-solution/trunk/code/includes/admin/actions/RunMaintenanceHandler.php
- Raw: https://pluginprobe.com/plugins/404-solution/trunk/raw/includes/admin/actions/RunMaintenanceHandler.php
- Modified: 2026-06-23T05:55:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/404-solution/trunk/code/includes/admin/actions/RunMaintenanceHandler.php#L10-L20`.

```php
<?php

if (!defined('ABSPATH')) {
    exit;
}

/**
 * Handles action 'runMaintenance': triggers the redirects retention cron
 * (delete redirects older than the configured age) on demand from the admin UI.
 */
class ABJ_404_Solution_RunMaintenanceHandler implements ABJ_404_Solution_AdminActionHandlerInterface {

    public function nonceAction(): string {
        return 'abj404_runMaintenance';
    }

    public function nonceArg(): string {
        return '_wpnonce';
    }

    public function useCheckAdminReferer(): bool {
        return true;
    }

    public function handle(string $action, string &$sub): string {
        $message = abj_service('redirects_retention_service')->deleteOldRedirectsCron();
        return is_string($message) ? $message : '';
    }
}

```
