=== Sorteo Clientes – Risi WP ===
Contributors: Francisco Risi
Donate link: https://francisco.risi.cl/
Tags: sorteo, clientes, captacion, rifa, giveaway, lead generation
Requires at least: 5.0
Tested up to: 6.8
Stable tag: 1.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generates a simple, secure lead capture form and allows for an administrative winner selection process.

== Description ==

**WP Sorteo Clientes** is a simple and efficient plugin designed specifically for websites needing to run a **customer sweepstakes** or **lead generation campaign** while complying with Chilean RUT requirements.

This plugin provides the necessary infrastructure to manage the entire sweepstakes process:

* **Secure Data Capture:** Registers participants' First Name, Last Name,Phone, Email, and **Chilean RUT**. The RUT is validated using the standard Modulo 11 check to ensure data integrity.
* **Winner Selection:** Provides an administrative interface to **randomly select a winner** from the pool of non-winning participants with a single click.
* **Data Management:** Allows administrators to **view, reset the winner status**, or **delete** participants from the list.
* **Export Ready:** Allows the administrative staff to **export all participant data** securely in **CSV** format for external reporting or analysis.
* **Redirection:** Redirects successful registrations to a dedicated "Felicidades" (Congratulations) page, improving user experience.

The plugin automatically creates the necessary database table upon activation and generates the required pages (Captación, Ganador, Felicidades) containing the specific shortcodes.

== Installation ==

1.  Upload the `wp-sorteo-clientes` folder to the `/wp-content/plugins/` directory.
2.  Activate the plugin through the 'Plugins' menu in WordPress.
3.  Upon activation, the plugin automatically creates the necessary pages:
    * **Formulario de Captación:** Contains the registration form via the `[wsc_captacion]` shortcode.
    * **Seleccionar Ganador del Sorteo:** Used by the administrator to run the sweepstakes via the `[wsc_ganador]` shortcode.
    * **¡Felicidades, Registrado!:** The redirection page after successful registration.
4.  Navigate to the new **Sorteo** menu item in your WordPress Dashboard sidebar.
5.  Use the pages and the admin panel to manage your participants and select a winner.

== Frequently Asked Questions ==

= Does this plugin validate the Chilean RUT? =

Yes, the plugin includes a function to validate the Chilean RUT using the Modulo 11 algorithm, ensuring only valid Chilean identification numbers are registered.

= Can I export the participant list? =

Yes. In the "Gestión de Participantes" admin panel, you can use the **Exportar CSV** button to download all registered participant data, including RUT and winner status.

= What if I want to run another sweepstakes? =

You can **Reset** a participant's status from 'Winner' to 'Pending' via the administrative list table. To clear all data for a new sweepstakes, you must delete the rows manually or use a database tool, as mass deletion is not included for data safety.

== Screenshots ==

1. 
2. 
3. 

== Changelog ==

= 1.0.0 =
* Initial release.
* Added core functionality: Registration (Nombre, Apellido, Email, Teléfono, RUT).
* Implemented Chilean RUT validation (Modulo 11).
* Added Admin Management screen (List Table).
* Added Winner Selection logic.
* Added secure CSV export functionality.
* Implemented redirection to "Felicidades" page upon successful registration.