=== Quarivo Comment Shield ===
Contributors: taka235345
Tags: comments, antispam, spam, moderation, security
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.3.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Activate it and stay focused. Obvious comment spam is quietly quarantined, while possible false positives remain easy to review and restore.

== Description ==

**Activate it once. Quarivo Comment Shield quietly handles obvious spam.**

Quarivo Comment Shield is a local, low-overhead comment spam filter built for site owners who want less notification noise without losing potentially important messages.

It combines several independent signals with three selectable protection modes. Balanced mode treats every language equally, while Japanese-site enhanced and Strict Japanese modes can apply a reversible site-language policy chosen by the administrator.

= Three protection modes =

* **Balanced** uses language-neutral behavior and content evidence. It is the default for non-Japanese WordPress sites.
* **Japanese-site enhanced** quarantines an untrusted non-Japanese first contact only when an external link or submitted Website supplies independent evidence.
* **Strict Japanese** quarantines every new untrusted comment without Japanese text. It is the default for Japanese WordPress sites and is intended for Japanese-only communities.
* Trusted users, exact allowed email addresses, and previously approved commenters remain exempt in every mode.
* A mode-based quarantine is never silently deleted. The original comment stays local, reviewable, restorable, and protected by the Review Safety Guard.

= A review inbox designed for real work =

* Shows WordPress-stored moderation candidates at the top.
* Opens the full original comment, author details, score, reasons, and history in an accessible modal.
* Prioritizes unread, lower-confidence comments that may need human review.
* Searches by author, email address, IP address, or comment text.
* Filters by quarantined, unreviewed, possibly important, confirmed spam, restored, and all states.
* Shows 25, 50, or 100 rows per page without loading the entire quarantine at once.
* Processes every matching result in small resumable batches, even when thousands are waiting.
* Protects every unopened comment scored 9 or lower from bulk spam confirmation until a moderator opens it.
* Allows deletion only after a record has been confirmed as spam or restored.
* Keeps confirmed-spam records visible in a dedicated one-click view until retention cleanup or an explicit deletion.
* Lets a moderator undo a spam confirmation without publishing the comment and reverses that learning vote.

= Quiet protection with safe defaults =

* Stops high-confidence automated spam before it enters the normal WordPress comments table.
* Uses a honeypot, cache-safe form token, timing signals, duplicate/rate checks, link patterns, and content heuristics.
* Recognizes compact machine-link promotions by compound structure instead of individual brands or destination domains.
* Recognizes compact bare-link drops through repeated destination, unrelated identity, generic invitation, and message-length evidence.
* Detects reward and payout lures only when a known shortened link and an immediate action prompt provide independent evidence.
* Detects gambling-link campaigns across several common scripts while exempting recovery, safety, warning, and research context.
* Suppresses comment notification noise only for comments intercepted by the plugin.
* Works with standard WordPress comments and includes compatibility handling for common AJAX comment flows.
* Requires no account, API key, CAPTCHA, or external service.
* Aggregates equivalent repeated spam into one review record and places a finite ceiling on unreviewed quarantine growth.
* Falls back to WordPress moderation instead of losing a comment when quarantine capacity is unavailable.

= Conservative local learning =

When a moderator restores or approves a false positive, or marks a comment as spam, the result is recorded locally. This works in both the Quarivo review inbox and the ordinary WordPress Comments screen. Repeated false positives can slightly reduce selected soft-signal weights. An exact author Website repeatedly confirmed as spam can add only a small supporting score when that same Website is also linked in a future comment. The stored Website key is hashed, expires after 180 days, and is capped at 500 entries.

Campaign similarity memory also creates versioned, non-readable signatures from human-reviewed comments. It normalizes URLs, rotating numbers, generated identifiers, and small wording changes so variants of one campaign can supply supporting evidence. A similar restored legitimate comment vetoes that learned spam score. Similarity never blocks a comment by itself, trusted commenters remain exempt, and automatic quarantine is never used as training data. Earlier retained moderator verdicts are imported in bounded, resumable batches after the update. If learning storage becomes unavailable, the import cursor is retained, a bounded retry is scheduled, and campaign matching fails open until storage is verified again.

Campaign signatures stay in the site's database, expire after two years, and are capped at 5,000 entries. They survive normal updates and are retained by the default plugin-removal setting. If a moderator later corrects a verdict, the earlier versioned signature is replaced or removed rather than counted twice. Strong security signals are never weakened automatically.

“Publish and learn” can also allow the exact submitted email address. The plugin does not automatically trust a shared IP address or an entire email domain.

= Privacy and retention =

Quarantined comments and hashed campaign-learning signatures remain on the site's own database and are not sent to an external service. The plugin integrates with WordPress personal-data export and erasure tools.

Unreviewed quarantined comments are never removed automatically. Equivalent repeated submissions are grouped into one record, and a finite admission ceiling prevents unlimited growth. When capacity is unavailable, comments fall back to normal WordPress moderation. Confirmed-spam and restored records are removed after the administrator's selected retention period (30 to 365 days). Action history is retained for up to one year.

If WordPress deletes the plugin, Quarivo data is retained by default so possible false positives can be recovered after reinstalling. Administrators can first download a private JSON export or explicitly choose permanent removal under **Settings > Data and removal**. Permanent removal deletes only Quarivo tables, settings, learning data, and Quarivo comment metadata; ordinary WordPress comments, posts, users, and media are not deleted.

== Installation ==

1. Upload the `quarivo-comment-shield` folder to `/wp-content/plugins/`, or install it from the WordPress plugin directory.
2. Activate **Quarivo Comment Shield** through the Plugins screen.
3. Use the activation guide, or open **Comments > Quarantined Comments**, to review candidates. Basic protection needs no setup.
4. If another plugin also blocks or discards comments, test carefully and deactivate the overlapping filter to avoid double decisions.

== Frequently Asked Questions ==

= Does it quarantine every non-Japanese comment? =

Only when **Strict Japanese** is selected and the commenter is not already trusted. **Balanced** never treats a language as suspicious, and **Japanese-site enhanced** also requires an external link or submitted Website. In every mode the comment is quarantined for review rather than permanently deleted, and a restored or previously approved commenter can be trusted safely.

= Can I restore a legitimate comment? =

Yes. Open the comment in the review inbox and restore it either as pending or published. You can also publish it and teach the plugin to trust that exact email address.

= Does learning send comments to an AI or external API? =

No. Feedback and score adjustments stay in the local WordPress database. No external service is used.

= Can learning make protection unsafe? =

Learning uses only human moderator feedback and is tightly capped. False-positive history can slightly reduce selected soft signals. A single matching campaign confirmation remains a small supporting signal; repeated independent confirmations can add a larger but bounded score. Similarity never blocks a comment by itself, and a matching restored comment vetoes the campaign score. Honeypot hits and other strong signals are not weakened automatically.

= Will my learning disappear after an update or reinstall? =

No during a normal update. Campaign signatures are stored in a dedicated versioned table and earlier retained verdicts are imported in resumable batches. WordPress plugin deletion retains the table by default, so reinstalling reconnects it. Learning is removed only by the explicit Reset learning history action, by choosing permanent Quarivo data removal before plugin deletion, or by the documented two-year/5,000-signature safety limits.

= What happens to old quarantine records? =

Only reviewed records marked as confirmed spam or restored are removed after the selected retention period. Equivalent repeats are grouped. Unreviewed records remain until a moderator handles them, subject to a finite capacity; overflow falls back to WordPress moderation rather than being discarded.

= Can I process thousands of quarantined comments at once? =

Yes. Choose a filter, select “all matching results,” and apply the action. The browser requests a small server-side batch at a time and shows progress. The job has a fixed upper boundary so newly arriving comments are not unexpectedly included, retries brief connection failures, and can resume when the same moderator returns. Keep the review screen open while it is actively running.

As an extra false-positive safeguard, unopened comments with an assessment score of 9 or lower are never included in bulk spam confirmation. Open those possible-important comments first and decide individually. High-confidence queues remain eligible for safe staged processing.

= What data is stored? =

For quarantined comments, the plugin stores the submitted name, email address, URL, comment, IP address, browser information, submission time, target post, and local assessment details. This data remains on the site and is included in WordPress privacy export and erasure requests.

= What happens on uninstall? =

By default, WordPress plugin deletion retains quarantine records, action history, settings, local learning, and Quarivo comment metadata. Reinstalling Quarivo reconnects that data and shows a recovery notice. Temporary jobs, locks, and scheduled tasks are removed.

Before deletion, open **Comments > Quarantined Comments > Settings > Data and removal**. You can download a private JSON export for safekeeping or explicitly enable permanent removal. The JSON export is not imported automatically. Permanent removal requires a confirmed saved choice and deletes only Quarivo data; ordinary WordPress comments, posts, users, and media are never removed.

While the plugin is absent, its review screen and WordPress privacy exporter/eraser are unavailable.

= Where did a comment go after I confirmed it as spam? =

It was not immediately deleted. Open the **Confirmed spam** count at the top of the review inbox, or choose **Confirmed spam** from the status filter. The record remains reviewable until you explicitly delete it or the reviewed-record retention period ends.

If the confirmation was a mistake, open the record and choose **Undo spam confirmation**. It returns to quarantine without being published, and the earlier local-learning vote is reversed.

== Screenshots ==

1. Priority review inbox with WordPress-stored candidates at the top.
2. Full comment review modal with reasons, details, history, and restore actions.
3. Local learning dashboard showing allowed email addresses and conservative score calibration.
4. Privacy-aware retention, private data export, and safe plugin-removal controls.

== Changelog ==

= 2.3.2 =
* Keeps the Needs review badge synchronized with the actionable WordPress-held comment list.
* Stops already reviewed or explicitly moderated comments from remaining in the review count.
* Restores unreviewed spam-status candidates to the priority list across supported WordPress versions.
* Counts each WordPress comment once even if legacy metadata contains duplicate decision rows.

= 2.3.1 =
* Adds privacy-preserving spam campaign similarity memory trained only by explicit moderator verdicts.
* Recognizes small wording, identity, number, and destination changes through versioned hashed signatures rather than readable stored text.
* Requires independent destination and scorer evidence, keeps trusted commenters exempt, and lets similar restored comments veto a learned spam score.
* Makes every source verdict idempotent and reversible so repeated actions do not double-count and corrected decisions replace or remove earlier learning.
* Imports earlier retained Quarivo verdicts in bounded resumable batches and shows durable signature count, import progress, and storage health in the Learning screen.
* Retains campaign learning through normal updates and default plugin removal, includes it in private JSON export, and applies two-year and 5,000-signature safety limits.

= 2.3.0 =
* Adds Balanced, Japanese-site enhanced, and Strict Japanese protection modes with clear tradeoffs and one-click selection.
* Uses a locale-aware default: Japanese WordPress sites start in Strict Japanese, while other site languages start in Balanced.
* Quarantines mode matches reversibly instead of silently deleting them, with trusted and previously approved commenters exempt.
* Detects linked non-Japanese first contacts through external-destination structure rather than individual languages, domains, brands, or campaign phrases.
* Ignores copied post-title text when deciding whether a comment contains meaningful Japanese.
* Adds an upgrade notice, current-mode status badge, settings shortcut, audit/export coverage, and multilingual mode regression tests.

= 2.2.12 =
* Detects shortened-link payout, prize, profit, bonus, and reward lures through compound evidence instead of campaign or destination lists.
* Keeps shortened links neutral by themselves and separately scores immediate action prompts and outcome promises.
* Protects trusted commenters, institutional sources, explicit review requests, ordinary document links, event invitations without reward claims, and editorial scam warnings.
* Removes scheme-less short URLs from visible-text analysis so compact-template measurements stay consistent with URL detection.
* Adds regression and real HTTP-submission coverage for the live payout bypass and unseen multilingual reward campaigns.

= 2.2.11 =
* Detects compact multilingual bare-link drops without maintaining destination, brand, TLD, or email-provider blocklists.
* Uses repeated author Website, unrelated email identity, generic visit wording, short payload, and destination depth as independent evidence.
* Silently quarantines root-only high-confidence link drops while routing lower-confidence deep-link campaigns to WordPress spam.
* Protects trusted commenters, matching identities, same-site email, institutional email, shared platforms, substantive messages, and explicit feedback or technical-help requests.
* Adds regression and real HTTP-submission coverage for the live Cyrillic bypass, unseen multilingual variants, and normal link-sharing controls.

= 2.2.10 =
* Detects compact repeated-Website promotions using machine link markup, unrelated email sources, short payloads, and identity mismatch as supporting evidence.
* Expands compound gambling-link detection across common Latin, Cyrillic, Japanese, Chinese, Korean, and Arabic terms without treating any language as suspicious.
* Protects gambling-recovery, safety, warning, research, trusted-commenter, institutional-email, same-site, shared-service, and legitimate identity-matched links from silent quarantine.
* Adds regression coverage for the live Cyrillic .com bypass, unseen gambling families, unknown promotional topics, and multilingual false-positive controls.

= 2.2.9 =
* Adds Review Safety Guard so unopened lower-confidence comments cannot be swept into a bulk spam confirmation.
* Adds one-click undo for spam confirmation without publishing the comment and reverses the earlier learning vote.
* Makes the possibly-important count exactly match its filtered list and removes stale admin count results.
* Scrolls priority-count links directly to the filtered results and adds explicit confirmation and outcome messages for spam actions.
* Makes the Currently quarantined summary card a direct shortcut back to the complete auto-quarantine list.

= 2.2.8 =
* Detects high-confidence editorial-looking SEO link insertion using compound structure instead of individual domains or languages.
* Keeps ordinary reference links, public-mailbox comments, institutional sources, same-site links, and trusted commenters conservatively reviewable.

= 2.2.7 =
* Retains Quarivo data by default when WordPress deletes the plugin and reconnects it after reinstallation.
* Adds a confirmation-protected permanent-removal option that deletes only Quarivo data.
* Adds verified data counts, a private streamed JSON export, and a direct review link before removal.
* Keeps Confirmed spam records visible in a one-click filtered view until explicit deletion or scheduled retention cleanup.
* Applies fail-safe defaults and site-by-site removal choices on multisite.

= 2.2.6 =
* Improved language-neutral structural spam detection and local learning from WordPress moderation actions.
* Added regression coverage for historical, adversarial, multilingual, same-site, and legitimate comments.

= 2.2.4 =
* Clarified important-review filtering and the exact effect of each bulk action.

= 2.2.3 =
* Improved compound link-spam detection while keeping languages, missing JavaScript, shared IP addresses, and normal reference links neutral or non-conclusive.

== Upgrade Notice ==

= 2.3.2 =
Fixes a review-count mismatch and makes every unreviewed WordPress-held candidate reachable from the priority inbox.

= 2.3.1 =
Adds durable, reversible campaign similarity learning. Earlier retained moderator verdicts are imported automatically in bounded batches.

= 2.3.0 =
Adds three selectable protection modes. Review the mode after updating if legitimate readers may comment in languages other than Japanese.

= 2.2.12 =
Closes a shortened-link reward-lure bypass while preserving ordinary redirected references and quoted scam warnings.

= 2.2.11 =
Closes a compact bare-link bypass with a conservative multilingual structural rule while preserving plausible feedback and substantive link sharing.

= 2.2.10 =
Closes a compact gambling-link bypass and adds a conservative brand-independent layer for future machine-link promotion campaigns.

= 2.2.9 =
Protects possible-important comments from bulk mistakes, adds reversible spam confirmation, and keeps review counts synchronized with their filtered list.

= 2.2.8 =
Adds conservative structural detection for automated comments that disguise promotional links as neutral article recommendations.

= 2.2.7 =
Keeps reviewable Quarivo data recoverable by default during plugin deletion, adds an explicit permanent-removal choice and private JSON export, and makes confirmed-spam records immediately visible.
