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

Version: 0.1.0-alpha.1


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

  - WordPress 6.0 or newer
  - PHP 7.4 or newer
  - Gravity Forms 2.7 or newer (installed and active)

  User capabilities:
  - gravityforms_view_entries (or gform_full_access) — run drawings
  - gravityforms_edit_forms — configure per-form giveaway settings


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

1. Download or clone this repository.

2. Upload the entire gravityformsgiveaway folder to:
     wp-content/plugins/gravityformsgiveaway/

   The main plugin file must be at:
     wp-content/plugins/gravityformsgiveaway/giveaway.php

3. In WordPress Admin, go to Plugins and activate:
     "Gravity Forms Giveaway Add-On"

4. On first activation, the plugin creates the database table:
     {prefix}gf_giveaway_draws


CONFIGURE A FORM
----------------

1. Open any form in the Gravity Forms form editor.

2. Go to Settings → Giveaway.

3. Enable giveaway mode and configure:
     - Qualifying fields    — entries must have values in ALL selected fields
     - Display name fields  — shown in the drawing UI (e.g. First + Last name)
     - Winners per draw     — how many winners to select each round
     - Date filter          — optional; limit entries by submission date

4. Save the form.


RUN A DRAWING
-------------

1. Go to Forms → Giveaway Drawing in WP Admin.

2. Select your giveaway-enabled form.

3. Click Draw Winners.

4. Review results, mark winners as confirmed or not, then Save Draw.

   Once saved, drawn entries cannot be selected again on that form.


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

Forms → Settings → Giveaway

  - Default winners per draw
  - Randomization method (PHP shuffle or crypto/random_int)


UNINSTALL / DEACTIVATE
----------------------

Deactivating the plugin does NOT delete draw history. The wp_gf_giveaway_draws
table and all records remain in the database.


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

"No forms have giveaway enabled yet"
  → Enable giveaway on at least one form under Settings → Giveaway.

"No eligible entries remain"
  → All entries may already have been drawn, or qualifying fields are empty.

Draw button disabled
  → Check that qualifying fields and display name fields are configured.


SUPPORT
-------

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