refactor: Kern ohne Divi – Ports BuilderDetector, MediaUsageSource, EnvironmentComponent und ausgeschlossene Post-Typen im ContentSchema; Divi-Implementierungen und Verdrahtung über DiviIntegration/Plugin; CoreIndependenceTest

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-18 21:49:28 +02:00
co-authored by Claude Sonnet 5.5
parent abeb4b0eed
commit 06148fb8c1
33 changed files with 952 additions and 154 deletions
+9 -17
View File
@@ -4,19 +4,16 @@ declare(strict_types=1);
namespace LIT\MCP\Integrations\Core;
use LIT\MCP\Integrations\Divi\DiviCompatibility;
use LIT\MCP\Integrations\Divi\Release\DiviEnvironment;
use LIT\MCP\Integrations\Divi\Release\ReleaseGate;
defined('ABSPATH') || exit;
/**
* Detects the themes/plugins LIT MCP integrates with; for Divi also the internals that are missing
* (DiviCompatibility).
* Detects the themes/plugins LIT MCP integrates with: the components it is given (Divi, wired in Plugin) first, then
* Pods and The Events Calendar.
*/
class EnvironmentProbe
{
public function __construct(private ?DiviCompatibility $divi = null)
/** @param list<EnvironmentComponent> $components Components of integrations, reported in this order. */
public function __construct(private array $components = [])
{
}
@@ -26,19 +23,14 @@ class EnvironmentProbe
*/
public function components(): array
{
$diviVersion = DiviEnvironment::version();
$isDivi = $diviVersion !== null;
$tecActive = class_exists('Tribe__Events__Main');
$described = array_map(
static fn (EnvironmentComponent $component): array => $component->describe(),
$this->components
);
return [
[
'id' => 'divi',
'active' => $isDivi,
'version' => $diviVersion,
'problems' => $isDivi ? ($this->divi ?? new DiviCompatibility())->problems() : [],
'release' => $isDivi ? ReleaseGate::status()->toArray() : null,
],
...$described,
[
'id' => 'pods',
'active' => defined('PODS_VERSION'),