=== CS Post Comment Reactions ===
Contributors:       sumittejani
Tags:               comments, reactions, likes, media, social
Requires at least:  5.8
Tested up to:       7.0
Stable tag:         1.0.0
Requires PHP:       7.4
License:            GPL v2 or later
License URI:        https://www.gnu.org/licenses/gpl-2.0.html

Adds social-style cycling reactions, mandatory media uploads, and real-time AJAX interactions to native WordPress comments.

== Description ==

**CS Post Comment Reactions** transforms the standard WordPress comment section into a fully social, interactive experience — no page reloads, no third-party services.

= Core Features =

**One-Button Cycling Reactions**
A single button cycles through three states: neutral → 👍 Liked → 👎 Disliked → neutral. Counts update live via AJAX without refreshing the page.

**Media-First Comments**
Every comment must include at least one image. A floating 📎 icon at the bottom-right corner of the comment textarea lets commenters attach files instantly — or drag and drop directly onto the textarea.

**Supported Formats**
JPG, JPEG, PNG, GIF, WEBP. Optional MP4 video. All types and the maximum file size are configurable.

**Works With Any Theme**
Hooks into WordPress's native `comment_text` filter and `comment_form` action — no template overrides, no shortcodes.

**Nested / Threaded Comments**
Fully compatible with WordPress's built-in `wp_list_comments()` at any nesting depth.

**Guest Reactions**
Allow logged-out visitors to react. Guest identity is tracked via a localStorage UUID mirrored to a cookie, with an IP-address fallback.

**Rate Limiting**
Prevents reaction spam: 10 reactions per user / IP per 5 minutes, enforced server-side using WordPress transients.

**Admin Settings Panel**
Full settings page at Settings → Comment Reactions, covering features, button labels, icons, upload rules, comment sort order, and a one-click reaction data reset. Includes a live statistics widget.

**Security First**
Nonce verification on every AJAX request and every form submission. All input sanitised; all output escaped. Upload MIME type and size validation server-side. Ownership check prevents foreign attachment IDs from being submitted.

**Translation Ready**
All strings use the `cs-post-comment-reactions` text domain.

= Requirements =

* WordPress 5.8 or higher
* PHP 7.4 or higher

== Installation ==

= Automatic (Recommended) =

1. Log in to your WordPress dashboard.
2. Navigate to **Plugins → Add New**.
3. Search for **CS Post Comment Reactions**.
4. Click **Install Now**, then **Activate**.

= Manual =

1. Download the plugin `.zip` from WordPress.org.
2. Go to **Plugins → Add New → Upload Plugin**.
3. Select the `.zip` and click **Install Now**.
4. Click **Activate Plugin**.

= After Activation =

1. Go to **Settings → Comment Reactions** and configure the plugin.
2. Ensure **Settings → Discussion** has comments and threaded comments enabled.
3. Your theme must use `wp_list_comments()` and `comment_form()` — all default WordPress themes do.

== Frequently Asked Questions ==

= Does this work with my theme? =

Yes, as long as your theme calls the standard WordPress comment functions `wp_list_comments()` and `comment_form()`. All default themes are supported.

= Can visitors react without logging in? =

Yes — enable **Guest Voting** in **Settings → Comment Reactions → General**. Guest reactions are tracked via a localStorage UUID with a cookie fallback and an IP-based last resort.

= Can I disable dislikes? =

Yes. Uncheck **Enable Dislikes** in **Settings → Comment Reactions → General**. The button will toggle between Liked and neutral only.

= What image formats are supported? =

JPG, JPEG, PNG, GIF, and WEBP by default. MP4 video can be enabled. The maximum file size (default: 5 MB) is also configurable.

= Why must every comment have media attached? =

This plugin is built around a media-first commenting experience. Both client-side (instant feedback) and server-side (secure fallback) validation enforce the requirement.

= Will this slow down my website? =

No. CSS and JavaScript are loaded only on singular posts and pages with comments open. All user interactions are handled via AJAX.

= How do I reset all reaction data? =

Go to **Settings → Comment Reactions**, find the **Maintenance** box in the sidebar, and click **Reset All Reactions**.

= Does uninstalling the plugin remove all data? =

Yes. Uninstalling via the WordPress admin removes the reactions table, all plugin options, all reaction comment meta, and all associated post meta.

== Screenshots ==

1. The single cycling reaction button in its three states: neutral, Liked (blue), and Disliked (red).
2. The floating 📎 upload icon at the bottom-right corner of the comment textarea.
3. A published comment showing an attached image and live reaction counts.
4. The admin settings page with General, Customization, Upload, and Comments sections.
5. The Statistics sidebar widget on the admin settings page.

== Changelog ==

= 1.0.0 =
* Initial release.
* Single cycling reaction button: neutral → Like → Dislike → neutral.
* Floating 📎 upload icon at bottom-right corner of the comment textarea.
* Drag-and-drop file upload support on the textarea.
* Media-required enforcement: client-side and server-side.
* AJAX reactions with real-time count updates.
* Image lightbox for full-screen viewing.
* Guest voting support.
* Rate limiting (10 per user/IP per 5 minutes).
* Admin Settings panel with statistics widget.
* Clean uninstall: all data removed on plugin deletion.
* Translation-ready.

== Upgrade Notice ==

= 1.0.0 =
Initial release — no upgrade steps required.

== Privacy Policy ==

This plugin does not transmit any data to external servers or third parties.

For **logged-in users**, reactions are stored against their WordPress user ID in a local database table.

For **guest users** (when enabled), a randomly-generated identifier is stored in the visitor's browser (`localStorage` and a cookie) and optionally their IP address is recorded in the local database solely to prevent duplicate reactions.

All data is removed upon plugin uninstallation or by using the **Reset All Reactions** function.

Site administrators are responsible for disclosing this data storage in their own Privacy Policy if required by applicable law (e.g. GDPR).
