=== Share to AI — Buttons for ChatGPT, Perplexity & More ===
Contributors: jisanewebmarketing
Tags: ai, chatgpt, share buttons, perplexity, seo
Requires at least: 5.8
Tested up to: 7.0
Stable tag: 1.3.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Configurable AI share buttons (ChatGPT, Claude, Perplexity, Gemini, Grok, Google AI) that let readers summarise your posts in their favourite AI tool.

== Description ==

Share to AI adds clean, configurable share buttons to your posts so readers can summarise your articles directly in their favourite AI tool — ChatGPT, Claude, Perplexity, Google Gemini, Grok, and Google AI.

Each button opens the AI tool with a pre-filled, fully editable prompt that points to the article the reader is on. You control the wording per tool, so you can ask each AI to summarise, extract key points, or surface specific questions — in whatever language and tone suits your audience. Useful for blogs and publishers who want to give readers a frictionless way to engage with longer-form content.

= Key Features: =
* **Support for Major LLMs:** Includes pre-configured URLs for ChatGPT, Claude, Perplexity, Gemini, Grok, and Google AI. Editable in the backend to ensure compatibility as AI platforms update their endpoints.
* **Custom Prompts:** Write your own prompts in any language to guide how each AI interprets and summarises your content.
* **Flexible Placement:** Display buttons inline (before or after content) or as sticky floating buttons on the left or right side of the screen.
* **Three Display Modes:** Show **Text + Icons** (default), **Icons only** for compact placements, or **Text only** — switch from a single dropdown in the settings.
* **Built-in Icons:** Lightweight, brand-distinct inline SVG icons for ChatGPT, Claude, Perplexity, Gemini, Grok and Google AI. Zero extra HTTP requests, scales perfectly on retina displays, fully accessible.
* **Customisation:** Use the native WordPress colour picker to match the buttons to your brand theme.
* **Secure & Sanitised:** Fully compliant with WordPress escaping and sanitisation standards to keep your database safe, built natively without external dependencies.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/ewebmarketing-llm-summariser` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Use the 'Share to AI' settings screen (under Settings) to configure your prompts, select which LLMs to display, and customise the button colours.

== Frequently Asked Questions ==

= Does this work on Pages or just Posts? =
To prevent cluttering your static pages (like Contact Us or Privacy Policy), this plugin is currently designed to strictly display on standard blog Posts.

= Can I customise the default prompts? =
Yes — every prompt is fully editable per LLM in the settings panel. Write in any language and any tone of voice to suit your audience, and use the `{url}` and `{sitename}` placeholders to inject the current page link and your site name into the prompt at runtime.

= Why does an AI tool give a security warning when I click a share button? =
Some AI platforms, like Claude, have strict Prompt Injection and Cross-Site Scripting (XSS) protections. When a URL contains a pre-filled prompt, they may show a security banner to ensure the user actually intends to run the prompt.

== Screenshots ==

1. The clean, card-based admin settings panel for configuring your AI buttons.
2. The buttons displaying inline beneath a blog post.
3. The floating sticky placement option on the left side of the screen.

== Changelog ==

= 1.3.0 =
* Added brand-distinct inline SVG icons for ChatGPT, Claude, Perplexity, Gemini, Grok and Google AI. Icons inherit the button's text colour via `currentColor` so they always match your theme.
* Replaced the "Show Text Labels" checkbox with a "Button Display Elements" dropdown offering three options: **Text + Icons** (default), **Icons only**, and **Text only**.
* Existing installs auto-migrate the old `show_labels` value to the equivalent new mode on first load — no settings get lost.
* Icon-only buttons receive a proper `aria-label` for screen readers; visible text continues to provide the accessible name in the other two modes.
* Security: SVG output is run through a custom strict `wp_kses()` safelist (only the exact SVG subset the plugin produces is permitted — no script, style, or event-handler attributes).

= 1.2.0 =
* Renamed the plugin to "Share to AI — Buttons for ChatGPT, Perplexity & More" to better describe what it does. The plugin slug, options, and settings page URL are unchanged, so existing installs continue to work with no migration required.
* Rewrote the default prompts in neutral, international English so the plugin reads well to a global audience.
* Updated the Plugin URI and Author URI to the new `ewebmarketing.au` domain.
* Tidied admin copy and the "View details" modal to match the new plugin name.

= 1.1.1 =
* Security: Hardened the inline CSS pipeline — LLM array keys are now validated against a strict whitelist and passed through `sanitize_html_class()` before being interpolated into any CSS selector.
* Security: Hex colour values are re-validated with `sanitize_hex_color()` at output time (escape-late) before being injected into inline CSS, eliminating any possibility of CSS breakout from a corrupted option.
* Security: All dynamic output now uses context-appropriate escaping at the moment of echo (`esc_html()`, `esc_attr()`, `esc_url()`, `esc_textarea()`, `wp_kses_post()`, `wp_strip_all_tags()`), in line with "escape-late" best practice.
* Compliance: Renamed all PHP identifiers to use the unique `ewebllsu_` / `EWEBLLSU_` prefix (class, methods, option name, settings group, hooks, constants, script/style handles, CSS classes) to avoid collisions with other plugins/themes.
* Compliance: Renamed the stored option from `emls_settings` to `ewebllsu_settings`; settings group renamed to `ewebllsu_settings_group`.
* Hardened the LLM whitelist in `sanitize_options()` so only known keys are ever written to the database.
* Made all user-facing strings translatable via the `ewebmarketing-llm-summariser` text domain.

= 1.1.0 =
* Completely rebranded to EwebMarketing LLM Summariser to comply with official WordPress Plugin Repository guidelines.
* Fixed text domain configuration to strictly match WordPress directory requirements.
* Set explicit versioning on `wp_register_style()` to prevent frontend and admin caching issues.
* Removed all external icon libraries (Font Awesome / SVGs) for maximum performance and strict security compliance.
* Exposed the Base URL fields in the admin settings so users can manually update LLM routing endpoints as platforms (like Gemini) change their structures.

= 1.0.0 =
* Initial release on the WordPress Plugin Repository!
* Native WP Colour Picker integration.
* Comprehensive output escaping and strict data sanitisation.
* Flexible display settings (Inline or Sticky placement).

== Upgrade Notice ==

= 1.3.0 =
Adds built-in SVG icons for all six AI tools and a new "Button Display Elements" dropdown (Text + Icons / Icons only / Text only). Existing settings are preserved — the old "Show Text Labels" checkbox is migrated automatically on first load.

= 1.2.0 =
Plugin display name changed to "Share to AI — Buttons for ChatGPT, Perplexity & More". The slug and your saved settings are unchanged — existing installs upgrade in place with no action needed.

= 1.1.1 =
Security and compliance update addressing WordPress Plugin Review Team feedback: hardened inline CSS escaping and migrated all identifiers to a unique `ewebllsu_` prefix. Existing settings stored under the old `emls_settings` key will need to be re-saved once after upgrading.
