=== AddonLogic Comment Policy Notice ===
Contributors: snehalpancholi
Tags: comment policy, comment form, comments, notice, policy
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

Display a fully styled, editable comment-policy notice above or below the comment form — with collapsible support, icon picker, colour controls, and a live admin preview.

== Description ==

**AddonLogic Comment Policy Notice** lets you publish a clear, well-styled comment policy on every post or page that has an open comment form — with zero code required.

**Key Features:**

* WYSIWYG editor (wp_editor) for rich-text policy content
* Choose position: above the comment form or below the "Leave a Reply" title
* "Always visible" or "Collapsible (click to expand)" display modes
* Configurable header title (displayed when using a collapsible or header bar)
* Icon picker: None, Info (ℹ), Warning (⚠), or Checkmark (✓)
* WordPress colour-picker for background and border colours
* Border style: left accent bar or full border on all sides
* Live admin preview — changes update instantly as you type
* Reset to Defaults button
* Shortcode `[comment_policy]` to embed the notice anywhere
* Loads CSS/JS only on singular posts/pages where comments are open
* Fully accessible: ARIA attributes, keyboard-navigable toggle button
* Dark-mode friendly via CSS custom properties
* Mobile-first responsive layout
* GPL-2.0+ licensed

== Installation ==

1. Upload the `comment-policy-notice` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Go to **Comments › Comment Policy** to configure your notice.
4. The notice will automatically appear on all posts/pages with open comment forms.

== Frequently Asked Questions ==

= How do I embed the notice inside a page or post? =
Use the shortcode `[comment_policy]` anywhere in your content.

= Can I style the notice to match my theme? =
Yes. The background colour, border colour, and border style are all configurable from the settings page. Advanced users can add custom CSS targeting `.cpn-notice`.

= Will this slow down my site? =
No. The CSS and JS are only loaded on singular posts/pages where comments are open. The collapsible JS file (~1 KB) is only enqueued when the collapsible display style is active.

= What happens if I uninstall the plugin? =
The `addlc_cpn_options` option and update cache transient are deleted. No custom database tables are created.

= Can I use HTML in the policy text? =
Yes. The WYSIWYG editor allows the same HTML tags as WordPress post content (via `wp_kses_post`).

= Where does the notice appear? =
You can choose from the settings page: "Above comment form" places it before the entire `<form>` element; "Below comment title" places it after the "Leave a Reply" heading.

== Screenshots ==

1. Settings page with live preview panel on the right.
2. Comment policy notice displayed above the comment form — left accent bar style.
3. Collapsible notice in its collapsed state.
4. Collapsible notice in its expanded state.
5. Full border style with warning icon.

== Changelog ==

= 1.0.0 =
* Initial release.
* WYSIWYG policy text editor.
* Position, display style, icon, colour, and border controls.
* Live admin preview.
* Collapsible toggle with ARIA support.
* Shortcode `[comment_policy]`.
* AddonLogic update server integration.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
