=== Small Business Chatbot ===
Contributors: arthurc7
Tags: chatbot, ai, small-business, lead-generation, customer-support
Requires at least: 5.8
Tested up to: 7.0
Stable tag: 1.1.1
Requires PHP: 7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Securely connect your Small Business Chatbot account and add its AI chat widget to your WordPress site.

== Description ==

Small Business Chatbot helps small businesses answer visitor questions, capture leads, and send conversation summaries to their team.

Activating the plugin does not create an account, scan your website, or add a widget. A WordPress administrator must explicitly create a platform account or connect an existing account. The widget loads only after that secure connection finishes successfully.

### Key features

* AI answers based on your approved business content.
* Lead capture and conversation notifications.
* Widget appearance, knowledge, and behavior controls in the Small Business Chatbot platform.
* Explicit, administrator-only account connection.
* A plan-limited website scan queued after connection: 20 pages on Self Serve and up to 3,000 pages on Managed.
* Disconnect and failed setup states keep the public widget off.

== Installation ==

1. Install and activate Small Business Chatbot from Plugins in WordPress admin.
2. Open SBC Chatbot in the WordPress admin menu.
3. Choose Create an account or Connect an existing account.
4. Complete secure sign-up or sign-in on smallbusinesschatbot.com.
5. Return to WordPress automatically. The plugin activates the widget only after the platform confirms the connection.

For WordPress multisite, connect the plugin separately from each site's own admin. Network-wide shared connection setup is not supported in this release.

== Frequently Asked Questions ==

= Does activating the plugin immediately add a chatbot? =

No. Activation only installs local plugin settings. No remote request, account creation, website scan, or visitor-facing script occurs until an administrator completes the explicit account connection.

= Can I connect an account I already use? =

Yes. Choose Connect an existing account. The platform reuses that account's server-owned chatbot ID instead of creating or reconciling a plugin-generated ID.

= What happens if signup is cancelled or expires? =

The plugin remains disconnected and does not load a widget. Return to the SBC Chatbot admin page and start again.

= What happens when I deactivate the plugin? =

Deactivation stops all plugin hooks but preserves a valid connection for a later reactivation. Use the explicit Disconnect button when you intend to remove the local connection and turn off the widget.

= How many pages are scanned? =

After a successful WordPress connection, the normal platform crawl is queued. Self Serve accounts scan up to 20 pages and Managed accounts scan up to 3,000 pages.

= Can I customize the chat widget? =

Yes. Once connected, choose Open platform from the SBC Chatbot page to edit its appearance, behavior, and knowledge.

== External services ==

This plugin connects to https://smallbusinesschatbot.com only when a WordPress administrator explicitly starts account signup, existing-account login, or opens the connected platform.

At connection start, the plugin sends the site's public origin, its exact SBC Chatbot admin callback URL, plugin version, a short-lived random state, and a one-way verifier challenge. These values protect and route the requested connection; they do not activate the widget.

After platform authentication, the browser returns a short-lived authorization code and the original state. WordPress verifies its stored state, then sends the code, private verifier, site origin, and plugin version directly to https://smallbusinesschatbot.com/integrations/wordpress/exchange over HTTPS. The service validates and consumes those values once, binds the site to the authenticated account, returns the server-owned chatbot ID, and queues the plan-limited website crawl. The public widget script is then loaded from https://smallbusinesschatbot.com/static/install-chatbot-iframe.js.

Service terms: https://smallbusinesschatbot.com/legal/terms-of-use
Privacy policy: https://smallbusinesschatbot.com/legal/privacy-policy

== Screenshots ==

1. The disconnected setup screen with explicit signup and existing-account choices.
2. The connected screen with platform and disconnect actions.
3. The Small Business Chatbot platform knowledge controls.
4. The visitor-facing chat widget after a completed connection.

== Changelog ==

= 1.1.1 =
* Kept the widget bootstrap entirely within WordPress's script enqueue system while adding its validated chatbot identifier.
* Confirmed compatibility metadata for WordPress 7.0 and removed the legacy template-output path flagged in version 1.0.0.

= 1.1.0 =
* Updated the plugin and WordPress.org assets to the 2026 Small Business Chatbot brand.
* Removed activation-time chatbot ID creation, platform requests, scanning, and widget injection.
* Added administrator-only signup and existing-account connection using expiring state, verifier, and one-time code exchange.
* Added explicit disconnected, connected, retry/error, and disconnect behavior.
* Preserved valid 1.0 connections during upgrade while disabling unregistered placeholder IDs.
* Preserved connection data when the plugin is deactivated.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.1 =
This maintenance release resolves WordPress Plugin Check findings without changing the secure account connection flow.

= 1.1.0 =
This security and branding update removes automatic activation behavior. Existing registered sites remain connected; unregistered sites must complete the new explicit connection before any widget loads.
