=== Survey Poll ===
Contributors: snehalpancholi
Tags: poll, survey, vote, quiz, results
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create single-question polls with animated result bars. Embed polls anywhere with a shortcode.

== Description ==

Survey Poll lets you build single-question polls directly from the WordPress admin. Each poll supports multiple answer options, optional multiple-choice mode, start and end dates, and cookie-based vote tracking to prevent duplicate votes.

After a visitor votes, animated progress bars reveal the live results — no page reload required.

**Key Features:**

* Custom post type for clean poll management
* Unlimited answer options per poll (minimum 2)
* Optional multiple-choice mode (checkboxes vs radio buttons)
* Scheduled polls with start and end dates
* Cookie-based repeat-vote prevention (30-day cookie)
* Animated result bars with smooth CSS transitions
* Accessible markup with keyboard navigation and focus indicators
* Dark mode support via CSS prefers-color-scheme
* Multiple polls can appear on the same page
* Lightweight — no jQuery dependency; vanilla JS + fetch API
* `[poll id="123"]` shortcode for embedding anywhere
* `[poll id="123" show_results="1"]` to display results without voting
* Admin list table shows option count, total votes, and shortcode at a glance

== Installation ==

1. Upload the `survey-poll` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Navigate to **Survey Polls** in the WordPress admin sidebar.
4. Click **Add New**, enter a poll question as the title, add answer options, configure settings, and publish.
5. Copy the shortcode shown in the poll list table and paste it into any post, page, or widget.

== Frequently Asked Questions ==

= How do I embed a poll? =
After publishing a poll, go to **Survey Polls** in the admin. The shortcode column shows `[poll id="123"]` — copy and paste it into any post or page.

= Can visitors see results without voting? =
Yes. Use `[poll id="123" show_results="1"]` to display the results bar view directly.

= How is duplicate voting prevented? =
A cookie named `addlc_svp_{poll_id}` is set for 30 days when a visitor votes. If the cookie is present, the vote form is replaced with the results view automatically.

= Can I allow voters to pick multiple answers? =
Yes. When editing a poll, check the **Allow Multiple Choice** checkbox in the Poll Settings section. The form will render checkboxes instead of radio buttons.

= Can I schedule a poll to run for a specific period? =
Yes. Set a **Start Date** and/or **End Date** in the poll settings. Visitors see a "not started yet" message before the start date, and results only after the end date.

= Will the plugin slow down my site? =
No. CSS and JS are only loaded on pages that contain a `[poll]` shortcode. No jQuery dependency is required.

= Where is vote data stored? =
Votes are stored in a custom database table `{prefix}svp_votes`. Poll configuration is stored as post meta on the `addlc_poll` custom post type.

= What happens when the plugin is uninstalled? =
All poll posts, their meta data, and the votes table are permanently deleted.

== Screenshots ==

1. Poll list table with shortcode, option count, and vote totals.
2. Poll editor with repeatable option fields and settings.
3. Frontend poll form with custom styled radio buttons.
4. Animated result bars displayed after voting.

== Changelog ==

= 1.0.0 =
* Initial release.
* Custom post type `addlc_poll` for poll management.
* Repeatable answer options with Add/Remove controls.
* Single-choice and multiple-choice modes.
* Start/end date scheduling.
* Cookie-based vote deduplication.
* Animated CSS result bars via `[poll]` shortcode.
* AJAX voting with no page reload.
* Dark mode and responsive design.
* AddonLogic automatic update integration.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
