=== Mador ===
Contributors: khlumen
Tags: ai, faq, structured data, verification, badge
Requires at least: 6.0
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

Connects your site to Mador: site verification, your questions and answers with FAQ structured data, the measurement badge and certificate.

== Description ==

[Mador](https://mador.ai) measures how often AI assistants (ChatGPT, Gemini, Perplexity, Claude and others) name a business when a customer asks, and writes the pages that help them name it. This plugin brings that work onto the business's own WordPress site.

It does four things, and nothing else:

* **Site verification.** It adds `<meta name="mador-verifica">` to the head of every page, so Mador can confirm the site belongs to your account. Nothing to paste.
* **Questions and answers.** `[mador-faq]` prints the questions and answers written for your business, with `FAQPage` structured data and a link to your page on Mador. They update on their own when you correct them in the Mador area.
* **Badge.** `[mador-badge]` shows your latest measurement, linking to the certificate.
* **Certificate.** `[mador-certificato]` embeds the full measurement certificate.

No API key, no account password, no tracking, no JavaScript, no stylesheets, no external libraries. The only setting is your report code, which is already public.

The admin screens are in English, Italian and Spanish. What visitors see follows the language you choose in the settings (Italian, English or Spanish).

== Installation ==

1. Download the plugin from [mador.ai/plugin](https://mador.ai/plugin).
2. In WordPress: **Plugins → Add New Plugin → Upload Plugin**, choose the zip file, **Install Now**, then **Activate**.
3. Go to **Settings → Mador**, paste your report code (the ten characters at the end of your report address, `mador.ai/r/XXXXXXXXXX`; the whole address works too), pick the language and save.
4. In the Mador area, under "Connect your site", press **Check the meta tag**: the tag is already on every page.
5. On the page that should carry your questions and answers, add a **Shortcode** block with `[mador-faq]`.
6. Optional: `[mador-badge]` where the badge belongs (the footer is the usual spot), `[mador-certificato]` on the page that should carry the certificate.

= Shortcode attributes =

Without attributes, the settings apply.

* `[mador-badge larghezza="180"]` — badge width in pixels (60–1000).
* `[mador-certificato altezza="1800"]` — certificate height in pixels (300–5000).
* `[mador-faq titolo="no"]` — without the section heading.
* `codice="..."` and `lingua="it|en|es"` on any of the three — for a site that shows more than one business or another language.

== Frequently Asked Questions ==

= Where do I find the report code? =

At the end of the report address Mador sent you: `mador.ai/r/XXXXXXXXXX`. Ten characters. You can paste the whole address: the plugin keeps the code.

= Why does `[mador-faq]` show nothing? =

The questions and answers appear once your article is published on Mador. Until then the shortcode prints nothing: visitors see nothing, administrators see a notice saying why.

= Does the badge stay frozen at the day I installed it? =

No. The badge image is generated by Mador and cached for a day, so it always shows the latest measurement.

= Does it slow the site down? =

No. It adds one `<meta>` tag; the badge and the certificate load lazily, and only where you put them. The questions and answers are fetched from the server and kept for a day.

= My site is not on WordPress. =

You can connect it by hand, or send the instructions to whoever manages it, from the Mador area.

= Where is the source code? =

On GitHub. Issues and pull requests are welcome.

== External services ==

This plugin connects to Mador (https://mador.ai), the service it belongs to. It does not work without it.

* **Questions and answers** (`[mador-faq]`): when a page with the shortcode is rendered and nothing is cached, your server requests `https://mador.ai/api/pubblicazioni/{report code}.json`. The request carries the report code and the plugin version in the user agent; it sends no personal data, no visitor data and nothing else about your site. The answer is cached for a day (five minutes after a failure).
* **Badge** (`[mador-badge]`) and **certificate** (`[mador-certificato]`): the visitor's browser loads the image `https://mador.ai/r/{report code}/badge.svg` and the page `https://mador.ai/r/{report code}/certificato` (in an iframe). Like any image or embedded page, this sends the visitor's IP address and browser details to mador.ai.
* **Verification**: the meta tag is read by Mador when you press the verify button in the Mador area; the plugin itself sends nothing.

== Changelog ==

= 1.0.0 =
* First public release: site verification tag, `[mador-faq]` with FAQPage structured data, `[mador-badge]`, `[mador-certificato]`, settings page in English, Italian and Spanish, full cleanup on uninstall.
