=== mazdek AI ===
Contributors: mazdek
Tags: kurdish, text to speech, spell checker, ai writer, audio
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Kurdish text to speech for posts and news, the Rastnivîs spell checker and an AI writing assistant — Kurmancî, Soranî and Kirmanckî.

== Description ==

**mazdek AI** brings Kurdish voice and language tools to WordPress.

= Listen to every article =

* A clean, accessible **listen button** on your posts, in Kurmancî, Soranî or Kirmanckî.
* **Choose the voice**: browse the full voice catalogue in the plugin, filter by gender and style and press ▶ to hear a sample.
* **All posts or only some**: read every post, only the categories you pick, or all except some. Every post can override the rule in the editor.
* Audio is made **once per article** and served to every visitor. When you edit a post, the new text gets new audio.
* Generate automatically when a post is published, or only when the first visitor presses play.
* **Audio for your archive**: read all published posts, or only some categories and a period. See how many posts, characters and roughly what it costs before you start; it runs in the background in small batches and can be paused, resumed or stopped.
* Optional: keep a copy of every audio file in your **media library**, so the player plays it from your own server.
* A beautiful player: waveform you can click and drag, 15 s back/forward, speed, "continue where you left off", a mini player that follows the reader while scrolling, and lock-screen/headphone controls on phones.
* **Make it yours**: full or compact layout, light/dark/automatic theme, your brand color, corner style and button text — with a live preview while you choose.
* Player above or below the post, or exactly where you put `[mazdek_player]`. Right-to-left layout for Soranî.
* Monthly character limit to keep your spending under control.

= Rastnivîs in the editor =

* **While you type**, mistakes are underlined right in the text (like a word processor); click a word to see suggestions and fix it with one click, or ignore it.
* A full check in the mazdek AI panel lists every mistake; click one to see it in the post.
* **Diacritics completion** for Kurmancî and Kirmanckî (î, ê, û, ş, ç).
* **AI grammar** check (optional).
* Optional Rastnivîs button under your comment form for visitors.

= AI writing assistant =

* Improve, shorten or expand selected paragraphs.
* Write a summary, suggest headlines and a meta description.
* Translate between Kurmancî, Soranî, Kirmanckî and other languages.
* Or simply ask: "Write a short introduction for this article".

= Built for WordPress =

* Its own **mazdek AI** menu: Overview, Audio, Editor tools and Audio library.
* Abilities API support (WordPress 6.9+): spell checking, the writing assistant and post audio are available to AI agents connected to your site, with the same permissions as the editor.
* Your API key stays on your server; it is never sent to visitors' browsers.

= What it costs =

The plugin is free. Audio, AI grammar and the writing assistant use your prepaid **mazdek AI** credit at the published API rates (see https://mazdek.ai/pricing). Spell checking and diacritics completion are free. An article that already has audio is never billed again, however many people listen.

== External services ==

This plugin connects to **mazdek AI** (https://mazdek.ai), a Kurdish speech and language service operated by mazdek GmbH, Switzerland. Nothing is sent until you connect the plugin with your API key.

* **Connecting** (when you press "Connect"): your site's domain and name and the chosen language are sent to `https://api.mazdek.ai/api/sites/connect` to register this site in your account.
* **Post audio** (when a post is published or updated, if automatic audio is on, or when you press "Generate audio"): the post's address, title and text are sent to `https://api.mazdek.ai/api/sites/…/articles`. When a post is trashed or unpublished, its address is sent so its audio is removed.
* **Audio player** (on posts with audio, in your visitors' browsers): the player script bundled with this plugin sends the page address, title and article text to `https://api.mazdek.ai/api/sites/public/…` to fetch or create the audio, and plays it from mazdek AI's storage. If a visitor presses play on a post without audio, mazdek AI downloads that public page once to confirm the text is really published there. No cookies are set and no personal data of visitors is stored.
* **Rastnivîs and the writing assistant** (when an editor clicks a button in the editor sidebar, and — if "Underline mistakes while typing" is on — about a second after they stop typing, for the paragraphs that changed): the selected or full post text is sent to `https://api.mazdek.ai/api/spellcheck`, `/api/spellcheck/diacritics`, `/api/spellcheck/grammar`, `/api/translate` or `/api/chat/v2`.
* **Comment Rastnivîs** (only if you turn it on, when a visitor clicks the button): the comment text is sent to `https://api.mazdek.ai/api/sites/public/spellcheck`.
* **Media library copies** (only if you turn them on): when a post's audio is ready, the MP3 is downloaded once from mazdek AI's storage into your media library.
* **Cost estimate** (Audio library page, when you press Calculate): the public price list is read from `https://api.mazdek.ai/api/keys/rates`.
* **Voice catalogue and samples** (on the plugin's Audio page): the voice list is loaded from `https://api.mazdek.ai/api/tts/voices` and samples are played from `https://api.mazdek.ai/api/tts/samples/…`.

Terms of service: https://mazdek.ai/terms — Privacy policy: https://mazdek.ai/privacy

== Installation ==

1. Install and activate the plugin.
2. Create a free account at https://mazdek.ai, add credit and create an API key under **Settings › API**.
3. In WordPress open **mazdek AI**, paste the key and press **Connect**.
4. Under **mazdek AI › Audio** choose the language, a voice and which posts are read aloud.

Advanced: define `MAZDEK_AI_API_KEY` in `wp-config.php` to keep the key out of the database.

== Frequently Asked Questions ==

= Which languages are supported? =

Kurmancî (Latin), Soranî (Kurdish Arabic script, right-to-left) and Kirmanckî (Zazakî). Kirmanckî is read by the Kurmancî voices.

= Can I read only some categories? =

Yes. Under **mazdek AI › Audio** choose "Only these categories" or "All except these". A parent category includes its sub-categories. In the editor, the mazdek AI panel lets you force audio on or off for a single post.

= Where is the audio stored? =

On mazdek AI: each article is generated once and every listener gets the same file through a short-lived link. If you prefer, turn on "Also save the audio files in the media library" — the player then plays the copy from your own server.

= Can I add audio to old posts? =

Yes. Under **mazdek AI › Audio library** choose all posts or some categories and a period, press Calculate to see the number of posts and the estimated cost, then Start. Posts that already have audio for the same text are not billed again.

= New posts are sent late. Why? =

WordPress runs background tasks when the site gets visits. On a site with few visitors, ask your host to call `wp-cron.php` every minute (a server cron job).

= Does it work with the classic editor? =

Audio does (a meta box lets you switch it per post). Rastnivîs and the writing assistant are in the block editor.

= Can I use it on a site that is not WordPress? =

Yes — add one `<script>` line to any website. See https://mazdek.ai/docs/wordpress.

== Screenshots ==

1. The listen button on a post.
2. Choosing a voice, with samples.
3. Which posts are read aloud: all, only some categories, or all except some.
4. Rastnivîs and the writing assistant in the block editor.

== Changelog ==

= 1.0.0 =
* First release: post audio in Kurmancî, Soranî and Kirmanckî, voice picker with samples, category rules, audio for the archive (categories, period, cost estimate, pause/resume), optional media library copies, Rastnivîs while typing, AI grammar and the writing assistant in the block editor, Abilities API.
