=== REPRESENT AI Chat ===
Contributors: representjp
Tags: chatbot, ai, customer support, faq
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.9.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

Answer visitor questions using your site information, approved FAQs, the REPRESENT cloud service, and your own Gemini API key.

== Description ==

REPRESENT AI Chat helps visitors find information, related pages, and a contact form on your website.
Answers are generated by the external REPRESENT cloud service using Google Gemini API and your own API key.
Service registration and acceptance of the service terms are required before the chat becomes available.
The current chat and administration interface is primarily in Japanese.

The plugin is distributed free of charge. The cloud service offers free and paid plans.
Google Gemini API terms and usage charges apply separately to your Google account.
Contact the service provider for paid-service pricing.

= Local plugin features =

* Customize the chat title, colors, introductory text, and page-specific suggested questions.
* View locally retained conversations and export them as Markdown or ZIP files.
* Review conversation categories, answer feedback, and contact handoffs.
* Manage approved FAQs and review answers that received negative feedback.
* Enable daily email summaries and run administrator answer-quality checks.
* Add site-specific privacy and introduction text while retaining the standard service disclosure.
* Optionally configure Cloudflare Turnstile for bot protection.

These local features are available regardless of the cloud service plan.
The plugin imposes no item-count quota on locally stored approved FAQs.
The cloud service applies separate plan conditions to answer generation, including the amount of site information and the number of FAQs used per answer, daily answer limits, and provider-side conversation storage.

= External services and data transmission =

**REPRESENT AI Chat Cloud**

After an administrator accepts the service terms, the plugin registers with the provider.
Registration transmits the site URL, site name, administrator email address, plugin version, and agreement information.
The provider calls this site's dedicated verification REST endpoint to confirm site ownership.
Subsequent connection and plan checks transmit site information, plugin version, and a distribution-file fingerprint.

After a visitor accepts the chat notice and submits a question, the plugin transmits the question, previous conversation, configured public site information, approved FAQs, current-page and related-page information, and the consent notice to the provider's server.
Your Gemini API key is transmitted to that server over HTTPS for answer generation and connection tests.
The provider uses the key for the request and does not store it in its conversation records.

On the free cloud plan, the provider stores conversation data, summaries, feedback, and handoff information for service improvement.
For sites handling sensitive topics, summary-oriented storage is subject to the provider's service conditions.
On the paid cloud plan, the provider does not store conversation data.
On either plan, this WordPress installation retains local conversations for the period configured by its administrator.
Provider-side retention, deletion requests, and detailed conditions are explained in the service terms shown in the plugin settings and in the provider's service information.

* Service: https://hub.represent.co.jp/
* Privacy policy: https://hub.represent.co.jp/privacy-policy/
* Contact: https://represent.co.jp/contact/

**Google Gemini API**

The REPRESENT server uses your API key to send questions, conversation context, and reference information to Google to generate answers and summaries.
Google's applicable data-handling and billing terms depend on your service configuration.

* Service: https://ai.google.dev/gemini-api/docs
* Terms: https://ai.google.dev/gemini-api/terms

**Cloudflare Turnstile (optional)**

Turnstile is used only when both its site key and secret key are configured.
The visitor's browser loads Cloudflare's verification script.
This WordPress installation sends the verification token, secret key, and visitor IP address to Cloudflare to validate the challenge.
The Turnstile secret is stored encrypted in this WordPress installation and is not sent to REPRESENT or Gemini.

* Service: https://www.cloudflare.com/products/turnstile/
* Privacy policy: https://www.cloudflare.com/privacypolicy/

= Local storage and operation =

Conversations, summaries, the accepted notice, feedback, and handoff information are stored in dedicated database tables in this WordPress installation.
The default conversation retention period is 90 days after the last update; administrators can select 1 to 365 days.
Expired records are removed by scheduled WordPress processing, whose timing depends on the site's operation.
Session identifiers are held in the browser tab's sessionStorage to continue conversations within the same tab.
IP-derived hashes with expiration times are used to limit repeated requests.

Only register information that may be disclosed publicly. AI answers may contain errors or outdated information.
Visitors must submit a contact form themselves to send an inquiry.
Deactivating or deleting the plugin does not delete provider-side records or files previously exported to a computer.
Local conversations can be deleted from the settings screen. Deactivation always keeps local records and settings. Uninstalling through the WordPress Plugins screen also keeps them by default. To remove them, first enable and save the option to delete local data on plugin deletion, then deactivate and delete the plugin. This permanently removes local conversations, settings, saved API keys, approved FAQs, statistics, and plugin caches. If the legacy AI Chat Cloud edition is active, shared data is preserved. Provider-side records and exported files must be deleted separately.

== Installation ==

1. Install and activate the plugin. Public chat is disabled initially. When migrating from the private AI Chat Cloud edition, deactivate that edition first; do not activate both editions together.
2. Open Settings > AI Chat (the current Japanese menu label is AI相談チャット), review data handling, and accept the service terms.
3. Enter your own Gemini API key, contact-page URL, and privacy-policy URL.
4. Replace the example site information with your own public information.
5. Configure approved FAQs, presentation, retention, and optional Turnstile protection.
6. Test answers as an administrator. Answer tests consume API usage and cloud-service answer allowance.
7. Update your site's privacy policy and enable public chat.

PHP OpenSSL and Sodium functions are needed for encryption and signature verification. ZIP export requires ZipArchive.
The provider must be able to reach the site's dedicated REST verification endpoint during registration.

== Frequently Asked Questions ==

= Does the plugin generate answers on its own? =

No. Answer generation requires the REPRESENT cloud service and Google Gemini API.
Plugin-code licensing and cloud-service access conditions are separate.

= Can free-service users export conversations and view statistics? =

Yes. Local history management, exports, statistics, site-copy editing, daily summaries, and FAQ registration are available on every plan.
Only records still retained in this WordPress installation are included.
The plugin cannot restore records already removed locally by an older version. Access to records held only by the provider follows the cloud-service conditions.

= Does it automatically synchronize with Obsidian? =

No. Export Markdown or ZIP files and import the files you need into your vault.
A separate history-export API can be accessed with a configured synchronization token over HTTPS.

= Where does my API key go? =

It is sent over HTTPS from this WordPress installation to REPRESENT during answer generation and administrator connection tests.
The provider uses it to call Google Gemini API. It is not exposed to the visitor's browser.

= How are plugin updates delivered? =

The directory edition is configured to use standard WordPress.org updates.
It does not contain a provider-hosted plugin ZIP updater.

== Changelog ==

= 2.9.2 =
* Isolate PHP function, class, and internal constant names from the legacy AI Chat Cloud edition; stop loading and refuse activation while the legacy edition is active.
* Fix security-status indicator markup and remove an outdated character name from the FAQ screen.
* Align the bundled JavaScript copyright header with GPL-2.0-or-later.
* Add optional local-data removal on uninstall (off by default), protect data used by an active legacy edition, and clear scheduled events with arguments on deactivation.

= 2.9.1 =
* Limit ongoing administrative notices to this plugin's settings screens.
* Require POST for administrative mutations, retain action-specific nonces and capability checks, and verify status-message and administrator test links.
* Sanitize nested settings and test-case input and validate malformed request fields more defensively.


= 2.9.0 =
* Initial directory submission of REPRESENT AI Chat.
* Made local history, exports, statistics, site-copy editing, daily summaries, and FAQ registration available on every service plan.
* Applied the configured local retention period to every plan.
* Removed the provider-hosted updater and bundled the chat JavaScript and CSS.
* Updated the service-terms version for the local-retention change; renewed administrator agreement is required.
