=== MonkeyDesign Content Expiry ===
Contributors:      monkeydesign2026
Tags:              expiry, post expiration, content scheduling, auto draft, auto trash
Requires at least: 6.0
Tested up to:      7.0
Requires PHP:      8.0
Stable tag:        1.1.0
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Automatically expire posts, pages, and custom post types on a set date. Lightweight and secure.

== Description ==

**Content Expiry** lets you set an expiration date on any post, page, or custom post type. When the date arrives, the plugin automatically changes the content's status — no manual monitoring required.

= Key features =

* Set expiration date and time on any post or page (date/time picker included)
* Three built-in expiry actions: **change to Draft**, **move to Trash**, or **make Private**
* Works with any custom post type
* Configurable default action per site
* Admin list column shows expiration date at a glance
* Lightweight — no bloat, no external requests, no tracking
* WP-Cron based scheduling — reliable, no server cron required

= PRO features (coming soon) =

* **Email notifications** — get notified X days before expiry (admin, author, or custom email)
* **Redirect action** — 301 redirect expired content to any URL (SEO-friendly)
* **Content replacement** — keep the post published but swap the content with a "this offer has expired" message
* **Expiry dashboard** — see what expires in the next 7 / 30 days, filterable by post type
* **Bulk expiry management** — set expiration on multiple posts at once from the list screen
* **Recurring expiry** — auto-reschedule expiry after it triggers (great for seasonal content)

== Installation ==

1. Upload the `content-expiry-md` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Go to **Content Expiry** in the WordPress admin menu to configure supported post types and the default action
4. Edit any post or page and look for the **Post Expiration** meta box in the sidebar

== Frequently Asked Questions ==

= Does this work with custom post types? =

Yes. Go to **Settings → Content Expiry** and check the post types you want to enable expiry for.

= What happens when a post expires? =

Depending on the action you chose, the post is either changed to Draft, moved to Trash, or made Private. The change happens automatically in the background via WP-Cron.

= Will this slow down my site? =

No. The plugin uses WP-Cron and runs only when WordPress is already handling a request. There are no external API calls and no frontend JavaScript.

= What if WP-Cron is disabled on my server? =

You can use a real server cron to trigger `wp-cron.php`. See the WordPress documentation on [alternative cron setups](https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/).

= Is the plugin compatible with the block editor (Gutenberg)? =

Yes. The expiry settings appear in the sidebar meta box, which works in both the classic and block editors.

= Can I schedule the same post to expire multiple times? =

Not in the free version — once a post expires and the action triggers, the expiration date is cleared. Recurring expiry is a PRO feature.

= Where is my data stored? =

The expiration date and action are stored as post meta (`_mdce_expiration_date` and `_mdce_expiration_action`). Plugin settings are stored in `wp_options` under `mdce_settings`. Nothing is sent off-site.

== Screenshots ==

1. The Post Expiration meta box in the block editor sidebar — set expiration date, time, and action per post.
2. The Posts list with the Expires column showing scheduled expiration date and action.
3. The Expires column highlighted in red for posts expiring within 24 hours.
4. The Settings page — configure supported post types, default action, and system status.

== Changelog ==

= 1.1.0 =
* Added Freemius SDK integration for upgrade flow, license management, and account page.
* Added PRO upgrade prompt in the admin menu.

= 1.0.0 =
* Initial release.
* Date/time picker (Flatpickr) for expiration scheduling.
* Three built-in actions: Draft, Trash, Private.
* Admin list column with expiration date.
* Settings page: supported post types, default action.
* WP-Cron based scheduling.
* Nonce validation, capability checks, input sanitization, and output escaping throughout.

== Upgrade Notice ==

= 1.0.0 =
Initial release — no upgrade needed.
