feat(admin): Prüfroute je Profil und Reiter „Compatibility“
Die generische CheckRoute (POST lit-mcp/v1/<id>-check, für Divi weiter /divi-check) ersetzt DiviCheckRoute: Lock je Profil mit Besitzer-Token, Bericht je Profil, Rücksprung auf den neuen Reiter und Hook lit_mcp_compat_changed (Divi lädt darauf seinen Freigabe-Status neu). Der Reiter „Compatibility“ zeigt je Plugin Zustand (Wort und Icon), Hinweis zur Stufe, Fähigkeiten, getestete und freigegebene Versionen und den letzten Bericht, mit Prüfen, Freigeben und Zurückziehen (Recht manage_options, Allowlist der Profil-ID, Nonce je Profil). Freigeben serverseitig nur mit frischem grünem Bericht. Der Load-Hook lit_mcp_compat_profile_load bereitet den Abbau des DiviTab vor, der bis dahin parallel läuft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7d6a97a54e
commit
85f4138b36
@@ -7,6 +7,7 @@ namespace LIT\MCP\Integrations\Divi;
|
||||
use Closure;
|
||||
use LIT\MCP\Abilities\Ability;
|
||||
use LIT\MCP\Abilities\ToolAvailability;
|
||||
use LIT\MCP\Admin\CheckRoute;
|
||||
use LIT\MCP\Admin\SettingsPage;
|
||||
use LIT\MCP\ChangeLog\ChangeLog;
|
||||
use LIT\MCP\Compatibility\CompatibilityCheck;
|
||||
@@ -75,7 +76,6 @@ use LIT\MCP\Integrations\Divi\Pages\DiviSaver;
|
||||
use LIT\MCP\Integrations\Divi\Pages\DiviUpdateAbility;
|
||||
use LIT\MCP\Integrations\Divi\Pages\DiviWriter;
|
||||
use LIT\MCP\Integrations\Divi\Pages\DynamicContentMap;
|
||||
use LIT\MCP\Integrations\Divi\Release\DiviCheckRoute;
|
||||
use LIT\MCP\Integrations\Divi\Release\FeatureOverview;
|
||||
use LIT\MCP\Integrations\Divi\Release\DiviProfile;
|
||||
use LIT\MCP\Integrations\Divi\Release\ReleaseGate;
|
||||
@@ -260,12 +260,18 @@ final class DiviIntegration implements Integration, Bootable, ProvidesCompatibil
|
||||
ReleaseGate::invalidate(mirrors: true);
|
||||
});
|
||||
|
||||
// Spec §6: the admin check runs as a REST request (same context as MCP calls). Its short form has no
|
||||
// Tools-tab gate: the check tests Divi, not this site's tool switches.
|
||||
// The admin check runs as a generic REST route (Admin\CheckRoute, registered by Plugin); a stored check or a
|
||||
// release changes the state, so the gate forgets its status of this request.
|
||||
add_action(CheckRoute::CHANGED_ACTION, static function (string $profileId): void {
|
||||
if ($profileId === DiviProfile::ID) {
|
||||
ReleaseGate::invalidate();
|
||||
}
|
||||
});
|
||||
|
||||
// Spec §7: the same check as WP-CLI command. Its short form has no Tools-tab gate: the check tests Divi,
|
||||
// not this site's tool switches.
|
||||
$profile = $this->profile();
|
||||
$check = static fn (): CompatibilityCheck => CompatibilityCheck::forProfile($profile);
|
||||
(new DiviCheckRoute($check))->register();
|
||||
DiviCheckCommand::register($check);
|
||||
DiviCheckCommand::register(static fn (): CompatibilityCheck => CompatibilityCheck::forProfile($profile));
|
||||
|
||||
add_filter(
|
||||
SettingsPage::TABS_FILTER,
|
||||
|
||||
Reference in New Issue
Block a user