Gravity Forms Termageddon Add-On — Installation Guide
=====================================================

Version: 1.0.0-beta


REQUIREMENTS
------------

  All of the following must be in place before the add-on works correctly:

  1. WordPress 6.0 or newer
  2. PHP 7.4 or newer
  3. Gravity Forms 2.7 or newer (installed and active)
  4. Termageddon: Cookie Consent & Privacy Compliance
     WordPress plugin slug: termageddon-usercentrics
     https://wordpress.org/plugins/termageddon-usercentrics/
  5. Published WordPress Pages containing Termageddon policy embed codes
     (each embed must include data-policy-key="...")


INSTALLATION
------------

1. Install and activate the Termageddon WP plugin (termageddon-usercentrics).

2. In your Termageddon account (policies.termageddon.com), copy the embed code
   for each policy you need (Privacy Policy, Terms of Service, etc.).

3. Create a WordPress Page for each policy (e.g. /privacy-policy/) and paste
   the embed code into a Custom HTML block. Publish the page.

4. Upload or clone this add-on to:
     wp-content/plugins/gravityformstermageddon/

5. Activate "Gravity Forms Termageddon Add-On" in WP Admin.


ADD THE FIELD TO A FORM
-----------------------

1. Edit a form in the Gravity Forms form editor.

2. From Advanced Fields, add "Termageddon Consent".

3. In field settings, select which policies to include in the label.

4. Save the form.


WHAT GETS STORED ON SUBMISSION
------------------------------

When a user checks the consent box and submits:

  - Checkbox value: "1" (standard GF entry storage)
  - Entry meta key: termageddon_consent_snapshot
    Contains: UTC timestamp, policy keys, URLs, MD5 version hashes

View the snapshot on the entry detail page in the
"Termageddon Consent Record" meta box.


PLUGIN SETTINGS
---------------

Forms → Settings → Termageddon

  - Default label template ({policies} placeholder)
  - Policy content cache TTL (seconds)


IMPORTANT: COOKIE PLUGIN VS. POLICY PAGES
-----------------------------------------

Installing the Termageddon cookie consent plugin does NOT create Privacy Policy
or Terms pages. Those are separate pages with separate embed codes from your
Termageddon account. This add-on discovers policies from page embeds — not from
cookie banner settings alone.


TROUBLESHOOTING
---------------

"No policies configured" in form editor
  → No published page contains a Termageddon embed with data-policy-key.
    Create or update your policy pages.

Field label shows broken links
  → Verify embed codes are valid and pages are published.

Consent snapshot shows "unavailable" hash
  → Termageddon API was unreachable at submission time; entry still saved.


UNINSTALL
-------

Deactivating removes admin hooks but does not delete entry meta. Existing
termageddon_consent_snapshot values remain on entries.


SUPPORT
-------

For bugs and feature requests, use the GitHub issue tracker for this repository.
