=== VoxAI - AI Text to Speech, Audio & Summary for Posts ===
Contributors: caioferreiradev
Tags: text to speech, ai, audio, summary, openai
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI text to speech for WordPress posts: add audio narration and a smart AI summary in one click. Powered by OpenAI, no recording needed.

== Description ==

**VoxAI adds AI text to speech and an AI-generated summary to your WordPress posts — with a single click.** Convert any article into natural audio narration so visitors can listen to your posts or have them read aloud, and give every article a smart AI summary at the top. No recording equipment, no microphone, no manual editing. Powered by the OpenAI text to speech and summarization models.

Readers stay longer. Bounce rates drop. And your content becomes accessible to audiences who prefer to listen — on their commute, at the gym, or while multitasking.

= ✨ Key Features =

**AI Summary Generator**
Uses OpenAI GPT-4o Mini to read your article and write a concise, accurate summary. The summary appears in a collapsible panel inside your post — clean, discreet, and on-brand.

**Text-to-Speech Audio Player**
Converts your full article into natural-sounding audio using OpenAI's text to speech (TTS) engine, so readers can listen to your posts or have them read aloud. Six high-quality voices available (Alloy, Echo, Fable, Onyx, Nova, Shimmer). The MP3 is saved to your server — no recurring API call for playback. Great for accessibility and for turning your blog into a podcast-style audio experience.

**Reading Time Estimator**
Automatically calculates and displays the estimated reading time for every post. Configurable and translatable.

**Smart Positioning**
Choose to inject the AI Reader widget before the content, after the content, or disable injection entirely and use the shortcodes manually.

**Shortcodes for Full Control**
- `[voxaiau_summary]` — Displays the AI Summary panel.
- `[voxaiau_tts]` — Displays the AI Audio player.

= 📝 Works Where the Official AI Plugin Doesn't =
The official WordPress AI plugin is **Gutenberg-only**. Every feature it offers — title generation, summarization, excerpt, alt text — lives inside the block editor sidebar. Activate the Classic Editor plugin and all of it disappears.

VoxAI is different. It was built to work in **both environments** from day one:

- **Gutenberg** — Full sidebar panel with real-time generation status, voice selector, and cost estimator.
- **Classic Editor** — Dedicated metabox with exactly the same features: generate summary, generate audio, voice selector, per-post cost display.

If your site runs the Classic Editor — or if you manage a client site that does — VoxAI is the **only** AI audio and summary plugin that works out of the box, no editor swap required.

= 🔗 WordPress 7.0 & Official AI Plugin Compatible =
VoxAI integrates natively with the WordPress 7.0 AI infrastructure:

- **WP AI Client support** — When the site has an AI Connector configured (Settings → Connectors), VoxAI uses it for summary generation without requiring a separate API key. Falls back to your OpenAI key if no connector is configured.
- **Abilities API** — Registers `voxai/generate-audio` and `voxai/generate-summary` as discoverable AI Abilities. They appear in the Abilities Explorer and can be triggered by AI agents or automation workflows.
- **Complements, not competes** — The official AI plugin handles text features (title, excerpt, classification). VoxAI adds the one thing it doesn't have: **professional audio narration**.
- **Editor-agnostic** — Unlike the official AI plugin, VoxAI works identically with Gutenberg and with the Classic Editor plugin active.

= 🔧 Minimal configuration required =
Paste your <a href="https://platform.openai.com/" target="_blank">OpenAI API key</a> in **Settings → AI Audio & Summary**, choose which post types to activate it on, and you're done. The widget renders automatically.

= 🌐 Languages =
- English (default)
- Português do Brasil (pt_BR) — fully translated

= 🔒 Privacy & External Services =
This plugin sends post content to the OpenAI API **only when you explicitly request** a summary or audio generation. No data is sent automatically without user action.

This plugin uses the OpenAI API. By using this plugin, you agree to:
- <a href="https://openai.com/policies/terms-of-use" target="_blank">OpenAI Terms of Service</a>
- <a href="https://openai.com/policies/privacy-policy" target="_blank">OpenAI Privacy Policy</a>

No data is stored on our servers. The generated MP3 is saved locally on your WordPress install.

== Installation ==

= Automatic Installation (Recommended) =
1. Go to **Plugins → Add New** in your WordPress dashboard.
2. Search for **VoxAI - AI Audio & Summary**.
3. Click **Install Now**, then **Activate**.
4. Go to **Settings → AI Audio & Summary** and paste your OpenAI API key.

= Manual Installation =
1. Download the plugin zip file.
2. Go to **Plugins → Add New → Upload Plugin**.
3. Upload the zip, click **Install Now**, then **Activate**.
4. Go to **Settings → AI Audio & Summary** and paste your OpenAI API key.

= Getting your OpenAI API Key =
1. Create an account at <a href="https://platform.openai.com" target="_blank">platform.openai.com</a>.
2. Navigate to **API Keys** and click **Create new secret key**.
3. Copy the key and paste it in **Settings → AI Audio & Summary**.

== Frequently Asked Questions ==

= Does VoxAI add text to speech to my WordPress posts? =
Yes. VoxAI uses AI text to speech (TTS) to convert any post into natural audio narration automatically — no recording needed. A "listen to this post" audio player is added to your articles.

= Can my readers listen to articles or have posts read aloud? =
Yes. Visitors can play the audio version of any post directly on your site, which is ideal for accessibility and for people who prefer to listen instead of read.

= Can I turn my blog into a podcast-style audio experience? =
Yes. By generating audio narration for each post, VoxAI gives your blog an audio / podcast feel without you recording anything.

= Does VoxAI create an AI summary of my posts? =
Yes. VoxAI generates a short, accurate AI summary at the top of each article so readers immediately understand what it's about.

= Do I need an OpenAI account? =
Yes. This plugin uses the OpenAI API to generate summaries and audio. You need an OpenAI account with a valid API key and available credits.

= Does it send my content to OpenAI automatically? =
No — content is only sent to OpenAI when requested via the "Generate Summary" or "Generate Audio" buttons inside the post editor, or when a user views a post without a cached summary.

= How much does it cost to use? =
The plugin itself is free. You pay OpenAI directly for API usage. A typical article summary (GPT-4o Mini) costs less than $0.001 USD. A full audio narration (1000 words, tts-1 model) costs approximately $0.02–$0.04 USD.

= Is the audio file stored on my server? =
Yes. Once generated, the MP3 file is saved securely on your own WordPress server inside the uploads directory. Playback never calls the OpenAI API again.

= Does it work with Gutenberg and Classic Editor? =
Yes — and this is a key advantage over the official WordPress AI plugin. VoxAI has full support for both the **Classic Editor** (dedicated metabox) and the **Gutenberg block editor** (sidebar panels with real-time feedback). All features — summary generation, audio generation, voice selector, cost estimator — are available in both editors.

The official WordPress AI plugin (wordpress.org/plugins/ai) is Gutenberg-only. If you or your clients use the Classic Editor plugin, the official AI plugin offers no AI features at all. VoxAI fills that gap completely.

== Screenshots ==

1. **Frontend Widget** — The AI Audio & Summary widget inside a post.
2. **Gutenberg Sidebar** — The plugin sidebar panels in the Gutenberg editor with real-time status feedback.
3. **Classic Editor Metabox** — The metabox in the Classic Editor showing the summary and voice selector.
4. **Settings Page — General & Summary** — Configuration for API keys, models, and positioning.
5. **Settings Page — Audio (TTS)** — Voice selector and quality settings.

== Changelog ==

= 1.1.1 — June 2026 =
* Update: Updated the plugin name and description for better search engine visibility.
* Minor formatting corrections in the readme.

= 1.1.0 — May 2026 =
* New: WordPress 7.0 AI integration — VoxAI now uses the native WP AI Client (provider-agnostic) for summary generation when a connector is configured in Settings → Connectors.
* New: Abilities API — registers `voxai/generate-audio` and `voxai/generate-summary` as discoverable abilities visible in the Abilities Explorer.
* New: Summary Formatting — Added a setting to choose the output format of the summary (Continuous Paragraph or Bulleted List).
* Improvement: Robust Fallback System ("Cardápio") — If WP AI, Claude, or Gemini fails (e.g. missing keys or "No models found"), the system gracefully and silently falls back to the native OpenAI key.
* Improvement: When selecting Bulleted List formatting, the AI now strictly enforces proper Unicode bullet characters (•).
* Improvement: Detected summaries already generated by the official WordPress AI plugin are reused, avoiding redundant API calls.
* Fix: Resolved a fatal error that caused the summary generation button to fail due to a missing DocBlock terminator.
* Fix: Fixed a PHP Notice in WordPress 7.0 by correctly hooking `wp_register_ability` to `wp_abilities_api_init` instead of `init`.

= 1.0.8 =
* Fix: Resolved a timezone issue causing the "Top Posts This Month" chart to fail filtering plays correctly on some servers.
* Fix: Improved frontend listener tracking reliability by migrating from JSON blobs to FormData to prevent adblockers and restrictive browsers from dropping the telemetry data.

= 1.0.7 =
* Fix: Added cache buster and delay to bypass CDN/cache 412 errors when loading newly generated audio.
* Fix: Statistics panel now correctly filters "Without Audio" count to only include enabled post types.

 = 1.0.6 =
* Fix: Resolved audio player source error.
* Fix: Corrected issues with the statistics page display.

= 1.0.5 =
* Improvement: Statistics panel UI restructure. The global chart now displays a Top Posts ranking instead of a daily plays chart for better insights.
* Improvement: Telemetry tracking split. The Free plugin now only processes basic metrics (plays and listeners), keeping the database leaner and faster. Advanced retention metrics (listen time and completion rate) are strictly handled by the Pro add-on.
* Fix: Removed complex SQL aggregate functions from the Free tracking table.

= 1.0.4 — May 2026 =
* Improvement: Progress messages during audio generation (Prepare / Process Chunks / Finalize) are now fully translatable in both Gutenberg and Classic Editor.
* Fix: Progress text was previously hardcoded in Portuguese; now uses the WordPress i18n system with pt_BR fully translated.

= 1.0.3 — May 2026 =
* New: GitHub Updater — the WordPress dashboard now shows update notifications automatically when a new version is released.
* Fix: Cost calculator now works correctly with Classic Editor loaded without the official plugin (robust TinyMCE binding).

= 1.0.2 — May 2026 =
* Bug fix: accordion now opens correctly on posts without generated audio.
* Improvement: accordion and audio player are only rendered when their content exists.
* Removed: `voxai_faq` shortcode and FAQ block (placeholder feature removed).

= 1.0.0 — April 2026 =
* 🎉 Initial public release.
* AI Summary generation via OpenAI GPT-4o Mini.
* Text-to-Speech audio player via OpenAI TTS API (6 voices).
* Reading time estimator with localization support.
* Full Gutenberg sidebar panel support.
* Classic Editor metabox support.
* Configurable widget position (before content / after content / shortcode only).
* Shortcodes: `[voxai_reader]`, `[voxai_summary]`, `[voxai_audio]`.
* AJAX-based generation with real-time status polling.
* Per-post estimated API cost display.
* PT-BR (Portuguese Brazil) full translation included.
* GPL-2.0+ license compliance.
* PHP 7.4+ and WordPress 6.0+ compatibility check.

== Upgrade Notice ==

= 1.1.1 =
Minor update updating the plugin name and description for better search engine visibility.

= 1.1.0 =
Adds native WordPress 7.0 AI integration: VoxAI now uses the WP AI Client and registers abilities in the Abilities API. Fully backward-compatible — no configuration changes required.

= 1.0.8 =
Contains critical bug fixes for the listener engagement tracker to guarantee all plays are correctly recorded and displayed in the Statistics dashboard. Update recommended.

= 1.0.7 =
Contains fixes for CDN cache issues (412 errors) during audio generation and improves accuracy of the statistics panel. Update recommended.

= 1.0.6 =
Contains important bug fixes for the audio player and statistics page. Update recommended.

= 1.0.5 =
Performance improvements for the Statistics panel and underlying database tracking. Update recommended.

= 1.0.4 =
Progress messages during audio generation are now fully translatable. No action required — update to get the improved i18n support.

= 1.0.0 =
Initial public release. Install and configure your OpenAI API key to get started.