=== Fetchply - AI Chatbot and Live Chat ===
Contributors: ranaharoon322
Tags: chatbot, ai, live chat, customer support, woocommerce
Requires at least: 6.3
Tested up to: 7.0
Stable tag: 1.0.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add the Fetchply AI chat agent to your site in one click. No code to paste. Train, customize, and read conversations in your dashboard.

== Description ==

Fetchply builds an AI chat agent from your own content, your website pages, your files, and your Q&A, so it answers visitor questions in your words, around the clock.

This plugin is the WordPress half of that. It stays deliberately small and does three things:

* **Puts the chat widget on your site.** Connect an agent and the widget appears for visitors. No theme edits, no script tags to paste.
* **Connects your site in one click.** Sign in at fetchply.com, pick your agent, done. There are no API keys to copy between screens.
* **Connects WooCommerce, optionally.** Approve read-only access on WooCommerce's own screen and your agent can answer product and order questions.

= Managed from your Fetchply dashboard =

Everything beyond the widget lives in your dashboard, and the plugin links you straight to each page:

* **Train your agent** on pages, files, and Q&A pairs.
* **Customize the widget** colors, welcome message, and chat behavior.
* **Inbox** to read conversations and reply as your team.
* **Analytics** for top questions, resolution rate, and trends.

Changes you save there apply to your site automatically. You do not need to come back to WordPress.

= What the plugin stores on your site =

Very little, on purpose: which agent is connected, that agent's name, whether the widget is showing, and the date you approved WooCommerce access. The plugin does not store API keys or passwords in your WordPress database. Deleting the plugin removes all four values and leaves nothing behind.

= Requirements =

* A Fetchply account. A free plan is available and you can create the account during the connect step.
* WordPress 6.3 or newer, and PHP 7.4 or newer.
* WooCommerce is optional. You only need it for product and order answers.

== External services ==

This plugin relies on Fetchply (fetchply.com), the service that runs your chat agent. The plugin cannot work without it.

**Chat widget.** Once your site is connected and the widget is switched on, public pages load the widget script from fetchply.com, and a visitor's chat messages are sent to Fetchply to generate replies. While the widget is switched off, or before the site is connected, the script is not loaded on your pages at all.

**Connecting your site.** When you click Connect to Fetchply you are taken to fetchply.com to sign in and choose an agent. Your site address, the admin page to return to, and a one-time verification code are included so the connection can be completed and matched back to your site. Nothing is sent to Fetchply before you click Connect.

**WooCommerce (optional).** If you choose Connect WooCommerce and approve the request on WooCommerce's own approval screen, WooCommerce sends read-only API keys to Fetchply so your agent can look up products and orders. You can revoke that access at any time.

Service terms and privacy: [terms of service](https://fetchply.com/terms), [privacy policy](https://fetchply.com/privacy).

== Installation ==

1. In your WordPress admin go to **Plugins > Add New**, search for **Fetchply**, then install and activate it. To install manually instead, upload the plugin folder to your site's plugins directory and activate it from **Plugins**.
2. Open **Fetchply** in the admin menu.
3. Click **Connect to Fetchply**. Sign in, or create a free account, then pick the agent for this site. New to Fetchply? Create an agent instead and it starts training on your content right away.
4. That's it. The widget is live, and the page header shows **Connected to** your agent's name.

To let your agent answer product and order questions, click **Connect WooCommerce** on the same page and approve the read-only access request. That button only appears when WooCommerce is active.

== Frequently Asked Questions ==

= Do I need a Fetchply account? =

Yes. The agent runs on Fetchply, so an account is required. You can create a free one during the connect step; the Connect button takes you straight there.

= Do I have to paste any code or edit my theme? =

No. Connecting your site is the whole setup. The plugin adds the widget for you and works with any properly built theme.

= Who is allowed to connect or disconnect the site? =

Only users who can manage site options, which normally means Administrators. Other roles do not see the Fetchply menu at all.

= Where do I train my agent or change how the widget looks? =

In your Fetchply dashboard. The **Manage on Fetchply** card links directly to **Train your agent**, **Customize widget**, **Inbox**, and **Analytics**. What you save there applies to your site automatically, with nothing to re-save in WordPress.

= Can I hide the widget without disconnecting? =

Yes. Untick **Show the chat widget on my site** and click **Save**. The status changes to **Hidden**, visitors stop seeing the widget, and your connection and agent stay exactly as they were. Tick it again to bring it back.

= Will it slow down my site? =

The widget script loads in the page footer and is deferred, so it does not hold up your content. While the widget is hidden, or before you connect, no widget script is loaded at all.

= The widget isn't showing on my site. =

Check three things, in order. Make sure the page header says **Connected to** your agent's name. Make sure **Show the chat widget on my site** is ticked and saved. Then clear the cache of any caching or optimization plugin, since some are set up to strip or defer scripts they don't recognize.

= My new agent replies "I don't know" at first. =

Training begins the moment the agent is created and usually takes a few minutes. Nothing is wrong. Follow the progress under **Train your agent** in your dashboard; answers improve as soon as it finishes, with no change needed in WordPress.

= I got "This connect link expired or did not match this browser session." =

Connect links are single use and last about 15 minutes, and they must be finished in the same browser by the same logged-in user who started them. That message usually means too much time passed, you restarted the flow in another tab, or a different administrator finished it. Go back to the Fetchply page and click **Connect to Fetchply** again.

= I don't see the WooCommerce card. =

It only appears when your site is connected to an agent and WooCommerce is active. If either is missing you will see **Connect your site to Fetchply and make sure WooCommerce is active first.** Activate WooCommerce, finish connecting, then reload the page.

= WooCommerce said access was not approved. =

That happens when the approval screen is declined, or closed before it finished. Nothing was shared and nothing was changed on your store. Click **Connect WooCommerce** and approve the request to try again.

= How do I revoke WooCommerce access? =

Two steps. In WordPress, go to **WooCommerce > Settings > Advanced > REST API** and revoke the Fetchply key. Then, in your Fetchply dashboard, remove the store under **Integrations**. Your agent keeps working for everything except product and order questions.

= What does Disconnect do? =

It removes the widget from your site and deletes the few settings the plugin saved. Your Fetchply account, your agent, and everything you trained it on are untouched, so reconnecting later is one more click. Revoking WooCommerce access is separate; see the question above.

= What happens if I delete the plugin? =

Deleting it removes every option the plugin created, so nothing is left in your database. Your Fetchply account and agent are not affected.

= Can I use it on more than one site? =

Yes. Install the plugin on each site and connect it. Several sites can share one agent, or each site can have its own.

= Can I switch a site to a different agent? =

Yes. Click **Disconnect**, then **Connect to Fetchply** again and choose the agent you want.

= Does it work with caching plugins? =

Yes. The widget is a small script tag, so cached pages serve it like any other asset. If you changed the widget's appearance in your dashboard and your site still shows the old look, clear your cache.

= Does it work on WordPress multisite? =

Yes, one site at a time. Connect each site in the network from that site's own Fetchply page. There is no network-wide setting.

== Changelog ==

= 1.0.1 =
* Security: connect and WooCommerce callbacks now verify a WordPress nonce, the administrator's permissions, and a one-time connection code before saving anything.

= 1.0.0 =
* Initial release: one-click site connect, chat widget embed, optional WooCommerce connection, and dashboard shortcuts.

== Upgrade Notice ==

= 1.0.1 =
Recommended security update. Connect and WooCommerce callbacks now verify permissions and a one-time code before anything is saved.
