=== Commently ===
Contributors: ismailblogger
Tags: comments, threaded comments, comment voting, spam, cache
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 0.6.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Fast, cache-friendly comments with voting, sorting, moderation and spam protection. Comments stay in WordPress.

== Description ==

Commently replaces your theme's comment area with a modern, fast discussion section that works with full-page caching (LiteSpeed Cache, WP Rocket, W3 Total Cache, WP Super Cache).

* Threaded replies up to 5 levels, long threads collapse behind "Read N replies".
* Voting: up and down, upvote only, or like. Sort by Newest, Oldest, Top or Hot.
* Pin a comment, Author and Moderator badges.
* Readers can report comments; moderators get Pin, Unapprove, Spam and Trash right on the page.
* Spam protection: honeypot, time trap, rate limits, optional Cloudflare Turnstile, hCaptcha or reCAPTCHA, and a blocked-word list in English, Urdu and Roman Urdu.
* Works without JavaScript; the first 20 comments are real HTML for search engines.
* About 19 KB of CSS and JS, no jQuery, no web fonts.
* Comments stay in the native WordPress tables, so Akismet and other comment plugins keep working.
* Spotlight: commenters you verify (or who earn it with valuable comments) get a Verified tick and can show one of their own recent posts under a comment. Links are checked against a blocklist and, optionally, by Claude AI before they show; gambling, ponzi and scam sites are blocked and their owners banned.
* AI assistant (optional, your own key): pick Claude, ChatGPT, Grok, Gemini, DeepSeek, OpenRouter or any OpenAI-compatible service. It sends clear spam to the spam folder (deleted after a grace period you choose) and drafts or posts short, human replies in your voice and the commenter's language, with an "AI reply" label.
* Dashboard: counts, the comments waiting for you, AI-caught spam, and who comments most.
* Reply emails: readers can ask to be emailed when someone replies to them, after confirming their address once. Every email has a one-click unsubscribe.
* Bursts are held: from the third comment in 24 hours (adjustable) a commenter waits for moderation, with no link.
* Privacy: data export and erase, optional IP anonymisation. Uninstall removes everything.

== External services ==

**AI providers (optional, off by default).** If you add your own API key in Settings > Commently > AI and turn on a feature, Commently sends data to the one provider you choose: for the spam check and replies, the comment text, the commenter's name and website, and the post title and text; for the Spotlight link check, the link's title, address and a short excerpt. Providers: Anthropic Claude (https://api.anthropic.com, [terms](https://www.anthropic.com/legal/commercial-terms), [privacy](https://www.anthropic.com/legal/privacy)), OpenAI (https://api.openai.com, [terms](https://openai.com/policies/terms-of-use), [privacy](https://openai.com/policies/privacy-policy)), xAI Grok (https://api.x.ai, [terms](https://x.ai/legal/terms-of-service), [privacy](https://x.ai/legal/privacy-policy)), Google Gemini (https://generativelanguage.googleapis.com, [terms](https://ai.google.dev/gemini-api/terms), [privacy](https://policies.google.com/privacy)), DeepSeek (https://api.deepseek.com, [terms](https://www.deepseek.com/terms), [privacy](https://www.deepseek.com/privacy)), OpenRouter (https://openrouter.ai, [terms](https://openrouter.ai/terms), [privacy](https://openrouter.ai/privacy)), or an OpenAI-compatible address you enter.

Commently connects to a captcha service only if you turn one on in Settings > Commently (off by default):

* Cloudflare Turnstile: loads https://challenges.cloudflare.com/turnstile/v0/api.js when a reader focuses the comment form, and verifies the answer at https://challenges.cloudflare.com/turnstile/v0/siteverify. [Terms](https://www.cloudflare.com/website-terms/), [Privacy](https://www.cloudflare.com/privacypolicy/).
* hCaptcha: https://js.hcaptcha.com and https://api.hcaptcha.com. [Terms](https://www.hcaptcha.com/terms), [Privacy](https://www.hcaptcha.com/privacy).
* Google reCAPTCHA: https://www.google.com/recaptcha/. [Terms](https://policies.google.com/terms), [Privacy](https://policies.google.com/privacy).

The visitor's captcha answer and IP address are sent to the chosen provider to check that the commenter is human.

== Installation ==

1. Upload the plugin and activate it.
2. Visit Settings > Commently. If comments are switched off on your posts, the Dashboard shows it and turns them on in one click.
3. Choose voting, sorting and spam options in the Settings tab.
4. Commently appears automatically where your theme shows comments. For block themes it replaces the Comments block. You can also use the "Commently Comments" block or the [commently] shortcode.

== Development ==

The JavaScript and CSS in assets/build are built with esbuild from the readable source in assets/src (TypeScript and CSS). Run `npm install` and `npm run build` to rebuild them.

== Frequently Asked Questions ==

= My site is behind Cloudflare or a proxy. =

Commently uses REMOTE_ADDR for rate limits and guest votes. Pass the real visitor IP with the `commently_client_ip` filter.

= Will my cache show new comments? =

Yes. Commently purges the post in LiteSpeed Cache, WP Rocket, W3 Total Cache and WP Super Cache when a comment is approved, moderated or pinned.

== Screenshots ==

1. The comment section on a post: sort tabs, a calm comment box, a pinned comment from a verified reader with a link to their own post, votes, and long threads folded away.
2. A verified reader's comment with the link they chose from their own blog.
3. Commently on a phone, with a thread opened.
4. The Dashboard: comments waiting for review, spam caught by AI, and who comments most.
5. The AI assistant: pick Claude, ChatGPT, Grok, Gemini, DeepSeek or OpenRouter, then spam check, reply mode, voice and language.
6. The setup check finds posts with comments switched off and turns them on in one click.

== Changelog ==

= 0.6.2 =
* A welcome screen right after activation, with three steps to make Commently yours.
* Redesigned dashboard: a Get started checklist, clearer counts, friendlier empty states.
* "Settings" link on the Plugins screen.

= 0.6.1 =
* New setting under Privacy: keep all Commently data when the plugin is deleted, so a reinstall picks up where you left off.

= 0.6.0 =
* "Email me when someone replies": optional, direct replies only, sent in the background, one-click unsubscribe in every email.
* Guests confirm their email once before their Verified tick, Spotlight link or reply emails switch on.
* Setup check offers each change separately and never preselects guest commenting.
* AI-caught spam is deleted after the grace period counted from when it was marked, not from when it was written.

= 0.5.0 =
* Setup check: finds posts with comments switched off, auto-closing and login-only commenting, and fixes them in one click with undo.
* One dismissible admin notice when readers cannot comment yet.
* TypeScript source ships with the plugin.

= 0.4.0 =
* AI assistant with seven providers: spam check with auto-delete, short replies (draft or automatic) with voice, language and length settings, test connection.
* Dashboard tab, AI replies tab, approve, not-spam and delete-for-good actions.

= 0.3.0 =
* Spotlight links and Verified commenters, with blocklist and optional Claude AI safety check, auto-ban.
* Commenters tab: approve, ban and review links.
* Hold bursts of comments for moderation.
* LiteSpeed Cache no longer caches Commently's REST responses.

= 0.2.0 =
* Voting, sorting, pinned comments, badges, reports and on-page moderation.
* Captcha support, blocked words (English, Urdu, Roman Urdu), settings page.
* New design, automatic cache purge, privacy export/erase, IP anonymisation.

= 0.1.0 =
* First development build.
