install(); (new ChangeLogCleanup($log, new Limits()))->ensureScheduled(); if (class_exists(OAuthBootstrap::class)) { // mcp-oauth's public API: rewrite its /oauth and /.well-known rules on the next init. OAuthBootstrap::schedule_rewrite_flush(); } } public static function deactivate(): void { wp_clear_scheduled_hook(ChangeLogCleanup::HOOK); delete_transient(ConnectionStatus::ENDPOINT_TRANSIENT); // WordPress regenerates the rules on the next request – without those of this now // inactive plugin. Calling flush_rewrite_rules() here instead would rewrite them // including our rules, because the plugin is still loaded during this request. delete_option('rewrite_rules'); } }