=== Collaborative Post Notes ===
Contributors: mahdirahani
Tags: notes, collaboration, comments, team, editorial
Requires at least: 5.5
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A lightweight, threaded internal notes system for WordPress posts, pages, and custom post types. Perfect for editorial teams, content creators, and multi-author websites.

== Description ==

**Collaborative Post Notes** is a simple but powerful internal communication tool for WordPress teams.
It adds a clean, threaded note system inside the post/page editor, allowing editors, authors, and content teams to communicate directly while working on content — with **no external tools** (Telegram, WhatsApp, etc.) needed.

This plugin improves your **editorial workflow**, reduces miscommunication, and keeps all discussions connected to the content they belong to.

### Why use Collaborative Post Notes?
Managing content in a team often leads to scattered messages across multiple platforms.
This plugin solves that problem by keeping all notes, replies, and discussions **inside WordPress**, right inside the editor.

### Key Features
- **Instant AJAX notes** — add notes without saving/updating the post
- **Threaded (nested) notes** — reply inside discussions like a mini comment system
- **Resolve / unresolve notes** — mark discussions as handled
- **@mentions** — mention teammates with autocomplete
- **Email notifications** — mentioned users receive an email with a link to the post
- **Delete notes** — authors can delete their own notes; editors can delete any note
- **Custom post type support** — enable notes on any public post type from Settings
- **Internal-only** — notes never appear on the frontend
- **Lightweight** — uses minimal database space, optimized for speed
- **Auto-recorded username & timestamp**
- **Block editor compatible** — works in the WordPress block editor and WordPress 7

### Ideal For:
- Editorial teams
- Multi-author blogs
- News websites
- Agencies with content workflows
- SEO/content strategy teams
- Anyone who collaborates inside WordPress

### How It Works
1. Open any supported post, page, or custom post type
2. Scroll to the **Team Notes** metabox
3. Add a top-level note or reply to existing ones
4. Mention teammates with `@username`
5. Resolve notes when done
6. Notes save instantly via AJAX

### Private & Secure
These notes are **not public, not accessible through template files**, and never appear on the frontend.

---

== Installation ==

1. Upload the plugin to `/wp-content/plugins/`
2. Activate it in **Plugins > Installed Plugins**
3. Optional: go to **Settings > Post Notes** to enable custom post types
4. Open any post and scroll to **Team Notes**
5. Start collaborating!

No other configuration is required.

---

== Screenshots ==

1. Threaded notes inside the post editor
2. Replying to a message
3. Adding new top-level notes

---

== Frequently Asked Questions ==

= Are the notes visible on the frontend? =
No. Notes are strictly internal and cannot be displayed publicly.

= Does the plugin work with custom post types? =
Yes. Go to **Settings > Post Notes** and enable the post types you want.

= Do I need to update/save the post to save a note? =
No. Notes are saved instantly with AJAX.

= How do mentions work? =
Type `@username` while writing a note or reply. Matching users appear in an autocomplete list. Mentioned users who can edit the post receive an email notification.

= Can I delete a note? =
Yes. You can delete your own notes. Users with permission to edit others' posts can delete any note.

= Does this slow down my website? =
No. The plugin is extremely lightweight and optimized.

= Can I export or migrate notes? =
Not yet, but planned for future releases.

---

== Changelog ==

= 1.1 =
* Add instant AJAX note saving without updating the post
* Add delete note support
* Add custom post type support with settings page
* Add @mentions with autocomplete
* Send email notifications to mentioned users
* Add resolve / unresolve note status
* Fix revision/autosave edge cases from legacy save handler
* Migrate legacy notes to stable note IDs automatically
* Mark metabox as block editor compatible for WordPress 7
* Register post meta with auth callback

= 1.0 =
* Initial release.
