check_dependencies() ) { return; } $this->log_parser = new Log_Parser(); $this->ai_client = new AI_Client(); $this->analysis_engine = new Analysis_Engine( $this->ai_client ); $this->log_integration = new Log_Integration( $this->analysis_engine, $this->log_parser, $this->ai_client ); $this->admin_interface = new Admin_Interface(); $this->register_hooks(); } /** * Checks all required dependencies. Adds admin notices for any failures. * * @return bool True if all dependencies are satisfied. */ private function check_dependencies(): bool { $errors = array(); if ( ! class_exists( 'WooCommerce' ) ) { $errors[] = __( 'AI Log Analyzer for WooCommerce requires WooCommerce to be installed and active.', 'ai-log-analyzer-for-woocommerce' ); } if ( version_compare( get_bloginfo( 'version' ), '7.0', '<' ) ) { $errors[] = __( 'AI Log Analyzer for WooCommerce requires WordPress 7.0 or higher.', 'ai-log-analyzer-for-woocommerce' ); } if ( version_compare( PHP_VERSION, '8.0', '<' ) ) { $errors[] = sprintf( /* translators: %s: Current PHP version number. */ __( 'AI Log Analyzer for WooCommerce requires PHP 8.0 or higher. You are running PHP %s.', 'ai-log-analyzer-for-woocommerce' ), PHP_VERSION ); } if ( ! function_exists( 'wp_ai_client_prompt' ) ) { $errors[] = __( 'AI Log Analyzer for WooCommerce requires the WordPress AI Client (available in WordPress 7.0+). Please upgrade WordPress or configure an AI connector.', 'ai-log-analyzer-for-woocommerce' ); } if ( ! empty( $errors ) ) { add_action( 'admin_notices', function () use ( $errors ) { foreach ( $errors as $error ) { echo '
' . esc_html( $error ) . '