<?php
/**
 * Plugin Name: AIEO — Action Scheduler short retention (stalled-site cleanup)
 * Description: Shortens Action Scheduler's completed/canceled retention to 3 days
 *   so the daily cleanup purges the queue aggressively instead of the 30-day
 *   default. Paired with the /etc/cron.d/aieo-as-runner 5-minute runner on
 *   low-traffic sites whose front-end async runner stalls (the mu-plugin
 *   0-aieo-action-scheduler-core.php + aieo-as-ajax-query-protection.php disable
 *   the async runner on admin-ajax, and DISABLE_WP_CRON=1, so with no traffic the
 *   queue never drains and completed rows never age out). NOT in the bundled
 *   ship-list — deployed ONLY to the stalled sites the runner cron covers.
 *
 *   The runner cron's `wp action-scheduler run` fires Action Scheduler's own
 *   ActionScheduler_QueueCleaner, which deletes complete + canceled actions older
 *   than this retention window (failed are deliberately kept by AS for
 *   inspection). See memory automatewoo_delete_old_logs_runaway.
 *
 * Author: AIEO
 * Version: 1.0
 */

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

add_filter(
	'action_scheduler_retention_period',
	static function () {
		return 3 * DAY_IN_SECONDS;
	},
	20
);
