=== AIM Transparency ===
Contributors: itsnothuman
Tags: ai images, ai content, eu ai act, ai disclosure, compliance
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Label AI-generated images for EU AI Act Article 50 — a visible AI-content disclosure badge, plus machine-readable IPTC/XMP metadata and JSON-LD.

== Description ==

**Label your AI-generated images and meet EU AI Act Article 50 on WordPress — free.** If your site publishes AI images, from 2 August 2026 you must disclose them. AIM Transparency adds a clear, visible "AI-generated" badge, embeds machine-readable provenance in the image file (IPTC/XMP), and outputs schema.org JSON-LD — on any theme, with no account and no data leaving your site.

The EU AI Act (Regulation (EU) 2024/1689), Article 50, requires transparency for AI-generated and AI-manipulated media from 2 August 2026. A website owner who *displays* AI images is a **deployer**, whose duty is a **clear, human-visible disclosure** at first exposure. Embedding machine-readable provenance in the file is best practice (and is what search engines and detection tools read to recognise AI images).

AIM Transparency gives you both, on any theme:

1. **Flag** — mark an image as AI-generated, AI-edited or algorithmic from the Media Library (single, bulk action, and an "AI" column).
2. **Visible badge** — a configurable "AI-generated" badge renders on the front end across galleries, portfolio grids, masonry, featured images, content images and block/FSE themes. An optional Universal badge coverage mode extends to custom themes that hand-write their markup.
3. **Machine-readable metadata** — writes the IPTC `Digital Source Type` (`Iptc4xmpExt:DigitalSourceType`) into the file's XMP, plus schema.org JSON-LD (`ImageObject` + `IPTC:DigitalSourceType`) on the page.
4. **Compliance record** — export a CSV audit trail of every disclosed image (file, type, disclosure label, embedded status and IPTC URI), plus your Article 4 AI-literacy checklist as evidence, for your own EU AI Act records. Free.
5. **Readiness score** — a free EU AI Act readiness view that combines your Article 50 image disclosure (scored automatically from your settings) with an **Article 4 AI-literacy checklist** you tick off and document with evidence notes. Article 4 (AI literacy) has applied since 2 February 2025, ahead of the Article 50 deadline.
6. **AI-assistant (chatbot) disclosure** — not just images. If your site runs a chatbot, an `[aicl_ai_notice]` shortcode (and an optional floating notice) tells visitors when they are interacting with an AI, not a human, covering the EU AI Act Article 50(1) duty as well.

A modern dashboard (under the top-level **AIM Transparency** menu) shows live coverage stats, the badge preview, the embedding-engine status, and settings — and follows your WordPress admin color scheme.

= Who needs this =

Anyone publishing AI-generated or AI-edited visuals to an EU audience — bloggers, news and magazine sites, agencies building client sites, WooCommerce and other shops using AI product imagery, and portfolios. Being a small site is not, by itself, an exemption, and the Act reaches non-EU sites whose content is seen by EU users.

IPTC vocabulary used (the same value C2PA uses, so it is forward-compatible):

* AI-generated: `http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia`
* AI-edited/composite: `http://cv.iptc.org/newscodes/digitalsourcetype/compositeWithTrainedAlgorithmicMedia`
* Algorithmic (non-AI): `http://cv.iptc.org/newscodes/digitalsourcetype/algorithmicMedia`

File embedding uses `exiftool` when present (JPEG/PNG/WebP/GIF/TIFF); otherwise a built-in pure-PHP writer handles JPEG and PNG.

**Optional, off by default:** an opt-in **AI Transparency Directory** lets you list your site publicly as one that discloses AI content. Nothing is shared without your explicit consent, and you can remove your listing anytime.

**Disclaimer:** this plugin is tooling to help meet Article 50 transparency obligations. It is not legal advice. Whether content is in scope (e.g. what counts as a "deepfake"), your deployer status, and the wording of your disclosure remain your responsibility.

== External services ==

This plugin can connect to the AIM Transparency service at `directory.aimtransparency.com`, operated by the plugin's developer. Every connection is **optional and user-initiated** — nothing is sent on install, on activation, or during normal use.

1. **AI Transparency Directory** (opt-in, off by default). If you opt in from the dashboard, the plugin sends your site URL, site name, plugin and WordPress versions, the number of images you have labeled, an optional contact email, your consent version/time, and a one-time verification token to `https://directory.aimtransparency.com/api/register`, so your site can be listed publicly as one that discloses AI content. The service then makes a single request back to a token endpoint on your site to verify you control it. You can remove your listing at any time, which deletes the stored data.

2. **Pro waitlist** (sent only when you submit the form). If you enter your email in the optional "notify me about Pro" form, that email is sent to `https://directory.aimtransparency.com/api/waitlist` so the developer can email you about the Pro add-on, and is stored only for that purpose.

The plugin makes no other external requests. The `iptc.org`, `schema.org`, `ns.adobe.com` and `w3.org` URLs in the code are standard metadata vocabulary identifiers written into your files and pages — they are not network requests.

Privacy policy: https://aimtransparency.com/privacy

== Installation ==

1. Upload the plugin to `/wp-content/plugins/`, or install it from the Plugins screen in wp-admin.
2. Activate the plugin.
3. Open the **AIM Transparency** menu, flag images in the Media Library (single, bulk action, or the per-image control), and configure the badge in Settings. The official EU badge and machine-readable metadata are on by default.

== Frequently Asked Questions ==

= Is it really free? =
Yes — everything in this plugin is fully functional, nothing is locked. Flagging, the visible badge with all its styles and shapes (including the click-to-disclose modal and a custom logo), the in-dashboard media library, IPTC/XMP embedding for every supported format, JSON-LD, the AI-assistant notice, and the CSV compliance export are all free. A separate, optional **AIM Transparency Pro** add-on (sold on our site, not hosted here) adds its own features on top: automatic flagging on upload, a library scanner with strip-guard, additional report export formats (print-ready PDF, JSON, Markdown & TXT), and WooCommerce support.

= Does the badge satisfy the law on its own? =
The visible badge addresses the deployer's human-visible disclosure (Art. 50(4)); the embedded metadata addresses machine-readability. Both are on by default.

= Will it work with my theme? =
It hooks WordPress's own image and template filters — including `render_block` for block/FSE themes — so any theme using standard functions is covered. For themes that hardcode `<img>` tags, enable Universal badge coverage in Settings.

= Will it modify my files? =
When file embedding is on, it writes XMP into flagged image files (and every generated size). It is idempotent. Turn it off to use the visible badge + JSON-LD only.

= My host has no exiftool. =
JPEG and PNG are still marked by the built-in PHP writer. WebP and other formats need exiftool; the Metadata screen shows your current capability.

== Screenshots ==

1. The dashboard — live compliance stats, coverage by format, and automatic flagging.
2. Badge Studio — shapes, colours, position and a live preview.
3. The "AI Generated" badge on the front end — a real photo and its AI counterpart, side by side.
4. Tag your whole library from the dashboard — search, filter and set each image's type.
5. Embedded metadata and the compliance report export.
6. The badge in a blog post — the "AI Generated" mark rides with the image, on any theme.
7. EU AI Act readiness — your Article 50 disclosure score and the Article 4 AI-literacy checklist.
8. Two dashboard themes — the default Neo skin and a clean, WordPress-native Classic skin, switchable anytime.
9. Badge Studio in the Classic theme — the same twelve shapes, styles and live preview.

== Build ==

All of the plugin's PHP and its front-end scripts (`assets/js/*.js`) are hand-written, human-readable source with no build step. The one exception is the admin dashboard, a small React + TypeScript app whose compiled bundle ships as `dashboard/assets/app.js` and `dashboard/assets/app.css`.

The complete, human-readable source of that bundle is included in this package at `dashboard/src/` (a standalone Vite + React + TypeScript project: `src/*.tsx`, `package.json`, `vite.config.ts`, `tsconfig.json`). To rebuild, run `npm install` then `npm run build` inside `dashboard/src/`, and copy the resulting `dist/assets/app.js` and `app.css` into `dashboard/assets/`. Step-by-step notes are in `docs/BUILD.md`, also included.

Third-party libraries compiled into the bundle: React 18 and ReactDOM (MIT, https://github.com/facebook/react), lucide-react icons (ISC, https://github.com/lucide-icons/lucide), built with Vite (MIT). The bundled Geist / Geist Mono fonts are under the SIL OFL 1.1 (license text ships alongside them in `dashboard/assets/fonts/`). The badge artwork in `assets/eu-icons/` is the European Commission's official AI-content labelling icon set (© European Union, reused under CC BY 4.0 per Commission Decision 2011/833/EU — source, terms and modification notes in `assets/eu-icons/LICENSE.txt`). The sample scenes in `dashboard/assets/scenes/` are first-party artwork created for this plugin (AI-generated, and labelled as such where shown), licensed with the plugin under the GPL.

== Changelog ==

= 1.2.0 =
* New: a fresh default dashboard style ("Neo"), with a one-click toggle back to the original monochrome look — in Settings > Appearance or the palette button in the top bar. Both styles support light and dark mode. Fonts are bundled locally (Inter + Bricolage Grotesque, SIL OFL); the plugin still makes no external requests.
* New: the badge live preview now demonstrates the badge on bundled sample images (our own AI-generated artwork, labelled as such), with a small slider to switch scenes. Docs and Support links added to the dashboard sidebar.

= 1.1.0 =
* New: **AI-assistant (chatbot) disclosure** for EU AI Act Article 50(1) — tell visitors when they are interacting with an AI rather than a human. Drop the `[aicl_ai_notice]` shortcode into any page with a chat UI, or enable the optional floating notice that appears when a known chat widget is detected. Configurable disclosure text and position.

= 1.0.0 =
* Initial release: media flag, bulk actions, visible badge across Enfold/standard/block themes, optional universal badge coverage, IPTC/XMP embedding (exiftool + pure-PHP JPEG/PNG), JSON-LD, free CSV compliance export, React dashboard, opt-in transparency directory.

== Upgrade Notice ==

= 1.2.0 =
A new default dashboard style, with a toggle back to the classic look in Settings > Appearance.

= 1.1.0 =
Adds an AI-assistant (chatbot) disclosure for EU AI Act Article 50(1): the [aicl_ai_notice] shortcode and an optional floating notice telling visitors when they are talking to an AI, not a human.
