Tokens are the units AI models use to measure input and output. Roughly 1 token ≈ ¾ of a word. Both the text you send (prompt tokens) and the text the AI returns (completion tokens) count toward your usage.
What does “limit = 0” mean?
A limit of 0 means unlimited — no cap is enforced. Set a positive number to restrict token usage.
How does AI Valve identify which plugin made an AI request?
It walks the PHP call stack (debug_backtrace()) and matches file paths against the plugins directory to determine the originating plugin slug.
Will this work with future WordPress updates?
Yes. AI Valve relies only on the stable public hooks (wp_ai_client_prevent_prompt, wp_ai_client_before_generate_result, wp_ai_client_after_generate_result) provided by the WordPress AI connector API.
Yes. Each subsite has its own log table, settings, and budgets.
What happens when a plugin is blocked?
The plugin receives a WP_Error with code prompt_prevented instead of an AI response. The denied request is logged with the reason. See how-blocking-works.md for the full explanation.
How do I block all plugins and only allow specific ones?
Go to Settings → AI Valve → Settings.
Set the Default policy to Deny.
Switch to the Dashboard tab.
In the Per-plugin access table, set the plugins you want to allow to Allow.
Only explicitly allowed plugins will be able to make AI requests; everything else is denied by default.
Changelog
1.1.6
Fixed: WordPress.org review issues by correcting repository URLs and restoring the ai-valve text domain.
1.1.5
Changed: Plugin-facing slugs, REST namespace, package metadata, docs, and admin UI prefixes from ai-valve to soderlind-aivalve.
Fixed: Plugin text domain now uses soderlind-aivalve consistently across PHP, JavaScript, and generated assets.
1.1.4
Fixed: WordPress.org plugin review prefix compliance by renaming plugin-owned namespaces, constants, hooks, options, cron events, database keys, and admin script globals to the unique soderlind_aivalve prefix.
Fixed: Migration and cleanup paths for existing aivalve/ai_valve installs while keeping active identifiers uniquely prefixed.
Changed: Readme tags for improved clarity and relevance.
1.1.3
Changed: Updated WordPress.org icons and banner.
Fixed: Improved compatibility with custom plugin directory layouts and unique plugin-owned identifiers.