=== AddonLogic Live Comment Count ===
Contributors: snehalpancholi
Tags: comments, comment count, live, ajax, real-time
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Displays a live-updating comment count for any post via a shortcode — no page reload required.

== Description ==

AddonLogic Live Comment Count embeds a comment counter anywhere on a page that automatically refreshes itself using a lightweight AJAX request at a configurable interval.

Place the shortcode inside a post, page, or widget to show a count like "12 Comments" that updates silently in the background. The count can optionally link to the `#comments` section.

= Features =
* Shortcode `[addlc_lcc_count]` — works in posts, pages, widgets, and block editor HTML blocks
* Configurable poll interval (10–300 seconds)
* Custom text for zero, singular, and plural counts via `{count}` placeholder
* Optional link to `#comments` anchor
* Nonce-protected AJAX endpoint
* Graceful silent failure — stale count shown if AJAX fails
* Minimal CSS transition on update

== Installation ==
1. Upload the `live-comment-count` folder to `/wp-content/plugins/`.
2. Activate via **Plugins → Installed Plugins**.
3. Go to **Settings → Live Comment Count** to configure texts and interval.
4. Add `[addlc_lcc_count]` to any singular post or page.

== Shortcode ==

    [addlc_lcc_count post_id="" class=""]

| Attribute | Default        | Description                                        |
|-----------|----------------|----------------------------------------------------|
| post_id   | current post   | Override which post's count is displayed           |
| class     | (empty)        | Extra CSS class added to the wrapper `<span>`      |

== Frequently Asked Questions ==

= Does this update in real time? =
It polls the server every N seconds (configurable). There is a small delay equal to the interval, not true WebSocket real-time.

= Is the AJAX endpoint secure? =
Yes. Every request is verified with a WordPress nonce (`wp_verify_nonce`). Only published posts return a count.

= Can I display a different post's count from inside another post? =
Yes, use the `post_id` attribute: `[addlc_lcc_count post_id="42"]`.

== Changelog ==

= 1.0.0 =
* Initial release.

== Screenshots ==

1. A comment count label updating live on a blog post.
2. Settings page — poll interval and text templates.
