missing(); if ($missing !== []) { self::noticeMissing($missing); return; } (new Access())->register(); (new RequestContext())->register(); $limits = new Limits(); $changeLog = new ChangeLog(); (new ChangeLogInstaller($changeLog))->maybeInstall(); (new ChangeLogCleanup($changeLog, $limits))->register(); $schema = self::contentSchema(); $registry = new IntegrationRegistry( new CoreIntegration(self::pluginDir() . '/docs/guides'), new WordPressIntegration($schema, $changeLog), new MediaIntegration($schema, $changeLog, $limits) ); (new AbilityRegistrar($registry))->register(); (new ServerRegistrar( $registry, new InstructionsBuilder($registry, static fn (): array => $schema->postTypeNames()) ))->register(); \WPMedia\MCP\OAuth\Bootstrap::instance(); } public static function pluginDir(): string { return dirname(self::$pluginFile); } /** * @param list $missing */ public static function noticeMissing(array $missing): void { add_action('admin_notices', static function () use ($missing): void { printf( '

%s

', esc_html(sprintf( /* translators: %s: comma separated list of missing components */ __('WP-LIT-MCP ist inaktiv. Es fehlt: %s', 'wp-lit-mcp'), implode(', ', $missing) )) ); }); } private static function contentSchema(): ContentSchema { $sources = [new RegisteredMetaSource(), new SampledMetaSource()]; if (PodsFieldSource::isAvailable()) { array_unshift($sources, new PodsFieldSource()); } return new ContentSchema($sources); } }