xwp / scheduled-redirects
Schedule activation/deactivation of Redirection Plugin redirects with WPVIP cache purging
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:wordpress-plugin
pkg:composer/xwp/scheduled-redirects
Requires
- php: >=8.4
- woocommerce/action-scheduler: ^3.8
Requires (Dev)
- automattic/vipwpcs: ^3.0
- dealerdirect/phpcodesniffer-composer-installer: ^1.1
- php-stubs/wordpress-stubs: ^6.8
- phpcompatibility/php-compatibility: ^9.3
- phpcompatibility/phpcompatibility-wp: ^2.1
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^9.6
- slevomat/coding-standard: ^8.0
- szepeviktor/phpstan-wordpress: ^2.0
- wp-phpunit/wp-phpunit: ^6.9
- yoast/phpunit-polyfills: ^2.0
README
A WordPress plugin that adds scheduled activation/deactivation functionality to the Redirection Plugin, with automatic WPVIP cache purging.
Developed by XWP
Requirements
- WordPress 6.5+
- PHP 8.4+
- Redirection Plugin 5.6+
- Action Scheduler 3.8+ (bundled via Composer)
Installation
Composer (Recommended)
composer require xwp/scheduled-redirects
Manual
- Run
composer install --no-dev - Upload to
/wp-content/plugins/ - Activate Redirection plugin
- Activate Scheduled Redirects
Usage
Navigate to Tools > Scheduled Redirects to:
- Set scheduled start/end dates for redirects
- Create new redirects with schedules
- View status: Active, Inactive, Scheduled, On Schedule, Expired
Key Features
- Scheduled Activation - Set a future date/time for redirects to automatically enable
- Scheduled Deactivation - Set an end date/time for redirects to automatically disable
- Automatic Cache Purging - WPVIP edge cache is automatically purged when redirect status changes
- Reliable Scheduling - Uses Action Scheduler for dependable background processing
- Simple Interface - Clean admin UI under Tools menu with search and filtering
- Create New Redirects - Add new redirects with schedules directly from the plugin
- Status Indicators - Visual badges showing Active, Inactive, Scheduled, On Schedule, and Expired states
Use Cases
- Seasonal Campaigns - Schedule redirects for holiday promotions that automatically start and end
- Product Launches - Set up redirects to go live exactly when a product launches
- Temporary Redirects - Create time-limited redirects that automatically expire
- Content Migrations - Schedule URL changes to coincide with content updates
- A/B Testing - Rotate landing pages on a schedule
How It Works
- The plugin adds scheduling fields to each redirect in the Redirection Plugin
- When you set a start date, the redirect is disabled until that time
- Action Scheduler triggers the activation at the scheduled time
- When the end date arrives, the redirect is automatically disabled
- WPVIP cache is purged automatically to ensure changes take effect immediately
WPVIP Compatibility
This plugin is fully compatible with WordPress VIP environments:
- Automatically purges WPVIP edge cache when redirects change status
- Uses VIP-approved coding standards and practices
Development
Setup
composer install pnpm install --ignore-workspace pnpm start
Testing
pnpm test:php # Run tests composer lint # Check standards composer phpstan # Static analysis composer lint:fix # Auto-fix issues
Local Environment
- Development: http://localhost:8889
- Tests: http://localhost:8890
- Admin:
admin/password
CI/CD
GitHub Actions runs:
- PHPCS (WordPress-VIP-Go)
- PHPStan Level 5
- PHPUnit tests
Hooks
// Actions do_action( 'scheduled_redirects_enabled', $redirect_id, $redirect ); do_action( 'scheduled_redirects_disabled', $redirect_id, $redirect ); do_action( 'scheduled_redirects_cache_purged', $redirect_id, $redirect, $action, $urls_to_purge ); // Filters add_filter( 'scheduled_redirects_per_page', fn( $per_page ) => 50 ); add_filter( 'scheduled_redirects_purge_urls', fn( $urls, $redirect_id, $redirect ) => $urls, 10, 3 );
Privacy
Scheduled Redirects does not collect, store, or transmit any personal data. All schedule data is stored locally in your WordPress database.
Credits
Developed by XWP for WordPress VIP environments.
This plugin integrates with:
- Redirection Plugin by John Godley
- Action Scheduler by Automattic
License
GPL v2 or later