=== Auto Archive for Gravity Forms ===
Contributors: Shaun3180
Tags: gravity forms, archive, form entries, entry management, data retention
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically archive older Gravity Forms entries on a schedule — built for annual programs clearing out last cycle's submissions.

== Description ==

**Auto Archive for Gravity Forms** keeps your entry lists clean by moving older submissions into a dedicated archive instead of deleting them. It is designed for organizations — universities, registration programs, seasonal applications — that run on an annual cycle and want the current cohort front-and-center while last year's submissions are tucked away but recoverable.

Archived entries are flagged and hidden from the default Gravity Forms entries view, but remain safely in the database under a dedicated "Archived" tab, where they can be browsed and restored at any time. Archiving never deletes anything.

= Free features =

* **Archive & restore individual entries** — an "Archive" link on every entry in the Entries list, and on the entry detail screen. Restore just as easily.
* **Dedicated "Archived" view** — a filter tab on the Entries list that shows archived entries, with accurate counts kept out of your active totals.
* **Automatic rules on every form** — each form can archive itself on a daily check, with its own rule. A "Run now" button lets you apply a rule on demand.
* **Rolling age rule** — "archive entries older than N days/months."
* **Recurring annual cutoff** — archive everything submitted before a set day each year (e.g. Aug 1), ideal for clearing last cycle at the start of a new program year.
* **Activity log** — a running record of what was archived, when, and by which rule, under Forms › Settings › Auto Archive.

= Pro add-on =

The optional **Auto Archive for Gravity Forms - Pro** add-on is a separate plugin (available from the developer) that hooks into this one to add:

* **Date-field rules** — archive based on a date field on the form itself (e.g. a program end date), not the submission date.
* **Conditional rules** — only archive entries matching field values (e.g. "Decision is Declined").
* **Bulk Archive All** — archive every active entry on a form in one click.
* **Trash & permanent delete** — go beyond soft archive on a retention schedule, always exporting a backup first.
* **CSV / Excel export** — on demand, or automatically before a destructive run.
* **Off-site cloud backup** — push a backup to Amazon S3 or Backblaze B2 before deleting.
* **Email summaries** — a per-run report with the backup attached.

The free plugin is fully functional on its own; nothing on its screens is locked or disabled.

== Installation ==

1. Install and activate Gravity Forms.
2. Upload the `auto-archive-for-gravity-forms` folder to `/wp-content/plugins/`, or install through the Plugins screen.
3. Activate the plugin.
4. Archive entries from any form's **Entries** list using the per-row "Archive" link, or open a form's **Settings › Auto Archive** tab to set up the automatic age rule. The global activity log lives at **Forms › Settings › Auto Archive**.

== Frequently Asked Questions ==

= Does archiving delete my entries? =

No. Archiving flags entries and hides them from the default view. They stay in the database and can be restored at any time from the Archived tab.

= Can I archive more than one form automatically? =

Yes — every form can have its own automatic rule, free. The Pro add-on adds date-field and conditional rules, retention-based deletion with backups, exports, and more.

= Where did the entries go? =

Open the form's **Entries** list and click the **Archived** filter tab to see and restore them.

== Changelog ==

= 1.1.0 =
* New: "Delete Permanently" bulk action on the Archived tab, guarded by a confirmation dialog. Before removing anything it fires the gfaa_pre_bulk_delete_archived filter so the Pro add-on can export a backup first (and abort the deletion if that backup fails). Without the add-on the delete proceeds — free deletes on request, Pro adds the backup safety net.
* Fix: archived entries that were also trashed or marked as spam could become invisible in every view. The active-view exclusion no longer applies on the Trash and Spam views, so such entries remain visible where they belong.
* Security/robustness: notices now distinguish success from error states.

= 1.0.0 =
* Initial release.
* Archive and restore individual entries from the Entries list and the entry detail screen — archiving never deletes anything.
* Dedicated "Archived" filter tab, with archived counts kept out of your active totals.
* Automatic rules on every form — rolling age ("archive entries older than N days/months") or a recurring annual cutoff — on a daily check, plus a "Run now" button to apply them on demand.
* Activity log of what was archived, when, and by which rule, under Forms &rsaquo; Settings &rsaquo; Auto Archive.
* Contextual Help tab on the Entries screen.
* Built to WordPress.org security and coding standards: output escaping, capability checks, and nonce verification throughout.
* Pro features ship as a separate add-on plugin; nothing on the free screens is locked or disabled.