feat: site-status test tool and core integration
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Integrations\Core;
|
||||
|
||||
/**
|
||||
* Detects the themes/plugins LIT MCP integrates with.
|
||||
*/
|
||||
class EnvironmentProbe
|
||||
{
|
||||
/** @return list<array{id: string, active: bool, version: ?string}> */
|
||||
public function components(): array
|
||||
{
|
||||
$theme = wp_get_theme();
|
||||
$isDivi = $theme->get_template() === 'Divi';
|
||||
$parent = $theme->parent();
|
||||
$diviVersion = $isDivi ? (string) ($parent ? $parent->get('Version') : $theme->get('Version')) : null;
|
||||
|
||||
$tecActive = class_exists('Tribe__Events__Main');
|
||||
|
||||
return [
|
||||
['id' => 'divi', 'active' => $isDivi, 'version' => $diviVersion],
|
||||
[
|
||||
'id' => 'pods',
|
||||
'active' => defined('PODS_VERSION'),
|
||||
'version' => defined('PODS_VERSION') ? (string) PODS_VERSION : null,
|
||||
],
|
||||
[
|
||||
'id' => 'the-events-calendar',
|
||||
'active' => $tecActive,
|
||||
'version' => $tecActive ? (string) constant('Tribe__Events__Main::VERSION') : null,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user