WP Scheduled Redirection self-updates
WordPress plugin that redirects URLs based on Google Calendar events. Perfect for QR codes that dynamically redirect to different content during scheduled events.
by Xadja · github.com/sawdustandcoffee/wp-scheduled-redirection · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/sawdustandcoffee/wp-scheduled-redirection/archive/refs/heads/main.zipShips its own WordPress updater (Plugin Update Checker), so new versions show up under Dashboard → Updates.
A WordPress plugin that redirects URLs based on Google Calendar events. Perfect for businesses that want to use static QR codes that dynamically redirect to different content based on scheduled events.
Description
WP Scheduled Redirection allows you to create redirect rules that link a source URL (perfect for QR codes) to a default destination, with the ability to override that destination during scheduled Google Calendar events.
Use Case Example
A restaurant prints QR codes on their tables that link to /menu. During the week, visitors are redirected to their regular menu. But on Thursday nights during karaoke events (scheduled in Google Calendar), the same QR code automatically redirects to a karaoke signup page.
Features
- Google Calendar Integration: Connect your Google Calendar via OAuth 2.0
- Flexible Redirect Rules: Create multiple redirect rules with unique source URLs
- Codeword System: Embed redirect URLs in calendar events using customizable codeword formats
- Real-time Updates: Webhooks and polling ensure redirects update promptly
- Conflict Detection: Warns about overlapping events that might cause redirect conflicts
- Comprehensive Logging: Track all redirects, syncs, and errors
- WordPress Native UI: Seamlessly integrates with WordPress admin
Requirements
- WordPress 5.0 or higher
- PHP 7.4 or higher
- MySQL 5.7+ (via WordPress)
- HTTPS enabled (required for Google OAuth)
- Google Cloud Console project with Calendar API enabled
Installation
- Download the plugin files
- Upload to
/wp-content/plugins/wp-scheduled-redirection/ - Activate the plugin through the 'Plugins' menu in WordPress
- Navigate to 'Scheduled Redirects' in the admin menu to configure
Configuration
Google Cloud Setup
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Calendar API
- Configure the OAuth consent screen
- Create OAuth 2.0 credentials (Web application type)
- Add your authorized redirect URI:
https://yourdomain.com/wp-admin/admin-ajax.php?action=wsr_oauth_callback
Plugin Setup
- Go to Scheduled Redirects → Settings
- Enter your Google API Client ID and Client Secret
- Configure polling frequency (for backup sync)
- Set log retention period
Creating a Redirect Rule
- Go to Scheduled Redirects → Redirect Rules
- Click Add New Rule
- Enter the source URL path (e.g.,
/qr-menu) - Enter the default destination URL
- Connect your Google account
- Select the calendar to monitor
- Choose your preferred codeword format
- Save the rule
Adding Calendar Events with Redirects
Create events in your Google Calendar with a codeword in the description:
Format: ##url##
Karaoke Night
##https://example.com/karaoke-signup##
Format: link:url
Happy Hour Special
link:https://example.com/happy-hour
Format: REDIRECT:url
Live Music Event
REDIRECT:https://example.com/live-music
When the event is active, visitors to your source URL will be redirected to the codeword URL. When the event ends, they'll be redirected to your default destination.
How It Works
- Sync: The plugin periodically syncs with your Google Calendar (via webhooks and polling)
- Parse: Events with codewords are extracted and stored locally
- Match: When a visitor hits a source URL, the plugin checks for active events
- Redirect: A 307 (temporary) redirect sends visitors to the appropriate destination
Codeword Formats
| Format | Example |
|---|---|
##url## |
##https://example.com/page## |
link:url |
link:https://example.com/page |
REDIRECT:url |
REDIRECT:https://example.com/page |
All formats are case-insensitive.
Troubleshooting
Redirects not working
- Check that the rule is enabled
- Verify the source URL path matches exactly
- Ensure events are synced (check Logs tab)
- Confirm events have valid codewords
Calendar not syncing
- Check Google account connection status
- Verify API credentials are correct
- Look for errors in the Logs tab
- Try manual sync
Conflicts detected
- Overlapping events with codewords cause conflicts
- Use separate calendars for overlapping redirect needs
- Check the conflict warnings in the admin
Security
- OAuth tokens are encrypted in the database
- All admin actions require
manage_optionscapability - Forms use WordPress nonce verification
- Sensitive operations require confirmation
Changelog
1.0.9
- Added version badge to Support page header for easy reference
1.0.8
- Added Xadja company logo to the Support page About section
1.0.7
- Added in-plugin Documentation and Support pages
- Docs and Support links in footer now open within plugin admin
- Updated plugin author to Xadja (xadja.com)
1.0.6
- Super admins can now update directly from subsite plugins page (no need to go to Network Admin)
1.0.5
- Added "last synced" timestamp to admin footer (e.g., "synced 5 mins ago")
1.0.4
- Improved multisite compatibility: shows update notice on site plugins page with manual download link
- Added documentation for multisite network activation requirement
1.0.3
- Added live status summary to admin footer (rule count, enabled count, active events indicator)
1.0.2
- Fixed plugin update mechanism to use GitHub Releases for proper folder naming
1.0.1
- Added version number and helpful links to admin page footer
- Integrated Plugin Update Checker for GitHub-based updates
1.0.0
- Initial release
- Google Calendar OAuth integration
- Redirect rules management
- Webhook and polling sync
- Conflict detection
- Comprehensive logging
License
GPL v2 or later
Support
For support, please open an issue on the plugin repository.