=== Captain Live Chat ===
Contributors: devangvachheta
Tags: live chat, chat widget, customer service, support, real-time chat
Requires at least: 6.9
Tested up to: 7.1
Stable tag: 1.0.0
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Self-hosted live chat for WordPress. No subscription, no external servers - your conversations stay in your own database.

== Description ==

<strong>Captain Live Chat</strong> is a powerful, fully self-hosted live chat plugin for WordPress. Unlike cloud-based services such as Tawk.to, Zendesk, or Crisp, Captain Live Chat keeps every message in your own WordPress database. No monthly subscription, no external calls, no data leaving your server.

Whether you run a small business site, a support-heavy SaaS product, or an agency managing chat for multiple clients, Captain Live Chat gives you a lightweight, self-hosted inbox that works out of the box on any host.

[YouTube](https://www.youtube.com/@captaininfokit) | [X](https://x.com/captaininfokit) | [Facebook Community](https://www.facebook.com/captaininfokit/) | [Free Support](https://wordpress.org/support/plugin/captain-live-chat)

https://www.youtube.com/watch?v=cvf3FE3dkLw

<strong>💬 A Real Chat Widget, Not a Contact Form</strong>

A floating chat bubble on the front end opens into a real-time conversation: pre-chat form, quick-reply chips, typing indicators, read receipts, and a dedicated offline lead-capture screen (with configurable name/email fields) when no agent is online.

<strong>📥 Facebook Messenger–Style Agent Inbox</strong>

A modern, React-based dashboard with a thread list and chat panel side by side. Agents can toggle online/offline, get a heartbeat that stays fresh from any admin page (not just the Inbox), and go auto-away when their browser tab is hidden. Reopening a closed conversation - by the visitor or an agent - leaves a permanent, timestamped marker in the transcript, not just a temporary notice.

<strong>🔔 Notifications That Actually Reach Agents</strong>

Sound, browser push, in-app notifications (ticket reassignment, @mentions), and rate-limited email alerts make sure a new visitor message doesn't sit unseen. A separate "Unanswered message reminder" re-emails agents if a conversation still hasn't been answered after a configurable delay - including messages left through the offline lead-capture form.

<strong>👥 Role & User-Based Agent Permissions</strong>

Decide exactly who can act as a chat agent - by WordPress role (e.g. all Editors) or by picking individual users, regardless of role. Every agent's own Team Access row is protected from accidental self-lockout - you can't remove your own access or restrict your own page/action permissions, even by mistake.

<strong>📊 Built-in Analytics & History</strong>

Track chat volume, response times, and agent performance from the dashboard, with full conversation history and CSV export.

<strong>⚡ Lightweight & Shared-Hosting Friendly</strong>

Real-time-feeling updates via AJAX polling (not WebSockets), so it works on shared hosting exactly as well as on managed WordPress hosting.

<strong>Perfect for:</strong>

* Small businesses that want live chat without a monthly subscription
* Support teams who need conversation history and analytics in their own database
* Agencies managing chat for multiple client sites
* Any WordPress site that wants visitor data to stay on their own server

== Key Features ==

* 💬 <strong>Floating Chat Widget</strong> : Pre-chat form, quick-reply chips, typing indicator, read receipts, and a dedicated offline lead-capture screen
* 📥 <strong>Agent Inbox</strong> : Messenger-style thread list and chat panel, real-time polling, visitor info panel (browser, device, live current URL)
* 👥 <strong>Role & User Permissions</strong> : Grant agent access by WordPress role or by individual user, with self-lockout protection built in
* 🔔 <strong>Notifications</strong> : Sound, browser push, in-app @mentions/reassignment alerts, and rate-limited email for new and unanswered messages
* 🟢 <strong>Online Status & Auto-Away</strong> : Presence heartbeat that stays live across every admin page, automatic away when the browser tab is hidden
* 📴 <strong>Offline Experience</strong> : A configurable lead-capture screen (welcome message, optional name/email fields, custom button text) shown when no agent is online
* 🔁 <strong>Persistent Conversation Timeline</strong> : Closed/reopened events are saved permanently in the transcript - in the widget and the Inbox - not just a temporary on-screen notice
* 📊 <strong>Analytics & History</strong> : Chat volume, response times, agent performance, full history with CSV export
* 💡 <strong>Canned Replies</strong> : Quick, reusable responses for agents
* 🎨 <strong>Widget Designer</strong> : 5-step wizard - accent color, welcome screen, chat view, offline experience, and widget settings, all with a live preview
* 🔒 <strong>Self-Hosted</strong> : All conversations stay in your own WordPress database - no external calls
* ⚡ <strong>Lightweight</strong> : AJAX polling instead of WebSockets - works on any shared host

== 🌟 Our Products ==

<strong>[🥇 Captain Feed for YouTube](https://wordpress.org/plugins/captain-feed-for-youtube/)</strong> : Display customizable YouTube feeds for channels, playlists, Shorts, search results, and individual videos.

<strong>[🥇 Captain Funnel](https://wordpress.org/plugins/captain-funnel)</strong> : Automate WhatsApp messages for WooCommerce orders and form submissions using the official WhatsApp Cloud API by Meta.

<strong>[🥇 Captain Advance Filter](https://wordpress.org/plugins/captain-advance-filter/)</strong> : Create powerful filters for WordPress with advanced filtering options, flexible layouts, and easy customization.

<strong>[🥇 Captain Widgets Kit](https://wordpress.org/plugins/captain-widgets-kit)</strong> : Extend your WordPress website with a collection of powerful Elementor widgets and elements.

<strong>[🥇 Captain Social Review](https://wordpress.org/plugins/captain-social-review)</strong> : Display reviews and testimonials from multiple platforms with beautiful layouts and easy customization.

== Installation ==

1. Upload the <code>captain-live-chat</code> folder to <code>/wp-content/plugins/</code>, or install the plugin directly from the WordPress Plugins screen.
2. Activate the plugin from the <strong>Plugins</strong> screen.
3. Go to <strong>Live Chat → Settings</strong> and configure who can act as an agent.
4. Visit your site and click the chat bubble (bottom-right) to start a test conversation.
5. Return to <strong>Live Chat → Dashboard</strong>, enable "I am online", and reply.

== Source Code ==

The admin dashboard is a React application built with <code>@wordpress/scripts</code> (npm + webpack). The published <code>build/index.js</code> and <code>build/index.css</code> are the compiled output of the human-readable source (JSX/SCSS), which is publicly available at:

https://github.com/devangvachheta/captain-live-chat

To rebuild from source:

1. Clone the repository above (it includes the <code>src/</code> folder and <code>package.json</code>).
2. Run <code>npm install</code> to install dependencies.
3. Run <code>npm run build</code> to produce a fresh <code>build/index.js</code> and <code>build/index.css</code> from the <code>src/</code> source.
4. For active development with automatic rebuilds, use <code>npm run start</code> instead.

== Usage ==

After activation:

1. <strong>Set up agents</strong> - Under Settings, allow specific WordPress roles or individual users as chat agents.
2. <strong>Customize the widget</strong> - Use the Widget Settings wizard to set accent color, welcome screen, chat view, and the offline lead-capture experience.
3. <strong>Go online</strong> - Toggle "I am online" from your Profile page so visitors see an active agent.
4. <strong>Reply in real time</strong> - New visitor messages appear in the Inbox within a few seconds via polling.
5. <strong>Review performance</strong> - Check the Analytics tab for chat volume, response times, and history.

== Frequently Asked Questions ==

= Does this plugin require a paid subscription? =

No. Captain Live Chat is 100% free and self-hosted. All data stays on your server. An optional Pro add-on exists for teams that want extras like unlimited canned replies, transcript/history export, and White Label branding.

= Does it work on shared hosting? =

Yes. The plugin uses AJAX polling (not WebSockets), which works on all shared hosting providers including Hostinger, Bluehost, SiteGround, and Kinsta.

= Is data stored on your servers? =

Yes, entirely. All chat data is stored exclusively in your WordPress database. Captain Live Chat itself makes no external network calls and sends data to no third-party service.

= Does Captain Live Chat send my visitors' data anywhere? =

No. This plugin has no AI or third-party integrations of its own and makes no external network calls of any kind.

= Can multiple agents reply to chats? =

Yes. You can grant chat access by WordPress role (e.g. all Editors) or by selecting individual users. Every agent's own row in Team Access is protected - you can't accidentally lock yourself out by removing your own access or restricting your own permissions.

= What happens if no agent is online when a visitor writes in? =

The widget shows a dedicated offline screen instead of the normal welcome screen: your configured offline message, optional name/email fields, and a custom-text submit button. The message is saved as a real conversation in your Inbox just like any other, so the "Unanswered message reminder" email and normal reply flow both still apply.

= Can I customize what the offline lead-capture form asks for? =

Yes. Under Widget Settings → Offline, you can edit the welcome message, toggle the name and email fields on or off, and change the submit button text - all with a live preview.

= Will my visitors' messages be safe? =

All visitor inputs are sanitized server-side using WordPress functions. All AJAX endpoints are protected by nonces. Visitor-facing endpoints are rate-limited to prevent spam.

= Can I change the widget colours? =

Yes, through the Widget Settings wizard's Appearance step (accent color, launcher icon, position, and panel size), with a live preview on both desktop and mobile.

= Does the widget show a "Powered by Captain Live Chat" credit to my visitors? =

No, not unless you turn it on. It is off by default. If you'd like to help others discover the plugin, you can enable "Show 'Powered by Captain Live Chat' badge" under Settings → Notifications - entirely optional, and you can customize the badge text to whatever you like. It's always rendered as plain text with no external link, regardless of what text you enter.

= What happens to data when I uninstall? =

By default, your data is kept so you don't lose anything if you reinstall later. If you want a clean removal, turn on "Delete data on uninstall" in Settings before deleting the plugin - this removes all plugin database tables, options, and transients when you click Delete on the Plugins screen. A "Preserve settings on uninstall" option is also available if you want your role/notification preferences to survive a future reinstall while everything else is wiped.

= Can AI assistants manage my chats? =

Optionally, yes. On WordPress 6.9 or newer, the plugin registers a set of read/management actions as WordPress Abilities via core's Abilities API. With a separate MCP bridge plugin installed, AI assistants can use those abilities. Every ability requires the "manage_options" capability and can be individually switched on or off from the plugin's MCP page. This is entirely optional and unrelated to any third-party AI provider - the plugin itself makes no AI API calls.

== Screenshots ==

1. The floating chat widget on a live site - pre-chat greeting, quick replies, and the message thread.
2. The agent Inbox - thread list, active conversation, and visitor info panel side by side.
3. Knowledge Base - add links or upload documents for your team's own reference.
4. Analytics dashboard - chat volume, response time, and resolution rate at a glance.
5. Widget Settings wizard - accent color, welcome screen, offline experience, and a live preview.

== External Services ==

Captain Live Chat makes no external network calls of any kind. Every feature (widget, inbox, notifications, analytics, canned replies, knowledge base storage) runs entirely on your own WordPress database, and no visitor or site data is sent to any third-party server.

== Changelog ==

= 1.0.0 =
* First stable release.
* Self-hosted floating chat widget - pre-chat form, quick-reply chips, typing indicators, read receipts, and an offline lead-capture screen shown when no agent is online.
* Messenger-style agent Inbox with real-time polling and a visitor info panel.
* Role- and user-based agent permissions with self-lockout protection.
* Sound, browser, in-app, and email notifications with an unanswered-message reminder.
* Analytics & History with CSV export.
* Canned Responses.
* 5-step Widget Settings wizard with a live preview.
* MCP / Abilities-API support for AI assistants.
* Permanently persisted closed/reopened markers in the conversation timeline.
* Pro add-on hooks present for unlimited Canned Responses, transcript/history export, and White Label branding.

== Upgrade Notice ==

= 1.0.0 =
First stable release.
