===  AddonLogic Featured Pinned Comments ===
Contributors: snehalpancholi
Tags: comments, featured comments, pinned comments, comment badge, comment management
Requires at least: 6.0
Tested up to: 6.7
Stable tag: 1.0.0
Requires PHP: 8.1
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Let admins mark comments as featured so they render pinned at the top with a configurable badge.

== Description ==

**AddonLogic Featured Pinned Comments** gives editors and administrators a simple, reliable way to highlight the best comments on every post or page.

Mark any comment as "featured" directly from the Comments admin list using a single star-icon click — no page reload needed.  Featured comments automatically float to the top of the thread on the front end, above all regular comments, and each one displays a fully customisable badge next to the author's text.

**Key features:**

* **One-click star toggle** in the admin comments list — no page reload.
* **Edit Comment checkbox** for marking a comment featured from its dedicated edit screen.
* **Automatic reordering** — featured comments are moved to the top of the comment thread via the `comments_array` filter; they are sorted oldest-first among themselves.
* **Configurable badge** — change the label, background colour, and text colour from the settings page.
* **Max pinned limit** — cap how many comments can be pinned at once (0 = unlimited).
* **CSS class hook** — every featured comment `<li>` receives the `addlc-fpc-featured` class for custom theme styling.
* **CSS variables** — public stylesheet exposes `--fpc-badge-bg`, `--fpc-badge-color`, and more for theme-level overrides.
* **Dark mode ready** — admin and public styles both include `prefers-color-scheme: dark` media queries.
* **Accessibility** — ARIA `aria-pressed` state on toggle buttons; screen-reader text on every interactive element.
* **Automatic updates** — fetches updates from the AddonLogic update server so you always stay current without a marketplace account.

== Installation ==

1. Upload the `featured-pinned-comments` folder to `/wp-content/plugins/`.
2. Activate the plugin through **Plugins > Installed Plugins**.
3. Visit **Comments > Featured Comments** to configure the badge appearance and pinning limits.
4. Go to **Comments** in the admin — a new star-icon column appears. Click any star to feature that comment instantly.

== Frequently Asked Questions ==

= Where do I change the badge text or colour? =

Go to **Comments > Featured Comments** in your WordPress admin. The settings page includes a live preview that updates as you type.

= How do I feature a comment? =

From the **Comments** admin list, click the star icon (☆) in the **Featured** column on any comment row. The star turns solid (★) and the comment is immediately pinned. You can also tick the checkbox on the **Edit Comment** screen.

= How many comments can I pin at once? =

By default, up to 5 comments can be pinned per post. You can change this limit under **Comments > Featured Comments**. Set it to 0 to allow unlimited pinned comments.

= Will the plugin slow down my site? =

No. Comment reordering happens in PHP using the `comments_array` filter — it does not add any database queries. The public stylesheet is loaded only on singular posts and pages where comments are enabled.

= How are featured comments ordered among themselves? =

Featured comments are sorted by their original publication date (oldest first). This ensures your oldest featured comment always appears at the very top.

= What happens when I delete the plugin? =

The uninstall routine removes the `addlc_fpc_options` option and deletes the `_fpc_featured` meta value from every comment so your database stays clean.

= Is this compatible with WooCommerce product reviews? =

Yes — WooCommerce product reviews use WordPress's standard comment system, so the plugin works with them automatically.

= Can themes override the badge styles? =

Yes. The public stylesheet exposes several CSS custom properties (`--fpc-badge-bg`, `--fpc-badge-color`, `--fpc-badge-radius`, `--fpc-border-color`, `--fpc-bg-highlight`) that themes can override at the `:root` level.

== Screenshots ==

1. Admin comments list with the Featured star-toggle column.
2. Edit Comment screen showing the Featured meta box.
3. Settings page with live badge preview.
4. Front-end view: featured comments pinned at the top with badge.

== Changelog ==

= 1.0.0 =
* Initial release.
* Star-icon AJAX toggle in the admin comments list.
* Featured meta box on the Edit Comment screen.
* `comments_array` filter to pin featured comments to the top.
* Configurable badge (text, background colour, text colour).
* Maximum pinned comments limit.
* CSS class `addlc-fpc-featured` on featured comment list items.
* Dark mode and responsive styles.
* AddonLogic auto-update integration.
