=== Yonetwork Knowledge Chatbot ===
Contributors: devyonetwork
Tags: chatbot, faq, assistant, search, widget
Requires at least: 6.2
Tested up to: 7.0
Stable tag: 1.3.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Lightweight local keyword chatbot for WordPress with optional site and link search. Privacy-first, no external AI APIs.

== Description ==

Yonetwork Knowledge Chatbot answers visitor questions using a keyword knowledge base stored on your WordPress site. It can optionally search published pages and posts, or suggest configured links. No external AI services are used.

Features:

* Local keyword matching (no external AI APIs)
* Optional site content search (pages / posts)
* Optional custom link sources with ordered pipeline
* Floating widget or `[ynkchat]` shortcode
* CSV / JSON import for the knowledge base
* Multilingual UI: FR, EN, AR (RTL), ES, TR
* Optional local query logs with retention controls
* Appearance and typography options
* Clean-on-uninstall option

Author: [Yonetwork](https://yonetwork.ma/)

== Installation ==

1. Upload the `yonetwork-knowledge-chatbot` folder to `/wp-content/plugins/`, or install the ZIP via Plugins → Add New.
2. Activate the plugin.
3. Open Settings → Yonetwork Chatbot to configure General, Appearance, Data, and Sources.
4. Place `[ynkchat]` on a page, or enable the floating widget.

== Frequently Asked Questions ==

= Does this plugin use OpenAI or ChatGPT? =

No. Matching and search run on your WordPress site only.

= Does it slow down the site? =

Frontend assets load only when the shortcode or floating widget is active.

= Are visitor questions sent to third parties? =

No. Optional logs are stored in your WordPress database. You can disable logging and set retention in General settings.

== Privacy ==

Yonetwork Knowledge Chatbot does not send visitor data to third-party AI or analytics services.

* When logging is enabled (default), visitor questions may be stored in a local database table on your site.
* Logs are retained according to the Log retention setting (default 90 days, range 7–365) and purged by a daily cron event.
* You can disable logging under Settings → Yonetwork Chatbot → General → Privacy & logs.
* You can delete selected logs or clear all logs from the Data tab.
* Optional “scan page content” for external link sources fetches those URLs from your server; configure only trusted HTTPS URLs.

== Changelog ==

= 1.3.0 =
* Renamed plugin to Yonetwork Knowledge Chatbot (slug: yonetwork-knowledge-chatbot).
* Prefixed functions, options, hooks, shortcode `[ynkchat]`, REST routes and assets with `ynkchat_`.
* Moved settings under Settings instead of a top-level admin menu.

= 1.2.4 =
* Fixed Plugin Check DirectDB warnings: log deletes use `$wpdb->delete()` / `%i` placeholders.
* Requires WordPress 6.2+ (for safe SQL identifier placeholders).

= 1.2.3 =
* Declared compatibility with WordPress 7.0 (`Tested up to`).
* Escaped log table identifiers for Plugin Check DirectDB rules.

= 1.2.2 =
* Renamed PHP functions/hooks to `ynkchat_` prefix (options keys unchanged for upgrades).
* Multisite: create logs table on new sites when network-activated.
* Preserve admin tab after save without overriding `_wp_http_referer`.

= 1.2.1 =
* Security hardening: REST nonce checks, IP rate limiting, SSRF-safe URL fetch with DNS IP validation and caching.
* Privacy controls: enable/disable logs, configurable retention, daily purge cron.
* WordPress.org compliance: uninstall.php, style field whitelist, prepared SQL, English readme and headers.

= 1.2.0 =
* Site search, floating widget, Q/A import, admin tabs, i18n.

= 1.1.0 =
* Floating widget, typography, languages, file import.

= 1.0.0 =
* Initial release (keyword matching, shortcode, logs, admin).

== Upgrade Notice ==

= 1.3.0 =
Plugin renamed for the WordPress.org directory. Replace `[chatbot_local]` with `[ynkchat]`. Settings moved to Settings → Yonetwork Chatbot.

= 1.2.4 =
Plugin Check SQL fixes. Requires WordPress 6.2+.

= 1.2.3 =
WordPress 7.0 tested header and safer log-table SQL identifiers.

= 1.2.2 =
Prefix and multisite hardening. Re-test admin save on each tab after update.

= 1.2.1 =
Security and privacy hardening. Re-activate once if you want the log purge schedule registered immediately.

== Copyright ==

Yonetwork Knowledge Chatbot is distributed under the terms of the GNU GPL v2 or later.
Developed by Yonetwork — https://yonetwork.ma/
