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>
54 lines
2.1 KiB
PHP
54 lines
2.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace LIT\MCP\Integrations\Divi\Release;
|
|
|
|
use Closure;
|
|
use LIT\MCP\Compatibility\Profile;
|
|
use LIT\MCP\Compatibility\Tier;
|
|
use LIT\MCP\Integrations\Divi\Schema\DiviModules;
|
|
use LIT\MCP\Integrations\Divi\Schema\ShortformCheck;
|
|
use LIT\MCP\Integrations\WordPress\Content\ContentComposer;
|
|
use LogicException;
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
/** Divi as a compatibility profile: every version needs a release, the matrix comes from the release gate. */
|
|
final class DiviProfile
|
|
{
|
|
public const ID = 'divi';
|
|
public const LABEL = 'Divi';
|
|
/** Stored reports and release rows keep this key, so data from before the generic layer stays readable. */
|
|
public const REPORT_VERSION_KEY = 'divi_version';
|
|
|
|
/** @param (Closure(): ContentComposer)|null $composer The write test's composer; without it that step fails. */
|
|
public static function profile(?Closure $composer = null): Profile
|
|
{
|
|
return new Profile(
|
|
id: self::ID,
|
|
label: self::LABEL,
|
|
tier: Tier::ReleasePerVersion,
|
|
capabilities: DiviFeature::cases(),
|
|
manifests: array_values(DiviAdapters::manifests()),
|
|
active: static fn (): bool => DiviEnvironment::version() !== null,
|
|
version: DiviEnvironment::version(...),
|
|
matrix: static fn () => ReleaseGate::status()->matrix,
|
|
testedVersions: DiviReleases::TESTED,
|
|
stateKey: ReleaseResolver::stateKey(...),
|
|
extraSteps: DiviCheckSteps::extra(
|
|
static fn (): array => DiviModules::isAvailable()
|
|
? ShortformCheck::problems((new DiviModules())->catalog())
|
|
: ['Divi 5 ist in dieser Anfrage nicht geladen.'],
|
|
new FormatCheck(),
|
|
static fn (): array => (new WriteProbe(
|
|
$composer === null ? throw new LogicException('no composer for the write test') : $composer()
|
|
))->run()
|
|
),
|
|
manifestCheck: DiviManifestCheck::create(...),
|
|
stepLabel: DiviCheckSteps::label(...),
|
|
reportVersionKey: self::REPORT_VERSION_KEY
|
|
);
|
|
}
|
|
}
|