=== Daytime Notes ===
Contributors: muzoid
Tags: notes, collaboration, annotations, client feedback, visual feedback
Requires at least: 5.9
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 0.9.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Attach collaborative notes to specific elements on WordPress pages and posts for review, feedback, and task tracking.

== Description ==

Daytime Notes lets authorised users attach notes to specific elements on any page or post. Notes are context-aware, threaded, and support @mentions, task status, and optional email notifications.

This plugin is designed for internal collaboration: content review, QA, design feedback, and coordinating changes without long email threads.

Daytime Notes was created to address a common communication gap when working with clients and teams — particularly when feedback arrives as vague or fragmented requests that are hard to interpret out of context. Having previously used similar element-based annotation systems, the goal was to bring that clarity into WordPress as a standalone, builder-agnostic tool. By attaching feedback directly to the page elements being discussed, Daytime Notes helps reduce confusion, save time, and keep discussions grounded in the actual content being worked on. It’s shared publicly to support other developers, designers, and teams facing the same challenges.

= Core Features =

* **Element-Specific Notes** - Attach notes to any HTML element with visual highlighting
* **Threaded Conversations** - Reply to notes and keep discussions in context
* **@Mentions** - Mention users with @username to assign responsibility
* **Task Status** - Mark notes as completed or reopen them to track progress
* **Email Notifications** - Manual "Send Notifications" button plus an automatic 4-hour catch-all; notifications are held until a recipient opts in, then delivered as one summary email
* **Character Limits** - Admin-configurable per-note character limit
* **Reviewer Role** - A front-end-only "Daytime Notes Reviewer" role for clients, with no access to wp-admin
* **Anyone-Can-Complete Toggle** - Optionally let any user complete unassigned notes

= Notes About Email Notifications (Opt-in) =

Email notifications are conservative by default — nothing is sent instantly:

* New notes, replies, and completions are queued as they happen.
* Pending notifications can be sent immediately at any time using the **Send Notifications** button in the panel.
* Pending notifications are also sent automatically every 4 hours as a catch-all.
* Notifications are only ever sent to a user who has Daytime Notes enabled on their profile — if disabled, the notification stays queued and is delivered as a summary email as soon as they re-enable it.

All emails use WordPress `wp_mail()`. No third-party email service is used unless your site is configured to route mail externally.

= Privacy & Data Handling =

* No external API calls
* No tracking or analytics
* No telemetry
* No third-party services
* localStorage is used only for UI preferences
* All plugin data is stored within your WordPress database

The documentation includes a clear list of stored data and practical steps for removing plugin data when needed.

== Installation ==

1. Upload the `daytime-notes` folder to `/wp-content/plugins/`
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Create a user with the "Daytime Notes Reviewer" role (or use existing Editor/Admin)
4. Send them login details - they're ready to leave notes!

**That's it!** No configuration needed for basic use. Visit any page, click **Daytime Notes** in the admin bar, and start adding feedback.

**Optional:** Go to **Settings > Daytime Notes** to configure email notifications, the note character limit, and the "anyone can complete" toggle. These are all optional - the plugin works great without them for simple developer-client workflows.

== Frequently Asked Questions ==

= Do I need to configure settings to use the plugin? =

No! Install, activate, and you're ready to go. All settings are optional extras for larger teams. For a simple developer-client setup, just create a reviewer account and start leaving notes. The only "must do" is ensure users have the right role to access notes.

= Do I need to use @mentions or email notifications? =

No. These are optional features. Without @mentions, notes are general feedback anyone can see. Without email notifications, people just check notes manually when they log in. Perfect for small teams or solo developers working with clients.

= Who can see the notes? =

Only logged-in users with the `use_daytime_notes` or `edit_posts` capability, and with Daytime Notes enabled on their profile, can see notes. Assign users the "Daytime Notes Reviewer" role for client access without giving them any editing permissions.

= Can I disable email notifications? =

Yes. Email notifications can be turned off entirely in **Settings > Daytime Notes**. Notifications are also only ever delivered to a user who has Daytime Notes enabled on their own profile.

= Why do notification emails sometimes take a while to send? =

Daytime Notes hands emails off to WordPress's built-in `wp_mail()` and waits for that call to complete before confirming the send. The plugin doesn't talk to any mail server directly — actual delivery speed depends entirely on your host's mail setup (PHP's `mail()` function, sendmail/postfix, or whatever SMTP service your site uses). Variable delays, especially occasional 10-20+ second sends, are almost always caused by that transport doing a fresh DNS/MX lookup and SMTP handshake for each message, not by the plugin. If this happens consistently, installing an SMTP plugin (e.g. WP Mail SMTP, FluentSMTP) configured with a transactional email provider (SES, Mailgun, Postmark, etc.) typically resolves it, since those reuse a fast authenticated connection instead of connecting fresh each time.

= What happens to my data if I uninstall the plugin? =

By default, notes and settings are preserved in the database. You can opt in to full data removal in **Settings > Daytime Notes > Data Management**. Full removal is permanent.

**Important:** When the plugin is uninstalled, users with the "Daytime Notes Reviewer" role are automatically reassigned to the Subscriber role. This prevents users from being assigned to a role that no longer exists. If you want to delete reviewer accounts entirely, do so manually before uninstalling.

= Isn't this the same as WordPress's built-in Notes feature (added in 6.9)? =

No. Core's Notes are block-level comments for people editing inside Gutenberg — private to the editor, never shown on the live site. Daytime Notes is for feedback from people who aren't editing at all: a client or reviewer looking at the finished, live page, with any page builder, no editor access required.

= Does this plugin work with page builders? =

Yes. Daytime Notes works with any theme or page builder output (Elementor, Bricks, Breakdance, Oxygen, Gutenberg, etc.) because notes attach to rendered HTML elements on the page.

= What happens if the page element is removed or changed? =

Notes remain visible in the notes panel even if the original element is no longer present. The stored selector remains available for reference.

= Is Daytime Notes checked for security issues before release? =

Yes. Every build goes through two separate checks before release: the official WordPress Plugin Check tool, and a dedicated security review focused on logic-level issues including broken access control, privilege escalation, and insecure direct object references.

== Screenshots ==

1. Notes panel showing threaded conversations and assignments
2. Assigning the Daytime Notes Reviewer role to a user, with the anyone-can-complete notification setting
3. Email notification showing mentions grouped by page
4. Creating a note with an @mention and character limit

== Changelog ==

= 0.9.1 =
* Fixed: The plugin version constant was left at a stale pre-launch value, showing the wrong version on the Settings page and affecting asset cache-busting
* Fixed: @mentions and "Assigned to" labels could show a user's raw username instead of their configured WordPress display name
* Fixed: Notification email footer text could read as a duplicated site/plugin name
* Fixed: The notes panel's resize handle could become unreachable behind the notes list's own scrollbar; header layout also improved

= 0.9.0 =
* Version numbering restarted at 0.9.0 to mark the actual product launch — Free and Pro now ship from one shared codebase and version independently from here on. Previous versions (1.0.0–1.7.14) were this plugin's pre-launch personal-project history, only ever installed on test sites
* Added: Free (daytime-notes.php) and Pro (daytime-notes-pro.php) editions, sharing core functionality with Pro-only features split into their own files
* Added: Custom "Daytime Notes Reviewer" accounts are redirected out of wp-admin to the front end, with no "Dashboard" link shown in the admin bar
* Added: Free's settings page includes a permanent, non-dismissible line pointing to Daytime Notes Pro
* Added: Activating Pro over an active Free install automatically deactivates Free, safely migrates existing data, and shows a one-time confirmation notice
* Added: Changelog entries can be tagged Free/Pro-only — the in-admin Changelog tab shows only what's relevant to the installed edition

== Privacy Policy ==

Daytime Notes stores data in your WordPress database, including:

* Note content and selectors
* Page IDs/URLs for context
* User IDs (authors and assignments)
* Timestamps
* Plugin settings and user preferences

Daytime Notes does NOT:

* Send data to external servers
* Use tracking or analytics
* Make external API calls
* Share data with third parties
* Set tracking cookies

Emails (if enabled) are sent using WordPress `wp_mail()`, which respects any SMTP plugins or mail configuration on your site.

To support privacy requests and data deletion, administrators can:

* Delete notes (via the Daytime Notes panel on relevant pages)
* Remove plugin user meta/preferences as needed
* Enable full data removal on uninstall in **Settings > Daytime Notes > Data Management**

== Support ==

For issues, questions, or feature requests:

* Review the plugin documentation (if provided with your install)
* Check browser console/debug logs for technical issues
* Contact your site administrator or development team