=== EcomAudio – Audio Player & AI Voice for WooCommerce ===
Contributors: ecomaudio
Tags: audio, voice, text to speech, woocommerce, audio player
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a tap-to-play voice note player to your homepage and WooCommerce product pages, powered by your EcomAudio account.

== Description ==

EcomAudio adds a small floating "Listen" player to your WordPress storefront. Generate voice notes with AI or upload your own in your EcomAudio account, assign one to your homepage or to individual WooCommerce products, and this plugin plays it on the matching page.

Playback is always tap-to-play — nothing autoplays, and no voice note starts without a shopper gesture.

Features:

* Homepage voice note and per-product voice notes (WooCommerce) — the Free plan includes one product, paid plans include more
* Player color: default on Free, six presets on Starter, any color on Growth and above (set in your EcomAudio dashboard)
* Bubble text above the player — one shared text, or on Growth and above a text, on/off switch and text color per voice note
* Tap-to-play floating player — zero autoplay
* Its own EcomAudio menu in your WordPress dashboard: Dashboard, Voice notes, Voice reviews, AI voice agent, Settings and Help, plus a guided setup wizard after activation
* Dashboard with your plan, player state and homepage voice note at a glance, and a "Get your store talking" checklist
* Player on/off switch and corner controls under EcomAudio → Settings; the corner can follow your EcomAudio dashboard setting or be overridden per site
* Lightweight vanilla-JavaScript player, loaded only on the pages that use it
* No voice notes stored in WordPress — everything is served from your EcomAudio account

You need a free EcomAudio account and an API key to use this plugin. See the FAQ.

== External services ==

This plugin connects your storefront to EcomAudio, a third-party service, so the player can load its configuration and record anonymous play counts.

When a visitor loads your homepage or a WooCommerce product page (and the player is enabled with a valid API key), the player script in the visitor's browser contacts EcomAudio at `https://app.ecomaudio.com/api/v1`. These requests identify your site with its public site key (a non-secret identifier EcomAudio gives the plugin when you connect), never your API key:

* **Configuration request** — sends the page key (`home` or `product:{id}`) and your public site key, and receives the player settings plus the address of the voice note on app.ecomaudio.com.
* **Audio stream** — the visitor's browser loads the voice note audio from app.ecomaudio.com, with your public site key in the address.
* **Play event** — when a visitor taps play, the player sends an anonymous play event (the voice note identifier, a page context, the product ID on product pages, and your public site key).
* **Error report** — if a voice note fails to load, the player sends the voice note identifier, the page context, an error code and message, and your public site key, so the failure can be diagnosed.

The plugin sets no cookies and sends no names, email addresses or other personal data. As with any web request, EcomAudio's servers receive the visitor's IP address and browser user agent; EcomAudio uses the IP address only for short-lived abuse rate limiting and does not store it with play events. The public site key only reads your public player settings and records plays; it is visible in your storefront's page source by design. Your API key stays on your WordPress server.

Your WordPress server also contacts EcomAudio directly, sending your API key in a request header (never in a web address) together with the plugin version number (so EcomAudio knows which plugin version your site runs). This happens when you save a new API key (in the setup wizard or under EcomAudio → Settings), when you click "Test connection", and once after updating from an earlier version, to fetch your public site key. The response contains your public site key, your plan name and whether a homepage voice note is assigned; these are stored locally to run the player and to show the connection status, plan and setup checklist on the EcomAudio Dashboard page. No other data is sent or stored, and nothing is sent until you choose to connect.

Service provider: EcomAudio.
Privacy policy: https://ecomaudio.com/privacy-policy/
Terms of service: https://ecomaudio.com/terms-of-service/

== Installation ==

1. Upload the `ecomaudio` folder to `/wp-content/plugins/`, or install the plugin through the Plugins screen in WordPress.
2. Activate the plugin through the Plugins screen. The setup wizard opens automatically (or open EcomAudio → Dashboard → Start setup if it doesn't).
3. Follow the wizard: connect your account by pasting your EcomAudio API key, then turn on the player and choose where it sits.
4. Create your first voice note in your EcomAudio dashboard and set it as your homepage voice note. You can return to the wizard at any time from EcomAudio → Dashboard or EcomAudio → Help, or change settings under EcomAudio → Settings.

On a multisite network, configure the plugin per site: each site connects its own EcomAudio account and runs its own setup wizard.

== Frequently Asked Questions ==

= Where do I get an API key? =

Sign up for a free account at https://app.ecomaudio.com/signup, then open Settings in your EcomAudio dashboard and create your API key. For your security the full key is shown only once, so copy it straight away and paste it into the setup wizard, or under EcomAudio → Settings. Lost it? Generate a new key in the same place; your old key keeps working for 7 days while you switch.

= Who can manage the plugin? =

Administrators and, when WooCommerce is installed, Shop Managers. Both roles get the EcomAudio menu.

= What are Voice reviews and the AI voice agent? =

Upcoming features. Their menu pages describe what is coming; there is nothing to configure yet.

= Does the plugin store voice notes in WordPress? =

No. Voice notes are created and stored in your EcomAudio account (Generate with AI, or Upload an MP3, M4A or MP4). The player loads them directly in the shopper's browser using a temporary signed URL. Deleted voice notes stay in the trash for 7 days.

= Which pages show the player? =

Your homepage (front page) and WooCommerce single-product pages. No other pages load the player.

= Does it require WooCommerce? =

WooCommerce is only required for per-product voice notes. A homepage voice note works without it.

= Can I use it on a multisite network? =

Yes. Activate it per site or network-wide, then configure each site separately: every site connects its own EcomAudio account and keeps its own settings. Uninstalling removes the plugin's settings from every site.

== Changelog ==

= 1.2.1 =
* Security: your API key is no longer included in your store's pages or in web addresses. The storefront player now uses a public site key, and your API key only travels from your WordPress server to EcomAudio in a request header.
* Security: once saved, your API key is shown masked in Settings (only its last 4 characters). Leave the field empty to keep it, or paste a new key to replace it.
* Updating keeps your player running: the plugin fetches your public site key in the background, and until it arrives the player works exactly as before.
* Switches in the plugin settings are easier to see when turned off (higher contrast).
* Help page: support reply time now reads "We reply within 24 hours."

= 1.2.0 =
* New top-level EcomAudio menu with Dashboard, Voice notes, Voice reviews (coming soon), AI voice agent (coming soon), Settings and Help pages, all in the EcomAudio design: a page header with title, description and connection status, and white rounded cards on every page.
* Dashboard: three summary tiles (Plan with a "See plans" link, Player on/off and corner with a "Change" link, Homepage voice note set or not) and a "Get your store talking" checklist — Connect your account, Turn on the player, Add a homepage voice note — with an action button on each open step and an "N of 3 done" counter.
* Guided setup wizard after activation (Welcome → Connect → Player → All set) with step pills, a Back button and a "Create a free account" link on the Connect step; resumable, and re-runnable from the Dashboard.
* Settings redesigned: API key with a Show/Hide toggle, a "Show the player on your store" switch, three equal Corner cards (Use dashboard setting, Bottom left, Bottom right), Save changes and Test connection side by side, and an inline "Settings saved" confirmation.
* Settings moved from Settings → EcomAudio to EcomAudio → Settings; the old location redirects.
* WooCommerce Shop Managers can now manage the plugin alongside Administrators.
* The Dashboard shows your plan name and whether a homepage voice note is assigned, read during API-key verification.
* Position: new "Use dashboard setting" choice (the default); a corner chosen in WordPress overrides the dashboard setting.
* Connection status now distinguishes Connected, Key not recognized, Unverified (EcomAudio unreachable) and Not connected, on every page and on the Dashboard.
* The API-key verification request now includes the plugin version so EcomAudio can record which plugin version a site runs.
* Settings: the API key is only re-verified when it changes; re-saving other settings costs no round-trip.
* Test connection is available from the Dashboard, Settings and the wizard's All set step, and refreshes the checklist.
* The activation notice can be dismissed, and is not shown again once setup is complete or the site is connected (including on re-activation).
* Accessibility: screen-reader page headings, labelled checklist states, aria-current on wizard steps, a real switch role on the player toggle, keyboard focus rings on corner cards and buttons.
* Notices now appear above the page header instead of inside it; the player on/off switch no longer leaves a stray checkbox on the page.
* Uninstall cleans up every site on a multisite network.
* Fixed: the setup wizard could answer "Sorry, you are not allowed to access this page" right after activation.

= 1.1.0 =
* Per-voice-note bubble text: the player now shows the bubble text, on/off state and text color saved on the voice note that is playing (Growth and above). Stores on the shared bubble text are unchanged.

= 1.0.1 =
* Plan descriptions updated for the 2026 EcomAudio plans (Free, Starter, Growth, Pro, Business). No functional changes to the plugin.

= 1.0.0 =
* Initial release: homepage and WooCommerce product voice notes via the EcomAudio API bridge.

== Upgrade Notice ==

= 1.2.1 =
Security update: your API key is no longer included in your store's pages or in web addresses. No action needed; your settings are kept. Also includes accessibility and copy fixes.

= 1.2.0 =
New EcomAudio menu, setup wizard and Dashboard. Settings moved to EcomAudio → Settings; your API key and player settings are kept.
