Flex Content Scheduler
Schedule post expiry and visibility changes with flexible date/time rules.
by Anisur Rahman · github.com/anisur2805/flex-content-scheduler · website
★ 0stars
0forks
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/anisur2805/flex-content-scheduler/archive/refs/heads/main.zipReadme
Flex Content Scheduler
Schedule post expiry with flexible rules: unpublish, delete, redirect, or change status.
Features
- Per-post expiry scheduling from a React metabox.
- Actions on expiry:
unpublish,delete,redirect,change_status. - WP-Cron processing with recurring and single-event scheduling.
- REST API endpoints for schedule CRUD and settings management.
- Admin dashboard (React) for schedule list, filters, and settings.
- Redirect host allowlist support for safer external redirects.
- Uncanny Automator integration (triggers + actions).
Requirements
- WordPress
6.0+ - PHP
7.4+ - Node.js
18+(for asset build/dev only) - Composer
2+(for PHP dependencies/dev tooling)
Installation
- Copy plugin to
wp-content/plugins/flex-content-scheduler. - Run
composer install. - Run
npm install. - Build assets with
npm run build. - Activate from WordPress Admin.
Usage
- Edit any supported public post type.
- In Content Expiry Schedule, choose:
- Expiry date/time
- Expiry action
- Redirect URL (if action is
redirect) - New status (if action is
change_status)
- Save/update the schedule.
- Optional: manage defaults from the admin settings page.
REST API Reference
Base namespace: /wp-json/flex-cs/v1
GET /schedulesPOST /schedulesGET /schedules/{id}PUT|PATCH /schedules/{id}DELETE /schedules/{id}GET /schedules/post/{post_id}GET /settingsPUT|PATCH /settings
Permissions:
- Read endpoints: require user with
edit_posts. - Write endpoints: require valid REST nonce, authenticated user, per-user rate limit, and
edit_postfor the target post.
Hooks and Filters
Actions:
flex_cs_schedule_createdflex_cs_schedule_updatedflex_cs_schedule_deletedflex_cs_before_expiry_actionflex_cs_after_expiry_actionflex_cs_cron_processed
Filters:
flex_cs_schedule_data_before_insertflex_cs_expiry_actionsflex_cs_due_schedules_limitflex_cs_allowed_redirect_hostsflex_cs_rest_write_rate_limitflex_cs_rest_write_rate_windowflex_cs_supported_post_typesflex_cs_enable_runtime_fallback
Uncanny Automator Integration
Integration code: FLEX_CS
Triggers:
FLEX_CS_CONTENT_EXPIREDFLEX_CS_CONTENT_SCHEDULED
Actions:
FLEX_CS_UNPUBLISH_POSTFLEX_CS_REDIRECT_POST
Development Setup
Install dependencies:
composer install
npm install
Run during development:
npm run dev
Build production assets:
npm run build
Testing and Quality Checks
PHP unit tests:
vendor/bin/phpunit
JavaScript tests:
npm test -- --runInBand
Coding standards:
vendor/bin/phpcs --standard=.phpcs.xml.dist
PHP syntax:
find . -name '*.php' -not -path './vendor/*' -print0 | xargs -0 -n1 php -l
Publish Checklist
Before publishing/tagging:
- Ensure all checks pass:
vendor/bin/phpunitnpm test -- --runInBandvendor/bin/phpcs --standard=.phpcs.xml.distnpm run build
- Verify plugin header version in
flex-content-scheduler.phpmatches release tag. - Verify
Stabledocs/changelog version entries are updated. - Ensure build assets are included in release artifacts.
- Note:
assets/dist/is ignored by git, so include built files via CI artifact packaging or release zip assembly.
- Note:
- Smoke test on a clean WordPress instance:
- create schedule
- update schedule
- delete schedule
- verify each expiry action behavior
- Confirm uninstall behavior (options/table cleanup) in non-production env.
Architecture Notes
- Loader pattern is used for deterministic hook registration.
- Database schema upgrades are managed through
MigrationManager. - AI-assisted development workflow was used for scaffolding, repetitive test creation, and audit-driven hardening; security and behavior decisions were manually validated.
Changelog
1.0.0
- Initial release with metabox/admin UI, REST API, cron processing, and Automator integration.
- Added security hardening (nonce validation, capability checks, rate limiting).
- Added redirect host allowlist and settings support.
- Added migration manager, expanded tests, and WPCS/PHPCS compliance improvements.
License
GPL-2.0-or-later