=== PidiXat AI ===
Contributors: pidi
Donate link: https://projectesidisseny.com
Tags: chatbot, artificial intelligence, AI, OpenAI
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A fully customizable AI assistant for WordPress.

== Description ==

**PidiXat AI** is a WordPress plugin that adds an intelligent, fully customizable AI-powered chat assistant to your website. Personalize chat responses through the system prompt — no authentication or registration required.

= Key Features =

* **Easy activation** via shortcode `[pidixat]` on any page or module
* **Customization via System Prompt:** define how the assistant behaves, its tone, and communication style
* **Compatible with all OpenAI-compatible APIs:** OpenAI, Mistral, Groq, Ollama, NVIDIA NIM, OpenRouter, and more — including free-tier options
* **Multilingual support:** works with any AI model that supports multiple languages
* **No registration required:** plug-and-play, without unnecessary complexity

= How It Works =

1. Install and activate the plugin
2. Enter your API key in the settings panel
3. Customize the system prompt to define how the assistant behaves
4. Add the `[pidixat]` shortcode to any page — or display it site-wide using the footer

= Displaying the Chat on All Pages =

**Option 1 — Add to footer.php:**

Add this line just before the `</body>` tag in your theme's `footer.php`:

`<?php echo do_shortcode('[pidixat]'); ?>`

**Option 2 — Use a WordPress hook in functions.php:**

`function add_pidixat_to_all_pages() {`
`    echo do_shortcode('[pidixat]');`
`}`
`add_action('wp_footer', 'add_pidixat_to_all_pages');`

= Use Case =

A visitor lands on your website and asks a question. PidiXat AI instantly responds with a personalized conversation based on the instructions you configured — as if you had an assistant available 24/7.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`
2. Activate the plugin from the WordPress 'Plugins' menu
3. Go to Settings → PidiXat AI to configure your API key and system prompt
4. Add `[pidixat]` to any page or use the footer hook to show it site-wide

== Frequently Asked Questions ==

= Which AI providers are compatible? =

Any provider with an OpenAI-compatible API: OpenAI, Mistral, Groq, Ollama, NVIDIA NIM, OpenRouter, and others.

= Can I use free APIs? =

Yes. The plugin works perfectly with free-tier APIs. Limitations will depend on each provider's terms and rate limits.

= How do I customize the assistant's behavior? =

Use the "System Prompt" field in the plugin settings. Explain how you want the assistant to behave, its tone, communication style, and any specific instructions you want it to follow.

= Need help? =

For support, please contact us via WhatsApp at +34 938 37 11 90 or visit our FAQ page at https://projectesidisseny.com/preguntes-frequents

== Screenshots ==

1. Plugin settings panel — API and system prompt configuration
2. Chat widget displayed on a webpage

== External services ==

This plugin connects to third-party API services to process AI chat completions and embeddings.

**AI Chat Providers (user-configurable):**

* **Groq** — Used when the user selects "Groq" as the model provider. The plugin sends the conversation messages (user input + system prompt) to `api.groq.com` to generate AI responses. Data sent: conversation messages, model name, API key. [Terms of Service](https://groq.com/terms-of-use) | [Privacy Policy](https://groq.com/privacy-policy)
* **OpenRouter** — Used when the user selects "OpenRouter" as the model provider. The plugin sends conversation messages to `openrouter.ai`. Data sent: conversation messages, model name, API key. [Terms of Service](https://openrouter.ai/terms) | [Privacy Policy](https://openrouter.ai/privacy)
* **NVIDIA NIM** — Used when the user selects "NVIDIA NIM" as the model provider. The plugin sends conversation messages to `integrate.api.nvidia.com`. Data sent: conversation messages, model name, API key. [Terms of Service](https://www.nvidia.com/en-us/about-nvidia/privacy-policy/) | [Privacy Policy](https://www.nvidia.com/en-us/privacy/)
* **OpenAI** — Used when the user selects "OpenAI" as the model provider. The plugin sends conversation messages to `api.openai.com`. Data sent: conversation messages, model name, API key. [Terms of Service](https://openai.com/policies/terms-of-use) | [Privacy Policy](https://openai.com/policies/privacy-policy)

**Embeddings Service (Premium version only):**

* **PidiXat Embeddings Server** — Used by the Premium version to generate vector embeddings for the knowledge base (RAG). The plugin sends document text to `http://57.129.12.67:3000/v1/embeddings` for indexing, and sends user queries to the same endpoint during semantic search. Data sent: document text or user query text, API key. [Privacy Policy](https://projectesidisseny.com/politica-de-privacitat/)

**License Verification (Premium version only):**

* **PidiXat License Server** — Used by the Premium version to verify license keys on each settings page load. The plugin sends the license key and domain name to `http://57.129.12.67:3000/verify` to check if the license is valid and not expired. Data sent: license key, site domain. [Privacy Policy](https://projectesidisseny.com/politica-de-privacitat/)

== Changelog ==

= 1.0.3 =
* Moved premium license verification to premium/ folder (free version no longer references external VPS)
* Added admin opt-in for credit link (Powered by Projectes i Disseny)
* Moved document storage from plugin directory to WordPress uploads directory
* Moved chat logs from plugin directory to WordPress uploads directory
* Added .htaccess protection to chat logs directory
* Removed plugin asset files (banners, icons, screenshots) from plugin zip
* Added external service documentation to readme.txt
* Improved input sanitization and security hardening
* Improved RAG search with keyword fallback
* Fixed Groq ToS/Privacy URLs in documentation

= 1.0.2 =
* Initial release

== Upgrade Notice ==

= 1.0.3 =
Moved premium license verification out of free codebase. Updated storage locations and documentation for WordPress.org review.

= 1.0.2 =
Initial release of PidiXat AI.
