register( 'wordpress', new Detection\WordPressDetector() ); $registry->register( 'plugins', new Detection\PluginDetector() ); $registry->register( 'themes', new Detection\ThemeDetector() ); $registry->register( 'php', new Detection\PhpDetector() ); $registry->register( 'database', new Detection\DatabaseDetector() ); $registry->register( 'cron', new Detection\CronDetector() ); $registry->register( 'backup', new Detection\BackupDetector() ); $registry->register( 'security-configuration', new Detection\SecurityDetector() ); $integrations = array( 'woocommerce' => array( 'WooCommerce', 'commerce', array( 'woocommerce/woocommerce.php' => 'WooCommerce' ) ), 'elementor' => array( 'Elementor', 'design', array( 'elementor/elementor.php' => 'Elementor', 'elementor-pro/elementor-pro.php' => 'Elementor Pro' ) ), 'smtp' => array( 'Email delivery', 'email', array( 'wp-mail-smtp/wp_mail_smtp.php' => 'WP Mail SMTP', 'post-smtp/postman-smtp.php' => 'Post SMTP', 'easy-wp-smtp/easy-wp-smtp.php' => 'Easy WP SMTP', 'fluent-smtp/fluent-smtp.php' => 'FluentSMTP' ) ), 'seo' => array( 'SEO', 'marketing', array( 'wordpress-seo/wp-seo.php' => 'Yoast SEO', 'seo-by-rank-math/rank-math.php' => 'Rank Math SEO', 'all-in-one-seo-pack/all_in_one_seo_pack.php' => 'All in One SEO', 'wp-seopress/seopress.php' => 'SEOPress' ) ), 'caching' => array( 'Caching', 'performance', array( 'wp-rocket/wp-rocket.php' => 'WP Rocket', 'w3-total-cache/w3-total-cache.php' => 'W3 Total Cache', 'litespeed-cache/litespeed-cache.php' => 'LiteSpeed Cache', 'wp-super-cache/wp-cache.php' => 'WP Super Cache' ) ), 'security' => array( 'Security', 'security', array( 'wordfence/wordfence.php' => 'Wordfence', 'sucuri-scanner/sucuri.php' => 'Sucuri Security', 'better-wp-security/better-wp-security.php' => 'Solid Security', 'all-in-one-wp-security-and-firewall/wp-security.php' => 'All-In-One Security' ) ), ); foreach ( $integrations as $id => $config ) { $registry->register( 'integration-' . $id, new Detection\PluginIntegrationDetector( $id, $config[0], $config[1], $config[2] ) ); } /** Register detectors here; detection is deferred until a graph is requested. */ do_action( 'intellilanz_register_detectors', $registry ); $cache = defined( 'INTELLILANZ_DISABLE_CACHE' ) && INTELLILANZ_DISABLE_CACHE ? null : new Graph\SnapshotCache(); if ( $cache !== null ) { $cache->registerInvalidationHooks(); } $builder = new GraphBuilder( $registry, new Graph\RelationshipResolver(), new Health\HealthEvaluator(), $cache ); $grouper = new Graph\SemanticGrouper(); $store = new Analysis\AnalysisStore(); $analysis = new Analysis\AnalysisService( $builder, $grouper, new Analysis\SiteHealthCollector(), new Analysis\SiteHealthPresenter(), $store ); $admin = new AdminPage( $builder ); $rest = new GraphController( $builder, $grouper ); $analysis_rest = new AnalysisController( $analysis ); $cleanup_rest = new CleanupController( null, null, $builder ); $acknowledgement_rest = new AcknowledgementController( null, $store ); add_action( 'admin_menu', array( $admin, 'register' ) ); add_action( 'admin_enqueue_scripts', array( $admin, 'enqueueAssets' ) ); add_action( 'rest_api_init', array( $rest, 'registerRoutes' ) ); add_action( 'rest_api_init', array( $analysis_rest, 'registerRoutes' ) ); add_action( 'rest_api_init', array( $cleanup_rest, 'registerRoutes' ) ); add_action( 'rest_api_init', array( $acknowledgement_rest, 'registerRoutes' ) ); if ( defined( 'WP_CLI' ) && WP_CLI ) { \WP_CLI::add_command( 'intellilanz check', array( new CLI\Command( $analysis ), 'check' ) ); } } }