=== Marketing Mystery Content Republisher ===
Contributors: dewan-shahedur-rahman
Donate link: https://wordpress.org/plugins/marketing-mystery-content-republisher/
Tags: republish, cron, schedule, posts, seo
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.3.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Bumps publish dates on a **per-item** timer you set (from each item’s publish time, GMT)—no duplicate posts.

== Description ==

Updates **publication dates** so lists and feeds see newer timestamps. Each post, page, or product waits your chosen time after **its** publish date, then can auto-update. WP-Cron only **checks** for due items every so often (hourly / twice a day / daily), which is separate from “yearly per post.”

**What gets republished**

Only **post-like content**: **Posts**, **Pages**, **Products** (WooCommerce), and **any other public post type** registered by themes or plugins. Categories, tags, and other taxonomies are **not** separate targets—the plugin does not “republish” terms.

**Highlights**

* **Schedule** — On/off and **wait after publish date** (hourly … yearly). New installs default to **Quarter (Recommended)** (~90 days).
* **Configure** — Choose which **public post types** are included and how many items run per batch (Advanced).
* **Per item** — On each post/page/product (etc.), override: follow site default for that type, force ON, or force OFF. **Republish now** for immediate date bump on published items.
* **Safe defaults** — New custom post types appear in settings turned **off** until you enable them.

**Important**

* Republishing sets **published** and **last modified** times to the republish moment. It does not rewrite body content.
* Uses **GMT** publish time. Bumps may trail the due moment by up to one cron check.
* WP-Cron needs traffic; use server cron + `wp-cron.php` for steady timing.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/marketing-mystery-content-republisher`, or install through Plugins → Add New.
2. Activate through the Plugins screen.
3. **Marketing Mystery Republisher → Schedule** — turn on and set how long after each item’s publish date before it can auto-bump.
4. Use **Marketing Mystery Republisher → Configure** to enable post types (e.g. post, page, product) and set batch options.

== Frequently Asked Questions ==

= Will this duplicate posts? =

No. Existing posts are updated in place; no new posts are created.

= Does this work with custom post types? =

Yes. Public post types are listed under Configure. New types are discovered automatically.

= Can I republish a single post immediately? =

Yes. On published items, use the **Republish now** button in the Auto republish sidebar box. It is hidden if the item is set to Force OFF.

= Does it change categories or tags? =

No. Only **posts/pages/products/CPTs** get new dates. Taxonomies are not edited by this plugin.

= Is this good for SEO? =

Changing dates affects ordering and freshness signals. Use thoughtfully and monitor your SEO plugin’s guidance.

= How is “one year” calculated? =

**Yearly** ≈ 365 days from the item’s GMT publish time (fixed length, not a calendar rule).

= Can I keep one post on an old or back-dated publish time? =

Yes. In the editor, set **Force OFF** for that item. Auto republish never runs for it, so the date stays until you change it yourself.

== Privacy ==

* Stores settings in the WordPress options table (`wapr_options`, `wapr_scheduler_sig`).
* Stores per-post choice in post meta (`_wapr_republish`) when not using the default.
* Does not send data to external services, analytics, or tracking endpoints.
* Scheduled work runs via WordPress’s own WP-Cron on your server.

== Screenshots ==

Add `screenshot-1.png`, `screenshot-2.png`, etc. in the WordPress.org plugin SVN `assets` folder (not inside the plugin zip). Typical shots: Schedule, Configure, editor sidebar with per-item options.

== Changelog ==

= 1.3.4 =
* Developer hooks: `wapr_republish_query_args`, `wapr_allow_republish_post`, `wapr_republish_post_date_data`.
* Post meta label clarified: Force ON applies when the item is due by publish date (not “always”).
* Plugin header Author set for release; readme `Contributors` aligned with WordPress.org profile. Stable tag bump.

= 1.3.3 =
* Plugin directory slug and display name no longer use the “WordPress” / “WP” trademark prefix (WordPress.org requirement). Text domain is `marketing-mystery-content-republisher`. Main bootstrap file: `marketing-mystery-content-republisher.php`.
* Removed manual `load_plugin_textdomain` (WordPress.org loads translations automatically).
* `DEVELOPMENT.md` moved to `docs/` for a clean plugin root; uninstall uses `delete_post_meta_by_key` / `delete_metadata` instead of raw SQL.
* PHPCS: documented nonce exceptions for read-only admin `$_GET` flags; prefixed loop variables in admin views.

= 1.3.2 =
* Security: stricter post meta save (skip revisions/autosaves, allowed post types only); settings whitelist; sanitized admin query args; capability failures use `wp_die`; republish batch validates post types; `republish_single` re-checks status and handles `WP_Error`; success admin notice only when a valid post is editable; `register_setting` sets `show_in_rest` false.

= 1.3.1 =
* Fix: reschedule cron when “wait after publish” changes even if the scanner stays daily (e.g. monthly → quarterly); clear stale hooks reliably. Short note on Schedule explains scanner vs wait.

= 1.3.0 =
* **Behavior change:** Automatic republish is **per post** (page, product, etc.): an item is updated only when its **publication date (GMT)** is at least as old as your chosen spacing. The same spacing applies again after each bump (from the new publication date). WP-Cron runs a **scanner** (hourly / twice daily / daily) to find due items; Site Health will show that recurrence, not necessarily “yearly” when spacing is yearly.
* UI and readme updated to describe spacing vs. scanner checks.

= 1.2.2 =
* Schedule: first run for Monthly / Quarterly / Half-yearly / Yearly is after one full interval (not ~1 minute), so “Next scheduled run” matches the chosen cadence.
* Cron sync runs after saving Schedule even when the options value is unchanged, and on load the scheduler fixes a mismatch between saved interval and the existing cron entry.

= 1.2.1 =
* Republish always updates both published date and last modified time; removed the Advanced checkbox.

= 1.2.0 =
* Remove taxonomy and term-level settings. Republish applies only to enabled **post types** (Posts, Pages, Products, CPTs) plus per-post overrides.

= 1.1.2 =
* Taxonomies in Configure default to all unchecked; enable the ones you want for auto republish.

= 1.1.1 =
* Taxonomies default to ON only for taxonomies used by the Posts type (e.g. Categories, Tags). Others (e.g. WooCommerce) default to OFF until enabled.

= 1.1.0 =
* Configure → Taxonomies: per-taxonomy checkboxes instead of long lists of terms.

= 1.0.2 =
* Fix: saving Schedule with intervals such as Hourly now stores the selected interval reliably.

= 1.0.1 =
* Add “Republish now” button on published posts (sidebar) for immediate date update.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.3.4 =
Developer hooks for extending republish behavior; clearer Force ON label. No settings migration.

= 1.3.3 =
If upgrading from an older fork, deactivate it, install/activate this build as `marketing-mystery-content-republisher`, then remove the old folder. Settings and post meta keys are unchanged (`wapr_options`, `_wapr_republish`).

= 1.3.2 =
Security hardening for settings, editor meta, admin notices, and cron republish. No behavior change for typical sites.

= 1.3.0 =
Republishing is now **per item** from each item’s publication date, not one shared cron time for all. Existing old posts may be due immediately on the next check (batch size still applies).

= 1.2.2 =
Monthly (and similar long) schedules: first run is after one full interval; cron stays aligned when you save Schedule.

= 1.2.1 =
Published and modified timestamps both update on every republish.

= 1.2.0 =
Taxonomy and term editor options removed. Eligibility is now post type + per-post override only. Save Configure to persist cleaned options.

= 1.0.1 =
Adds manual “Republish now” from the post editor.

= 1.0.0 =
Initial release.
