Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/zirkeldesign/ai-image-disclosure/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Labels AI-generated images in WordPress with a small, accessible badge. CSS only, no frontend JavaScript; recognises AI images from IPTC and C2PA metadata on upload. The wordpress.org description is in readme.txt.
How it works
- Marking lives on the attachment (
_aiid_generated), so every place the image is used follows it._aiid_positionis stored only when a corner is picked; everything else follows the site default (aiid_position)._aiid_sourcerecords where the marking came from:manual,iptc,c2pa,filename. - Detection (
src/Detection/Provenance.php) looks for the IPTC Digital Source TypetrainedAlgorithmicMediaorcompositeWithTrainedAlgorithmicMedia, either in an XMP packet or inside a C2PA manifest. PlainalgorithmicMediaand camera captures do not count. - Output (
src/Frontend/Badge.php) changes only the rendered block: classeshas-aiid-badge aiid--<corner>on the element framing the image, anaria-hiddenbadge before the image, and the label appended to a non-empty alt text. Saved content is never touched. - Placement is CSS only (
assets/css/badge.css):inset: var(--aiid-inset)inside the frame,--aiid-gapfor the distance to the edge, custom properties for the look.
Not covered on purpose: images a theme prints outside of blocks, page builder backgrounds, writing metadata into files.
Development
composer install
composer test # Pest, pure logic
composer phpstan # level 6
composer format:test # Pint
composer integration # end-to-end in a throwaway WordPress (SQLite)
composer pcp # Plugin Check on the built zip
bun run translate # .pot, update .po, compile .mo
Commits follow gitmoji, see AGENTS.md.