| 开发者 | PerS |
|---|---|
| 更新时间 | 2026年8月7日 01:16 |
| PHP版本: | 8.3 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
aivalve_plugin_policy (filter) — Override the allow/deny decision for any plugin.aivalve_request_denied (action) — React when an AI request is blocked.aivalve_request_completed (action) — React when an AI request succeeds (token counts available).aivalve_ability_invoked (action) — React when an Abilities API call is invoked (WP 7.1+).aivalve_ability_denied (action) — React when an Abilities API call is blocked (WP 7.1+).soderlind_aivalve_ prefix; the old names still fire as deprecated aliases and will be removed in a future major version.
soderlind-aivalve.zip via Plugins → Add New → Upload Plugin.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.
A limit of 0 means unlimited — no cap is enforced. Set a positive number to restrict token usage.
It walks the PHP call stack (debug_backtrace()) and matches file paths against the plugins directory to determine the originating plugin slug.
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. See the developer hooks documentation for available filters and actions.
On WordPress 7.1+, AI Valve can optionally enforce the same allow/deny/budget policy on the WordPress Abilities API. Enable Guard Abilities API in Settings; denied ability calls are logged and shown with an "Ability" badge in the Logs tab. The ability namespace is used as the policy subject, so per-plugin rules apply to abilities too. See the developer hooks documentation for the related hooks.
Yes. Each subsite has its own log table, settings, and budgets.
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.
aivalve_ prefix (e.g. aivalve_plugin_policy). The old soderlind_aivalve_ names still fire as deprecated aliases and will be removed in a future major version.ai-valve text domain.ai-valve to soderlind-aivalve.soderlind-aivalve consistently across PHP, JavaScript, and generated assets.soderlind_aivalve prefix.aivalve/ai_valve installs while keeping active identifiers uniquely prefixed.soderlind_aivalve_plugin_policy filter to override allow/deny policy programmatically.soderlind_aivalve_request_denied action, fired when a request is blocked.soderlind_aivalve_request_completed action, fired after every successful request.GET /settings for reading all plugin settings.by_context, recent, and known_slugs fields in the GET /usage response.date_from and date_to filter parameters on the GET /logs endpoint.wp_supports_ai filter as a global kill switch.