=== WPClientFeedback ===
Contributors: wbicg
Tags: feedback, comments, collaboration, review, block editor
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Pin threaded change suggestions to page elements — on the live front-end and inside the block editor, right where the fix happens.

== Description ==

WPClientFeedback lets your team leave change suggestions attached to the exact content they concern:

* **Pin comments on the live site.** Turn on feedback mode from the admin bar, click any content block — an image, a paragraph, a heading — and leave a suggestion. Pins float over the page exactly where the feedback belongs.
* **See feedback in the block editor.** Blocks with open suggestions are outlined and badged in the editor. Open the Feedback sidebar to read the thread, reply, and mark it resolved — without leaving the surface where you make the fix.
* **Threaded conversations.** Team members reply to each other inside each pinned thread. Threads are open or resolved.
* **A dashboard that shows where the work is.** The Feedback admin page ranks pages and posts by open suggestions so nothing gets lost.

Anchors are durable: they survive block reordering, content edits, revisions and copy/paste. When content changes so much that a pin can no longer find its block, the thread lands in an "Unattached comments" tray instead of disappearing.

Feedback is visible only to logged-in users who can edit the post in question. No data leaves your site.

== Frequently Asked Questions ==

= Who can see and leave feedback? =

Only logged-in users who can edit the post (Editors and Administrators by default; Authors and Contributors on their own posts). Site visitors never see pins, comments, or any feedback markup. Developers can change the required capability with the `wbifb_required_capability` filter.

= Does it work with my theme? =

Yes. The front-end overlay renders in an isolated shadow DOM, so theme styles can't break it and it can't break your theme. Both block themes and classic themes are supported; content must be built with the block editor.

= Does it modify my content? =

When a thread is pinned, a small ID is stored in the block's `metadata` attribute (the same mechanism WordPress core uses for block Notes). It is invisible on the front-end and in the editor, and the plugin never rewrites content it cannot reproduce byte-for-byte.

= What happens when I delete the plugin? =

Uninstalling removes the plugin's database tables and options completely.

== Screenshots ==

1. Pinning a suggestion to an image on the live front-end.
2. Blocks with open feedback flagged in the block editor.
3. The Feedback sidebar with a threaded conversation.
4. The dashboard ranking pages by open suggestions.

== Changelog ==

= 1.1.0 =
* Notifications control surface: every email has its own switch, editable subject and body, extra recipients, a send log and a test button under Settings.
* Built on the shared WBI notifications library. Pro 1.1.0 or newer is required for Pro notification features.

= 1.0.4 =
* Automatic updates: the plugin now checks updates.wbicg.com and offers new versions through the normal WordPress updater.

= 1.0.3 =
* Fix: opening the block editor before the canvas iframe finished loading crashed the feedback sidebar ("wbifb-feedback cannot be rendered"). The badge overlay now waits for the canvas document to be ready instead of assuming it is.

= 1.0.2 =
* Fix: upgrading from the plugin's previous slug (wbi-feedback) now runs the schema migrations and takes the pre-migration snapshot. Activation previously stamped the current schema version without migrating, leaving the share-token expiry column at its old NOT NULL shape and permanently blocking the upgrade path.
* Fix: snapshots written under the old wbi-feedback-backups/ directory are adopted into the new backups directory and re-registered, instead of being silently dropped from the restore list.

= 1.0.0 =
* Full-width bottom banner replaces the corner toolbar on the front end: "+ Add comment" and "Approve this page" (Pro) centered, WPClientFeedback branding at the side, utility toggles at the right. The banner reserves space so it never covers page content.
* Dark and light overlay themes (Settings → Appearance). Dark (default) keeps the current chrome with a white banner; light inverts to light chrome with a dark banner.
* The side panel is back: a "Feedback" button in the banner opens a docked, resizable panel listing every thread with element-type chips, status filter, viewport/device line, reply counts, and the unattached tray — replies, resolution state and reopening are all visible without hunting pins.
* Review queue: guests opening a review link (and team members) see the pages covered by their access that still have open feedback or await approval, right in the panel.
* Review-link expiration moved into the creation flow: pick 7/14/30/90 days, a custom length, or Never when creating a link (admin and editor), and extend any existing link. The old site-wide setting now only seeds the default.
* Settings save automatically — change anything and it saves after a beat, with a "Saving… / Saved" indicator and an unsaved-changes warning if you close mid-save. The Save buttons are gone (Pro license activation stays explicit).
* Element-type chips and filtering in the block-editor Feedback sidebar, with per-type counts — plus the viewport/device line on every thread row.
* Viewport and device metadata now shows in the dashboard table under each comment.
* Inline assignee editing on the Overview table (Pro), a selection column with select-all, and bulk "Assign to" including all threads matching the current filters.
* Data repair: legacy seeded threads that showed a gray "Other" chip are backfilled to their real element category (schema v7).
* Pro 1.0.0 ships alongside with auto-assignment rules, notification routing/watchers, the team queue, and real license activation.

= 0.10.0 =
* Breaking: the plugin's internal identity moved to the wpclientfeedback slug — main file is now wpclientfeedback.php, the text domain is wpclientfeedback, the REST namespace is wpclientfeedback/v1, and the admin page URL is admin.php?page=wpclientfeedback. Existing installs under the old wbi-feedback folder must be replaced (deactivate and delete the old copy, install this one); feedback data and settings are unaffected because database tables and options keep their existing names.
* The plugin and Pro links now point at wpclientfeedback.com.
* The sidebar menu-label style is attached to the core admin-menu stylesheet instead of being printed directly.

= 0.9.2 =
* The admin menu item and the dashboard heading now say WPClientFeedback instead of the generic "Feedback".
* The "Powered by WPClientFeedback" credit in the comment composer now shrinks and wraps inside narrow popovers instead of widening the card or spilling past its edge.

= 0.9.1 =
* Renamed to WPClientFeedback (WPClientFeedback Pro for the add-on), replacing 0.9.0's short-lived WP-Feedback name. Slugs, settings and data are untouched — existing installs update in place.

= 0.9.0 =
* The plugin was renamed WP-Feedback (superseded by WPClientFeedback in 0.9.1). Slugs, settings and data untouched.
* The Feedback Overview now opens as the flat (ungrouped) thread list; group by any column with its ▤ toggle. Saved links with an explicit grouping still open grouped.
* The dashboard footer credit now shows the actual plugin version ("Powered by WPClientFeedback v0.9.0"), so it can't be confused with the WordPress version WordPress prints beside it.
* The comment composer on the front-end overlay shows a small "Powered by WPClientFeedback" credit in the empty space left of the buttons (removed by Pro white-label, like all branding).

= 0.8.9 =
* The Element column no longer says the same thing twice: the block's technical name only shows when it differs from the category chip (no more "text Text"; "element Layout" still shows both).

= 0.8.8 =
* Groupings now render inside the one thread table: group headers are collapsible rows in the table body, so grouping by Page, Commenter, Status or Assignee (or clearing the grouping) never swaps the layout. Page groups keep their counts, type chips, approval state and actions in the group row.
* Columns size to their content, and every column header has a drag handle to resize it (double-click a handle to reset; widths are remembered per browser).
* The Page / Post column gained its own filter select, replacing the "Page #N" toolbar pill — every filterable column now filters from its header.
* The Pro Assignments and People tabs merged into one People & Assignments tab; old tab links land on the merged tab.

= 0.8.7 =
* Table layout cleanup: the thread list scrolls horizontally instead of columns colliding, column widths are stable, and header filters/toggles no longer overlap neighboring columns.
* Replies and Updated columns are now sortable (server-side; new reply_count ordering on the browse endpoint).
* Page groups show their total thread count in the header, and the post-type filter buttons are gone — sorting and counts cover that job.

= 0.8.6 =
* Grouping now lives on the columns themselves: each groupable column header (Page/Post, Commenter, Status, Assignee with Pro) has a ▤ toggle, and a "Grouped by: X ✕" toolbar pill shows and clears the active grouping. The grouping subnav is gone — one panel, one model.
* The Assignee column now always appears; without Pro it is greyed out as "Assignee (Pro)".
* The admin menu icon is now the thumbs-up dashicon.

= 0.8.5 =
* The Overview tab is now "Feedback Overview" with a subnav of grouping lenses (Pages, Commenters, Status, Assignees — Pro, All threads) instead of a Group-by dropdown.
* Thread filters moved into the table column headers (element, commenter, status — plus assignee with Pro) and persist across every lens; the column a group is constrained by locks its filter. With Pro active the thread list gains an Assignee column.

= 0.8.4 =
* The Overview tab is now one grouped thread list instead of separate Pages/Threads views: group by Page (default — collapsed groups reproduce the old dashboard, with counts, approval state and actions on each group header), Commenter, Status, or no grouping for the flat list. Expanding a group loads its threads in place.
* Group by Assignee is a Pro lens (greyed without a license); type chips on a page group now expand that group filtered to the chip's element type.
* Old ?tab=dashboard and ?tab=browse links map to the equivalent grouping.

= 0.8.3 =
* Dashboard and All feedback are now one "Overview" tab with a Pages / Threads switcher; old ?tab=dashboard and ?tab=browse links still land on the right view.
* The Threads view gains an Assignee filter (functional with Pro, shown greyed as "Assignee (Pro)" without) and the Pages view shows a greyed "Approvals (Pro)" control, so Pro capabilities are visible in place.
* The email-notifications setting now includes a callout describing Pro's notification upgrades, linking to the Notifications overview.

= 0.8.2 =
* Fresh installs now seed a draft sample page with three example feedback threads (one open with a guest reply, one resolved, one assigned with a due date), so the Dashboard and All-feedback tabs demonstrate themselves. Sites with existing feedback never get samples; delete the sample page to remove them.
* The Review links tab now uses the same "(Pro)" locked-tab treatment as the other Pro teasers while the add-on is inactive.

= 0.8.1 =
* The Feedback admin page now shows what the Pro add-on offers while it is inactive: locked Assignments/People/Notifications tabs with feature overviews, and an "Upgrade to WPClientFeedback Pro" panel in Settings. Everything disappears once a license is active.

= 0.8.0 =
* Notification emails now include a short "Sent by WPClientFeedback" footer, and the overlay toolbar shows a small "WPClientFeedback" credit (Pro white-label can replace or remove both).
* New extension seams for add-ons: context-aware permission filters (view/comment/resolve/manage), post-type support filter, frontend/editor config filters, comment-composer completers, a comment-content render filter, and new `wbifb_thread_assigned` / `wbifb_thread_due_date_changed` actions.
* The browse endpoint now reports who resolved each thread.
* Multisite: uninstalling now cleans up every site (and no longer leaks the snapshot options on single sites); the admin-bar feedback mode is per-site on networks.

= 0.7.0 =
* WPClientFeedback is now free core + paid Pro add-on. Guest review links (creation, claimed-by, the Review links tab) now require the WPClientFeedback Pro add-on with an active license; internal team feedback remains fully free. Sites using guest links must install Pro before updating, or review links stop working until they do.
* Extension points for add-ons: admin tabs, settings panels, and overlay toolbar items are pluggable; overlay colors use CSS custom properties.
* Threads support assignees and due dates (schema v6, additive with automatic pre-migration snapshot); management UI ships in Pro.
* Dashboard rows can carry an approval state (populated by Pro's page sign-off feature).

= 0.6.0 =
* Review link URLs are now retrievable: copy any active link's URL from the Review links tab at any time (the raw token is stored alongside its hash — appropriate for this tool's threat model). Links created before 0.6.0 remain unrecoverable; revoke and recreate them.
* Review links tab: status filter (Active by default / Expired / Revoked / All) and permanent Delete for revoked or expired links (with confirmation). Deleting a link never touches the comments made through it.
* Database schema v5 (stores the raw token). Additive and automatic, with the usual pre-migration snapshot.

= 0.5.0 =
* New Review links tab on the Feedback admin page, always visible: create labeled site-wide links, see every link's scope, status and who has claimed it, and revoke — with guidance that the intended use is one review link per reviewer. When guest links are turned off the tab explains how to enable them.
* Guest comments now record which review link they came through (server-verified), which powers the claimed-by display and future per-link reviewer identity.
* Settings reorganized: the Guest review links panel keeps the on/off toggle and expiry but now jumps to the Review links tab instead of creating links inline; the Backup & restore and Data panels are merged into one "Data & backup" panel.
* Database schema v4 (adds a link reference to feedback rows). The upgrade is additive and automatic, and a snapshot of all feedback is written before it runs.

= 0.4.1 =
* Guest commenters are now asked for first AND last name, so different guests who share a first name stay distinguishable in the commenter filter. Guests who previously stored a single name are asked to complete it on their next comment. No database changes.

= 0.4.0 =
* New "All feedback" tab on the Feedback admin page: browse individual threads across the whole site, filtered by status, element type (text/media/buttons/layout/other), commenter, and page — with server-side pagination.
* The element-type chips on the Dashboard tab are now clickable and jump straight into the filtered browse view for that page.
* "View in context" deep links: opening a thread from the admin lands on the page with that thread popped open and scrolled into view.
* Backup & restore in Settings: export all feedback to a JSON file, import it back (restores missing items only — never overwrites), and manage on-disk snapshots (create one manually, restore, download, delete).
* A snapshot is written automatically to wp-content/uploads/wpclientfeedback-backups/ before any database schema migration; the newest 5 automatic snapshots are kept.
* No database changes in this release; existing feedback is preserved across updates.

= 0.3.1 =
* Feedback mode now stays on as you move between pages, instead of resetting on each navigation.
* Schema upgrades apply on every request (front-end and REST, not just wp-admin), so an update never leaves a page hitting a table that is missing a new column. No database changes in this release; existing feedback is preserved across updates.

= 0.3.0 =
* Guest review links can now be site-wide (admin) as well as per-page; create them from the dashboard or editor, list and revoke from Settings.
* Element-type breakdown on the dashboard — see at a glance which pages are text edits vs image/layout work; included in CSV export.
* Feedback lists and pins are ordered by position on the page, not by when they were added.
* Yellow (open) / green (resolved) colour coding on pins, cards, editor block outlines and badges.
* Reopening a resolved thread now requires adding a comment.
* Front-end streamlined to a pop-out view — each comment opens beside its pin; toolbar is just Add comment and Show/Hide resolved; the hovered/selected element is outlined; click-away closes the pop-out.
* Editor: clickable block badges, a "Show resolved on blocks" toggle, and a more compact comment list (avatars removed).
* Reliability: fixed badge markup that could leak into saved content, fingerprint parity for image blocks, timezone-correct timestamps, and page-jump from the comment list; overlay pages send no-cache headers.

= 0.2.0 =
* Guest review links: share a page with clients for commenting — no account needed, revocable, rate-limited.
* Email notifications for new feedback, replies and resolutions.
* Settings screen: access capability, notifications, guest links, data retention.
* Comment editing and reply deletion; re-pin orphaned threads on both surfaces.
* Self-healing anchors in the editor; live duplicate cleanup; auto-refreshing threads.
* Pins capture viewport and browser context; dashboard adds search, filters, stale flags, CSV export; admin-bar count and dashboard widget.

= 0.1.0 =
* Initial release: front-end pinning overlay, block editor sidebar and block flags, threaded comments with open/resolved workflow, feedback dashboard.
