feat: Divi tab with REST check, release and withdrawal

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-30 02:39:21 +02:00
co-authored by Claude Opus 5.5
parent 47040aa43d
commit 6113e5ad5a
13 changed files with 849 additions and 18 deletions
+18 -11
View File
@@ -7,19 +7,21 @@ namespace LIT\MCP;
defined('ABSPATH') || exit;
/**
* Removes WP-LIT-MCP's own data (uninstall.php, Task 12): options, the endpoint-check
* transient, the log-cleanup cron hook and the change log table – on every site of a
* network – and the Protokoll tab's per-user screen option.
* Removes WP-LIT-MCP's own data (uninstall.php, Task 12): options, the endpoint-check and
* Divi-release transients, the log-cleanup cron hook and the change log table – on every
* site of a network – and the Protokoll tab's per-user screen option.
*
* Deliberately self-contained (no reference to any other LIT\MCP\* class): uninstall.php
* is executed by WordPress core standalone, without loading the plugin's main file first,
* so the Composer/Jetpack autoloader is not guaranteed to have run. The option/hook/table
* names below are therefore duplicated from Access::OPTION, Abilities\ExposurePolicy::OPTION,
* Limits::OPTION, ChangeLog\ChangeLogInstaller::VERSION_OPTION, Admin\ConnectionStatus::
* ENDPOINT_TRANSIENT, ChangeLog\ChangeLogCleanup::HOOK, ChangeLog\ChangeLog::TABLE and
* Admin\LogTab::PER_PAGE_OPTION on
* purpose; tests/Unit/UninstallerTest.php and tests/Unit/UninstallTest.php keep them in
* sync with those constants.
* Limits::OPTION, ChangeLog\ChangeLogInstaller::VERSION_OPTION, Integrations\Divi\Release\
* ReleaseStore::OPTION, Integrations\Divi\Release\CheckReportStore::OPTION, Integrations\
* Divi\Release\DiviCheckRoute::LOCK, Admin\ConnectionStatus::ENDPOINT_TRANSIENT,
* Integrations\Divi\Release\ReleaseResolver::CACHE, ChangeLog\ChangeLogCleanup::HOOK,
* ChangeLog\ChangeLog::TABLE and Admin\LogTab::PER_PAGE_OPTION on purpose;
* tests/Unit/UninstallerTest.php and tests/Unit/UninstallTest.php keep them in sync with
* those constants.
*
* Never touches the bundled wp-media/mcp-oauth library's data (option mcp_jwt_secret,
* option wpmedia_mcp_oauth_rewrite_version, user meta mcp_refresh_jti_*, application
@@ -28,8 +30,11 @@ defined('ABSPATH') || exit;
*/
final class Uninstaller
{
private const OPTIONS = ['lit_mcp_allowed_roles', 'lit_mcp_exposure', 'lit_mcp_limits', 'lit_mcp_db_version'];
private const TRANSIENT = 'lit_mcp_endpoint_check';
private const OPTIONS = [
'lit_mcp_allowed_roles', 'lit_mcp_exposure', 'lit_mcp_limits', 'lit_mcp_db_version',
'lit_mcp_divi_releases', 'lit_mcp_divi_check_report', 'lit_mcp_divi_check_lock',
];
private const TRANSIENTS = ['lit_mcp_endpoint_check', 'lit_mcp_divi_state'];
private const CRON_HOOK = 'lit_mcp_log_cleanup';
private const TABLE = 'lit_mcp_log';
@@ -61,7 +66,9 @@ final class Uninstaller
foreach (self::OPTIONS as $option) {
delete_option($option);
}
delete_transient(self::TRANSIENT);
foreach (self::TRANSIENTS as $transient) {
delete_transient($transient);
}
wp_clear_scheduled_hook(self::CRON_HOOK);
$table = $wpdb->prefix . self::TABLE;