=== Ai.RevTech.ca Web Agent ===
Contributors: revtechca
Tags: chat, chatbot, assistant, widget
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.2
Stable tag: 1.6.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Adds the Ai.RevTech.ca Web Agent chat widget to your site, by RevTech.ca.

== Description ==

Inserts the Ai.RevTech.ca Web Agent above the closing </body> tag on the public site. It never loads in the WordPress dashboard. The script loads from:

https://ai.revtech.ca/web-agent/{domain}-web-agent.js?ver={plugin version}&source=wordpress

Settings → Ai.RevTech.ca Web Agent sets:

* Domain name: the {domain} part of the file name, such as "example". Only lowercase letters, numbers and hyphens are accepted. Blank (the default) inserts nothing. Saving checks that the file exists on ai.revtech.ca.
* Where it appears: every page, every page except a list, or only a list of pages.
* Assistant name, greeting, primary and secondary colors, position, side and bottom offsets, and open on load.
* Contact page URL and the name, email and message field ids for contact form prefill.
* An optional custom question and answer database (JSON).
* Whether deleting the plugin also deletes its settings (off by default, so a reinstall keeps them).

A live preview on the settings page shows the widget with your unsaved settings. Defaults match the widget's own defaults, and "Reset to defaults" restores them. The "Check homepage" button, which also runs automatically after each save, loads the homepage as a logged-out visitor and reports whether the script is there, which version of the plugin inserted it, and whether the file exists on ai.revtech.ca.

Until a domain name is set, the Dashboard and Plugins screens show a reminder to finish setup.

Updates come from ai.revtech.ca instead of WordPress.org. They appear on the Updates screen like any other plugin, and can be turned on to install automatically.

== Changelog ==

= 1.6.1 =
* Changed the plugin's website address to https://ai.revtech.ca.

= 1.6.0 =
* Added: the homepage check runs automatically after you save your settings.
* Added: clicking Check homepage with unsaved changes offers to save them first, since the check uses your saved settings.

= 1.5.0 =
* Added "Delete all settings when the plugin is deleted", off by default. Deleting the plugin now keeps your settings unless it's turned on, so reinstalling restores them.

= 1.4.0 =
* Added a live preview of the widget on the settings page, which updates as you change the settings.
* Added "Where it appears": show the widget on every page, every page except a list, or only a list of pages.
* Added a check when saving that the domain's web agent file exists on ai.revtech.ca, with its version.
* Added a reminder on the Dashboard and Plugins screens until a domain name is set.
* Added automatic updates from ai.revtech.ca.
* Removed "Hide the widget for logged-in administrators". Administrators now see the widget on the public site like everyone else. It never loads in the WordPress dashboard.
* Changed: requires WordPress 5.8 or later.

= 1.3.0 =
* Added a Reset to defaults button to the settings page. It asks for confirmation, then restores every setting except the domain name.

= 1.2.2 =
* Fixed (security): the contact page setting no longer accepts a full URL on another domain. Use a path such as /contact/, or a URL on this site's own domain (with or without www.). A previously saved URL on another domain is replaced with /contact on the page.

= 1.2.0 =
* Added: Check homepage now shows the version number of the web agent file on ai.revtech.ca, or warns when the file has none.

= 1.1.0 =
* Added a color picker beside the primary and secondary color fields. Typing or pasting any CSS color updates the picker, and colors the browser doesn't recognize are outlined in red.

= 1.0.0 =
* First release.
