=== Chisty Digital Forge Cloud AI Agent ===
Contributors: mchisty
Tags: ai chat, chatbot, ai agent, live chat, customer support
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed a hosted AI agent on any WordPress site in two clicks. No coding required.

== Description ==

Chisty Digital Forge Cloud AI Agent connects your WordPress site to the ChatNexus hosted AI assistant service (operated by CHISTY DIGITAL FORGE). Choose from industry templates — real estate, healthcare, SaaS, legal, beauty, and more — or build your own agent in the ChatNexus dashboard and paste in the Agent ID.

**Features:**

* Auto-inject the widget on every page, or use the `[chatnexus_chat]` shortcode for manual placement
* Choose widget position: bottom-right or bottom-left
* Test your connection directly from the settings page
* Override the agent per-page using shortcode attributes
* Widget script is loaded from the ChatNexus service (no bundled chat UI JavaScript in WordPress)

**How it works:**

1. Create a free account at [chatnexus.cloud](https://chatnexus.cloud)
2. Build or choose an AI agent from the template gallery
3. Copy your Agent ID from Agent Settings → Embed
4. Paste it into Settings → Cloud AI Agent in your WordPress dashboard
5. Done — your AI agent is live on your site

**External services**

This plugin is a connector to the ChatNexus hosted service operated by CHISTY DIGITAL FORGE. After you save an Agent ID, it:

* Enqueues the chat widget script via `wp_enqueue_script` from `https://chatnexus.cloud/js/embed.v1.js` (or your configured Base URL) on front-end pages where the widget is enabled. This remote script is required for the SaaS chat service to function; admin CSS/JS remain bundled locally in the plugin.
* Optionally calls `https://chatnexus.cloud/api/v1/widget/{agent-id}/config` from the WordPress admin when you click **Test Connection** (sends the Agent ID you entered; used only to verify the agent exists).

A ChatNexus account is required. Visitor chat messages and related conversation data are processed by ChatNexus according to the service terms.

* [Terms of Service](https://chatnexus.cloud/terms-of-service)
* [Privacy Policy](https://chatnexus.cloud/privacy-policy)

== Installation ==

**From the WordPress Plugin Directory**

1. Go to **Plugins → Add New** in your WordPress dashboard.
2. Search for **Chisty Digital Forge Cloud AI Agent**.
3. Click **Install Now**, then **Activate**.
4. Go to **Settings → Cloud AI Agent**, paste your Agent ID, and save.

**Manual ZIP upload**

1. Upload the `chisty-digital-forge-cloud-ai-agent` folder to `/wp-content/plugins/` (or upload the ZIP via **Plugins → Add New → Upload Plugin**).
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Settings → Cloud AI Agent** to configure your Agent ID.

== Frequently Asked Questions ==

= Do I need a ChatNexus account? =

Yes. Create a free account at [chatnexus.cloud](https://chatnexus.cloud). The Free plan includes 2 agents and 300 messages/month.

= Who operates the ChatNexus service? =

ChatNexus is operated by CHISTY DIGITAL FORGE. This WordPress plugin is the official connector.

= Where do I find my Agent ID? =

In the ChatNexus dashboard, open your agent and go to **Settings → Embed**. Your Agent ID (a UUID) is displayed there.

= Can I add the chat widget to specific pages only? =

Disable **Auto-inject Widget** in Settings → Cloud AI Agent, then add `[chatnexus_chat]` to the pages where you want the widget to appear.

= Is the widget GDPR-compliant? =

ChatNexus does not collect personal data without user consent. See [chatnexus.cloud/privacy-policy](https://chatnexus.cloud/privacy-policy) for full details.

= Does this work with page builders like Elementor or Divi? =

Yes — use the shortcode widget/module in your page builder and enter `[chatnexus_chat]`.

== Screenshots ==

1. Settings page in the WordPress admin
2. Chat widget on a live site (bottom-right position)
3. Shortcode placement in the Gutenberg editor

== Changelog ==

= 1.0.7 =
* Rename WordPress.org listing to Chisty Digital Forge Cloud AI Agent (slug chisty-digital-forge-cloud-ai-agent) for a distinctive directory name.

= 1.0.6 =
* Rename WordPress.org listing away from ChatNexus to resolve directory name conflict.
* Keep ChatNexus as the connected hosted service name in docs and settings copy.

= 1.0.5 =
* Fix: Load the ChatNexus widget via `wp_enqueue_script` / `script_loader_tag` instead of printing a raw script tag.
* Fix: Whitelist widget position values; escape all admin settings output; sanitize remote API agent name.
* Fix: Remove filesystem self-delete / upgrader pre-install helpers not appropriate for WordPress.org hosting.

= 1.0.4 =
* Fix: Remove update-plugins transient manipulation (not permitted on WordPress.org).
* Fix: Set Tested up to WordPress 7.1.
* Fix: Align Plugin Name / Text Domain for directory submission.

= 1.0.3 =
* Docs: declare ChatNexus external service usage (widget script + config API), Terms, and Privacy links for WordPress.org review.
* Docs: set plugin Author to CHISTY DIGITAL FORGE consistently.
* Docs: correct Free plan FAQ (2 agents) and add directory-install steps.

= 1.0.2 =
* Fix: Add `register_activation_hook` to write default option rows on install.
* Fix: Lifecycle and uninstall hardening for certain hosts.
* Fix: Named sanitize callback and enqueued admin.js via wp_localize_script.

= 1.0.1 =
* Fix widget embed script URL so chat bubble loads correctly on frontend pages.
* Pin widget script to versioned URL (`/js/embed.v1.js`).

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.7 =
Directory listing renamed to Chisty Digital Forge Cloud AI Agent.

= 1.0.6 =
Directory listing renamed for WordPress.org name conflict resolution.

= 1.0.5 =
Addresses WordPress.org review feedback: proper script enqueue, tighter sanitization/escaping.

= 1.0.4 =
WordPress.org automated scan fixes.

= 1.0.3 =
WordPress.org submission prep.

= 1.0.1 =
Fixes frontend widget loading for WordPress installs.

= 1.0.0 =
Initial release.
