container = new Container(); $this->register_services(); $loader = new Loader(); foreach ( array( 'cache_bootstrap', 'compatibility', 'compatibility_platform', 'page_builder_compatibility', 'forms_compatibility', 'multilingual_compatibility', 'hosting_compatibility', 'consent_compatibility', 'cdn_security_compatibility', 'selective_rollback', 'configuration_transactions', 'staging_validator', 'compatibility_matrix', 'job_worker', 'job_controller', 'wp_cli_jobs', 'invalidation_graph', 'per_page_controls', 'woocommerce_guard', 'woocommerce_performance', 'wordpress_bloat', 'image_dimensions', 'instant_page', 'script_manager', 'script_manager_admin', 'speculation_rules', 'asset_inventory', 'performance_budgets', 'runtime_reliability', 'runtime_config', 'page_cache', 'preload_queue', 'preload_controller', 'cache_maintenance', 'asset_optimizer', 'asset_bundle_compiler', 'script_loading', 'asset_health', 'optimization_controller', 'image_optimization', 'lcp_image_manager', 'html_media_optimizer', 'image_optimization_controller', 'third_party_optimization', 'media_delivery_controller', 'cdn_manager', 'adaptive_runtime_policy', 'server_optimization', 'settings_registry', 'settings_runtime_bridge', 'dashboard_controller', 'hub_panel', 'diagnostics_controller', 'operations_controller', 'tools_support_controller', 'operational_event_bridge', 'wp_cli_diagnostics', 'intelligence_controller', 'auto_performance_controller', 'automatic_rollback', 'smart_optimize_controller', 'release_controller', 'compatibility_remediation', 'system_status' ) as $service ) { $loader->add( $this->container->get( $service ) ); } $loader->register(); do_action( 'nbh_performance_loaded', $this->container ); } private function register_services() { $this->container->set( 'integration_registry', static function () { return new IntegrationRegistry(); } ); $this->container->set( 'compatibility_platform', static function ( Container $c ) { return new CompatibilityPlatform( $c->get( 'integration_registry' ) ); } ); $this->container->set( 'page_builder_compatibility', static function ( Container $c ) { return new EnterprisePageBuilderSupport( $c->get( 'integration_registry' ) ); } ); $this->container->set( 'forms_compatibility', static function ( Container $c ) { return new EnterpriseFormsSupport( $c->get( 'integration_registry' ) ); } ); $this->container->set( 'multilingual_compatibility', static function ( Container $c ) { return new MultilingualSupport( $c->get( 'integration_registry' ) ); } ); $this->container->set( 'hosting_compatibility', static function ( Container $c ) { return new HostingCompatibility( $c->get( 'integration_registry' ) ); } ); $this->container->set( 'consent_compatibility', static function ( Container $c ) { return new ConsentCompatibility( $c->get( 'integration_registry' ) ); } ); $this->container->set( 'cdn_security_compatibility', static function ( Container $c ) { return new CdnSecurityCompatibility( $c->get( 'integration_registry' ) ); } ); $this->container->set( 'plugin_detector', static function () { return new PluginDetector(); } ); $this->container->set( 'ownership_registry', static function ( Container $c ) { return new OwnershipRegistry( $c->get( 'plugin_detector' ) ); } ); $this->container->set( 'compatibility_diagnosis', static function ( Container $c ) { return new ConflictDiagnosis( $c->get( 'plugin_detector' ), $c->get( 'ownership_registry' ) ); } ); $this->container->set( 'dropin_installer', static function () { return new DropInInstaller(); } ); $this->container->set( 'compatibility_remediation', static function ( Container $c ) { return new CompatibilityRemediationManager( $c->get( 'compatibility_diagnosis' ), $c->get( 'plugin_detector' ), $c->get( 'dropin_installer' ) ); } ); $this->container->set( 'compatibility', static function ( Container $c ) { return new CompatibilityManager( $c->get( 'ownership_registry' ) ); } ); $this->container->set( 'selective_rollback', static function ( Container $c ) { return new SelectiveRollbackManager( $c->get( 'compatibility_diagnosis' ) ); } ); $this->container->set( 'job_store', static function () { return new JobStore(); } ); $this->container->set( 'job_queue', static function ( Container $c ) { return new JobQueue( $c->get( 'job_store' ) ); } ); $this->container->set( 'runtime_reliability', static function ( Container $c ) { return new RuntimeReliabilityManager( $c->get( 'job_queue' ) ); } ); $this->container->set( 'configuration_transactions', static function ( Container $c ) { return new ConfigurationTransactionManager( $c->get( 'job_queue' ), $c->get( 'feature_toggles' ), $c->get( 'advanced_settings' ) ); } ); $this->container->set( 'staging_validator', static function () { return new StagingValidator(); } ); $this->container->set( 'compatibility_matrix', static function ( Container $c ) { return new CompatibilityTestMatrix( $c->get( 'compatibility_diagnosis' ), $c->get( 'job_queue' ) ); } ); $this->container->set( 'wordpress_bloat', static function () { return new WordPressBloatManager(); } ); $this->container->set( 'image_dimensions', static function () { return new ImageDimensionManager(); } ); $this->container->set( 'instant_page', static function () { return new InstantPageManager(); } ); $this->container->set( 'asset_rule_matcher', static function () { return new AssetRuleMatcher(); } ); $this->container->set( 'asset_dependency_graph', static function () { return new AssetDependencyGraph(); } ); $this->container->set( 'script_manager_rule_store', static function () { return new ScriptManagerRuleStore(); } ); $this->container->set( 'script_manager', static function ( Container $c ) { return new ScriptManager( $c->get( 'asset_rule_matcher' ), $c->get( 'asset_dependency_graph' ), $c->get( 'script_manager_rule_store' ) ); } ); $this->container->set( 'script_manager_admin', static function () { return new ScriptManagerAdminPage(); } ); $this->container->set( 'speculation_rules', static function () { return new SpeculationRulesManager(); } ); $this->container->set( 'asset_inventory', static function ( Container $c ) { return new AssetInventoryController( $c->get( 'asset_dependency_graph' ) ); } ); $this->container->set( 'performance_budgets', static function () { return new PerformanceBudgetManager(); } ); $this->container->set( 'unified_metrics', static function ( Container $c ) { return new UnifiedMetricsService(); } ); $this->container->set( 'cache_bootstrap', static function () { return new CacheBootstrapManager(); } ); $this->container->set( 'request_eligibility', static function () { return new RequestEligibility(); } ); $this->container->set( 'cache_writer', static function () { return new CacheWriter(); } ); $this->container->set( 'cache_index', static function () { return new CacheIndex(); } ); $this->container->set( 'cache_variants', static function () { return new CacheVariantResolver(); } ); $this->container->set( 'cache_lock', static function () { return new CacheLock(); } ); $this->container->set( 'cache_response_metadata', static function () { return new CacheResponseMetadata(); } ); $this->container->set( 'shared_hosting', static function () { return new SharedHostingAwareness(); } ); $this->container->set( 'sitemaps', static function () { return new SitemapDiscovery(); } ); $this->container->set( 'preload_runs', static function () { return new PreloadRunStore(); } ); $this->container->set( 'preload_queue', static function ( Container $c ) { return new PreloadQueue( $c->get( 'shared_hosting' ), $c->get( 'sitemaps' ), $c->get( 'job_queue' ), $c->get( 'preload_runs' ) ); } ); $this->container->set( 'preload_controller', static function ( Container $c ) { return new PreloadController( $c->get( 'preload_queue' ), $c->get( 'sitemaps' ), $c->get( 'preload_runs' ) ); } ); $this->container->set( 'runtime_config', static function () { return new RuntimeConfigManager(); } ); $this->container->set( 'cache_maintenance', static function ( Container $c ) { return new CacheMaintenance( $c->get( 'cache_index' ) ); } ); $this->container->set( 'page_cache', static function ( Container $c ) { return new PageCacheManager( $c->get( 'compatibility' ), $c->get( 'request_eligibility' ), $c->get( 'cache_writer' ), $c->get( 'cache_index' ), $c->get( 'cache_variants' ), $c->get( 'preload_queue' ), $c->get( 'cache_lock' ), $c->get( 'cache_response_metadata' ) ); } ); $this->container->set( 'cache_invalidation_handler', static function ( Container $c ) { return new CacheInvalidationJobHandler( $c->get( 'cache_index' ), $c->get( 'page_cache' ), $c->get( 'job_queue' ) ); } ); $this->container->set( 'warm_url_handler', static function ( Container $c ) { return new WarmUrlJobHandler( $c->get( 'preload_runs' ) ); } ); $this->container->set( 'staging_validation_handler', static function ( Container $c ) { return new StagingValidationJobHandler( $c->get( 'staging_validator' ), $c->get( 'configuration_transactions' ) ); } ); $this->container->set( 'compatibility_scan_handler', static function ( Container $c ) { return new CompatibilityScanJobHandler( $c->get( 'compatibility_matrix' ) ); } ); $this->container->set( 'job_worker', static function ( Container $c ) { return new JobWorker( $c->get( 'job_store' ), array( $c->get( 'cache_invalidation_handler' ), $c->get( 'warm_url_handler' ), $c->get( 'staging_validation_handler' ), $c->get( 'compatibility_scan_handler' ), $c->get( 'image_optimization_job_handler' ) ) ); } ); $this->container->set( 'job_controller', static function ( Container $c ) { return new JobController( $c->get( 'job_store' ), $c->get( 'job_worker' ) ); } ); $this->container->set( 'wp_cli_jobs', static function ( Container $c ) { return new WpCliJobs( $c->get( 'job_store' ), $c->get( 'job_worker' ) ); } ); $this->container->set( 'invalidation_graph', static function ( Container $c ) { return new InvalidationGraph( $c->get( 'job_queue' ) ); } ); $this->container->set( 'per_page_controls', static function ( Container $c ) { return new PerPageControls( $c->get( 'job_queue' ) ); } ); $this->container->set( 'woocommerce_guard', static function ( Container $c ) { return new WooCommerceGuard( $c->get( 'job_queue' ) ); } ); $this->container->set( 'woocommerce_performance', static function ( Container $c ) { return new WooCommercePerformanceManager( $c->get( 'job_queue' ) ); } ); $this->container->set( 'asset_resolver', static function () { return new AssetUrlResolver(); } ); $this->container->set( 'css_minifier', static function () { return new CssMinifier(); } ); $this->container->set( 'js_minifier', static function () { return new JsMinifier(); } ); $this->container->set( 'asset_cache', static function () { return new AssetCache(); } ); $this->container->set( 'asset_exclusions', static function () { return new OptimizationExclusions(); } ); $this->container->set( 'file_combiner', static function () { return new FileCombiner(); } ); $this->container->set( 'script_compatibility', static function () { return new ScriptCompatibilityRegistry(); } ); $this->container->set( 'script_loading', static function ( Container $c ) { return new ScriptLoadingManager( $c->get( 'script_compatibility' ) ); } ); $this->container->set( 'asset_health', static function () { return new AssetHealthMonitor(); } ); $this->container->set( 'asset_optimizer', static function ( Container $c ) { return new AssetOptimizer( $c->get( 'asset_resolver' ), $c->get( 'css_minifier' ), $c->get( 'js_minifier' ), $c->get( 'asset_cache' ), $c->get( 'asset_exclusions' ), $c->get( 'file_combiner' ) ); } ); $this->container->set( 'asset_manifest_store', static function () { return new AssetManifestStore(); } ); $this->container->set( 'asset_compilation_lock', static function () { return new AssetCompilationLock(); } ); $this->container->set( 'css_url_rewriter', static function ( Container $c ) { return new CssUrlRewriter( $c->get( 'asset_resolver' ) ); } ); $this->container->set( 'asset_bundle_compiler', static function ( Container $c ) { return new AssetBundleCompiler( $c->get( 'asset_resolver' ), $c->get( 'asset_cache' ), $c->get( 'css_minifier' ), $c->get( 'js_minifier' ), $c->get( 'css_url_rewriter' ), $c->get( 'asset_exclusions' ), $c->get( 'file_combiner' ), $c->get( 'asset_manifest_store' ), $c->get( 'asset_compilation_lock' ) ); } ); $this->container->set( 'optimization_controller', static function ( Container $c ) { return new OptimizationController( $c->get( 'asset_optimizer' ), $c->get( 'asset_bundle_compiler' ), $c->get( 'asset_health' ) ); } ); $this->container->set( 'image_process_runner', static function () { return new SafeProcessRunner(); } ); $this->container->set( 'image_processors', static function ( Container $c ) { return new ImageProcessorRegistry( $c->get( 'image_process_runner' ) ); } ); $this->container->set( 'image_output_validator', static function () { return new ImageOutputValidator(); } ); $this->container->set( 'image_profile', static function () { return new ImageOptimizationProfile(); } ); $this->container->set( 'image_offload_guard', static function () { return new MediaOffloadGuard(); } ); $this->container->set( 'image_batch_manager', static function ( Container $c ) { return new ImageBatchManager( $c->get( 'job_queue' ) ); } ); $this->container->set( 'image_converter', static function ( Container $c ) { return new WebpAvifConverter( $c->get( 'image_processors' ), $c->get( 'image_output_validator' ), $c->get( 'image_profile' ) ); } ); $this->container->set( 'image_pipeline', static function ( Container $c ) { return new ImageOptimizationPipeline( $c->get( 'image_converter' ) ); } ); $this->container->set( 'image_optimization_job_handler', static function ( Container $c ) { return new ImageOptimizationJobHandler( $c->get( 'image_pipeline' ), $c->get( 'image_batch_manager' ) ); } ); $this->container->set( 'image_variant_server', static function () { return new ImageVariantServer(); } ); $this->container->set( 'lazy_load', static function () { return new LazyLoadManager(); } ); $this->container->set( 'responsive_images', static function () { return new ResponsiveImageGenerator(); } ); $this->container->set( 'image_optimization', static function ( Container $c ) { return new ImageOptimizationManager( $c->get( 'image_pipeline' ), $c->get( 'image_variant_server' ), $c->get( 'lazy_load' ), $c->get( 'responsive_images' ) ); } ); $this->container->set( 'lcp_image_manager', static function () { return new LcpImageManager(); } ); $this->container->set( 'html_media_optimizer', static function () { return new HtmlMediaOptimizer(); } ); $this->container->set( 'image_optimization_controller', static function ( Container $c ) { return new ImageOptimizationController( $c->get( 'image_pipeline' ), $c->get( 'image_processors' ), $c->get( 'job_queue' ), $c->get( 'image_batch_manager' ), $c->get( 'image_profile' ), $c->get( 'image_offload_guard' ) ); } ); $this->container->set( 'third_party_consent', static function () { return new ConsentManager(); } ); $this->container->set( 'consent_script_guard', static function ( Container $c ) { return new ConsentScriptGuard( $c->get( 'third_party_consent' ) ); } ); $this->container->set( 'youtube_facade', static function ( Container $c ) { return new YouTubeFacade( $c->get( 'third_party_consent' ) ); } ); $this->container->set( 'chat_facade', static function ( Container $c ) { return new ChatWidgetFacade( $c->get( 'third_party_consent' ) ); } ); $this->container->set( 'third_party_optimization', static function ( Container $c ) { return new ThirdPartyOptimizationManager( $c->get( 'consent_script_guard' ), $c->get( 'youtube_facade' ), $c->get( 'chat_facade' ) ); } ); $this->container->set( 'media_delivery_controller', static function () { return new MediaDeliveryController(); } ); $this->container->set( 'cdn_rewriter', static function () { return new CdnUrlRewriter(); } ); $this->container->set( 'resource_hints', static function () { return new ResourceHintInjector(); } ); $this->container->set( 'cloudflare', static function () { return new CloudflareApiClient(); } ); $this->container->set( 'bunnycdn', static function () { return new BunnyCdnClient(); } ); $this->container->set( 'keycdn', static function () { return new KeyCdnClient(); } ); $this->container->set( 'custom_cdn', static function () { return new CustomCdnClient(); } ); $this->container->set( 'cdn_manager', static function ( Container $c ) { return new CdnManager( array( 'cloudflare' => $c->get( 'cloudflare' ), 'bunnycdn' => $c->get( 'bunnycdn' ), 'keycdn' => $c->get( 'keycdn' ), 'custom' => $c->get( 'custom_cdn' ), ), $c->get( 'cdn_rewriter' ), $c->get( 'resource_hints' ) ); } ); $this->container->set( 'compression_detector', static function () { return new CompressionDetector(); } ); $this->container->set( 'protocol_detector', static function () { return new ProtocolDetector(); } ); $this->container->set( 'hosting_intelligence', static function () { return new HostingIntelligence(); } ); $this->container->set( 'hosting_environment', static function () { return new HostingEnvironmentDetector(); } ); $this->container->set( 'adaptive_runtime_policy', static function ( Container $c ) { return new AdaptiveRuntimePolicy( $c->get( 'hosting_environment' ) ); } ); $this->container->set( 'server_guidance', static function () { return new ServerGuidance(); } ); $this->container->set( 'heartbeat_controller', static function () { return new HeartbeatController(); } ); $this->container->set( 'server_report', static function ( Container $c ) { return new ServerCapabilityReport( $c->get( 'compression_detector' ), $c->get( 'protocol_detector' ), $c->get( 'hosting_intelligence' ), $c->get( 'server_guidance' ), $c->get( 'hosting_environment' ) ); } ); $this->container->set( 'server_optimization', static function ( Container $c ) { return new ServerOptimizationManager( $c->get( 'heartbeat_controller' ), $c->get( 'server_report' ) ); } ); $this->container->set( 'feature_toggles', static function () { return new FeatureToggleManager(); } ); $this->container->set( 'advanced_settings', static function () { return new AdvancedSettingsManager(); } ); $this->container->set( 'safe_mode_manager', static function ( Container $c ) { return new SafeModeManager( $c->get( 'feature_toggles' ) ); } ); $this->container->set( 'conflict_reporter', static function ( Container $c ) { return new ConflictReporter( $c->get( 'compatibility_diagnosis' ) ); } ); $this->container->set( 'settings_registry', static function () { return new SettingsRegistry(); } ); $this->container->set( 'settings_runtime_bridge', static function () { return new SettingsRuntimeBridge(); } ); $this->container->set( 'product_quality', static function ( Container $c ) { return new ProductQualityManager( $c->get( 'page_cache' ), $c->get( 'safe_mode_manager' ), $c->get( 'ownership_registry' ) ); } ); $this->container->set( 'dashboard_controller', static function ( Container $c ) { return new DashboardController( $c->get( 'feature_toggles' ), $c->get( 'advanced_settings' ), $c->get( 'safe_mode_manager' ), $c->get( 'conflict_reporter' ), $c->get( 'compatibility_remediation' ), $c->get( 'product_quality' ) ); } ); $this->container->set( 'hub_panel', static function ( Container $c ) { return new HubPanelRegistrar( $c->get( 'page_cache' ) ); } ); $this->container->set( 'readiness_scanner', static function () { return new ProductionReadinessScanner(); } ); $this->container->set( 'operational_logger', static function () { return new OperationalLogger(); } ); $this->container->set( 'operations_health', static function () { return new OperationsHealthMonitor(); } ); $this->container->set( 'recovery_runbook', static function () { return new RecoveryRunbook(); } ); $this->container->set( 'support_report_exporter', static function ( Container $c ) { return new SupportReportExporter( $c->get( 'readiness_scanner' ), $c->get( 'operations_health' ), $c->get( 'operational_logger' ), $c->get( 'recovery_runbook' ) ); } ); $this->container->set( 'diagnostics_controller', static function ( Container $c ) { return new DiagnosticsController( $c->get( 'readiness_scanner' ), $c->get( 'support_report_exporter' ) ); } ); $this->container->set( 'operations_controller', static function ( Container $c ) { return new OperationsController( $c->get( 'operations_health' ), $c->get( 'operational_logger' ) ); } ); $this->container->set( 'tools_support_controller', static function ( Container $c ) { return new ToolsSupportController( $c->get( 'operations_health' ), $c->get( 'operational_logger' ), $c->get( 'product_quality' ), $c->get( 'job_store' ) ); } ); $this->container->set( 'operational_event_bridge', static function ( Container $c ) { return new OperationalEventBridge( $c->get( 'operational_logger' ) ); } ); $this->container->set( 'wp_cli_diagnostics', static function ( Container $c ) { return new WpCliDiagnostics( $c->get( 'readiness_scanner' ), $c->get( 'support_report_exporter' ), $c->get( 'operations_health' ), $c->get( 'operational_logger' ) ); } ); $this->container->set( 'recommendation_engine', static function ( Container $c ) { return new RecommendationEngine( $c->get( 'server_report' ), $c->get( 'compatibility_diagnosis' ) ); } ); $this->container->set( 'impact_tracker', static function () { return new ImpactTracker(); } ); $this->container->set( 'intelligence_controller', static function ( Container $c ) { return new IntelligenceController( $c->get( 'recommendation_engine' ), $c->get( 'impact_tracker' ), $c->get( 'selective_rollback' ) ); } ); $this->container->set( 'auto_performance_controller', static function ( Container $c ) { return new AutoPerformanceController( $c->get( 'feature_toggles' ), $c->get( 'advanced_settings' ), $c->get( 'safe_mode_manager' ) ); } ); $this->container->set( 'smart_optimize_plan', static function ( Container $c ) { return new SmartOptimizePlanBuilder( $c->get( 'server_report' ), $c->get( 'compatibility_diagnosis' ), $c->get( 'unified_metrics' ), $c->get( 'recommendation_engine' ) ); } ); $this->container->set( 'performance_report', static function ( Container $c ) { return new PerformanceReportService( $c->get( 'unified_metrics' ) ); } ); $this->container->set( 'automatic_rollback', static function ( Container $c ) { return new AutomaticRollbackManager( $c->get( 'configuration_transactions' ), $c->get( 'staging_validator' ), $c->get( 'security_audit' ) ); } ); $this->container->set( 'smart_optimize_controller', static function ( Container $c ) { return new SmartOptimizeController( $c->get( 'smart_optimize_plan' ), $c->get( 'feature_toggles' ), $c->get( 'advanced_settings' ), $c->get( 'configuration_transactions' ), $c->get( 'safe_mode_manager' ), $c->get( 'job_queue' ), $c->get( 'performance_report' ), $c->get( 'automatic_rollback' ) ); } ); $this->container->set( 'data_retention_policy', static function () { return new DataRetentionPolicy(); } ); $this->container->set( 'release_controller', static function ( Container $c ) { return new ReleaseController( $c->get( 'data_retention_policy' ) ); } ); $this->container->set( 'security_audit', static function () { return new AuditLogger(); } ); $this->container->set( 'system_status', static function ( Container $c ) { return new SystemStatus( $c->get( 'compatibility_remediation' ), $c->get( 'dropin_installer' ) ); } ); } }