| 开发者 | codevera |
|---|---|
| 更新时间 | 2026年5月13日 21:15 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
wp_register_ability() and records which plugin made the call.wp_register_ability_args, wp_abilities_api_init, wp_unregister_abilitydebug_backtrace() of the file that called wp_register_ability, normalised to a plugin slugCVAIAC_SECRET constant or AUTH_SALT fallbackwp_options/wp-content/plugins/ directorywp-config.php to use a dedicated secret for the settings signature, rather than reusing AUTH_SALT:
define( 'CVAIAC_SECRET', 'some-long-random-string-that-only-you-know' );
This makes it harder for an attacker who only has database access to forge a valid settings blob.
After activation:
No. It reads only local WordPress data and never contacts any third-party service. No telemetry, no analytics, no licence checks.
No. It stores only your allow and block selections and a short list of plugin and ability identifiers in the WordPress options table.
Two layers. First, on the wp_register_ability_args filter at the highest priority, the plugin rewrites the execute_callback and permission_callback of any blocked ability to return a cvaiac_blocked WP_Error. This neutralises the ability before WordPress even constructs it. Second, on the wp_abilities_api_init action at the highest priority, the plugin walks the registry and calls wp_unregister_ability() on anything blocked, so it disappears from the listings entirely.
You can block individual core abilities, but the WordPress core group as a whole cannot be blocked. Blocking individual core abilities can prevent the AI feature from working correctly, so do it with care.
The settings option is stored as a JSON payload with an HMAC-SHA256 signature, keyed to a CVAIAC_SECRET constant or AUTH_SALT. Each time the plugin reads the option, the signature is recomputed and checked. If it does not match, the plugin enters fail-closed mode and blocks every non-core ability until an administrator re-saves the settings through the UI. A red banner appears on the settings screen explaining what happened.
A malicious or buggy plugin running on the same site can call update_option( 'cvaiac_settings', array() ) to wipe your block list. With tamper detect, that write produces an invalid signature, the plugin notices, and the AI feature loses access to every plugin's abilities until you investigate and re-save.
A determined plugin with code execution on the same site can in principle override the pre_option_cvaiac_settings filter, remove the enforcement hooks, or read CVAIAC_SECRET from wp-config.php to forge a valid signature. This plugin defends against opportunistic interference, not against a fully hostile plugin in the same PHP process. Treat it as a policy and tamper-detect tool, not a security boundary. The safest practice is still to only install plugins you trust.
Yes. Settings are stored per-site, so each sub-site can have its own allow and block list.
Yes. Blocked abilities are unregistered from the registry, so the WordPress core REST run endpoint cannot find or execute them.
All of the plugin's options are deleted by uninstall.php. No data is left behind.
Yes. The text domain is codevera-ai-access-control. PO files can be generated with WP-CLI or any standard translation tool.
Enable WP_DEBUG and WP_DEBUG_LOG in wp-config.php. The plugin uses only standard WordPress APIs, so any issue will appear in the standard debug log.
cvaiac_settings are detected. A failed check puts the plugin into fail-closed mode and shows a red banner until an administrator re-saves the settingsCVAIAC_SECRET constant for sites that want a dedicated signing key in wp-config.php rather than the AUTH_SALT fallbackwp_register_ability_args so blocked abilities are neutralised before WordPress constructs them, closing a same-priority race where another plugin could re-register a blocked ability at PHP_INT_MAXwp_register_ability rather than the first plugin-dir frame on the stack, so core abilities are correctly attributed to "core" even when a plugin's code triggers the lazy registry initwp_register_ability_args filter and debug_backtrace()wp_abilities_api_init to unregister blocked abilities