'class', 'pages' => 'page', 'widgets' => 'widget', ); foreach ( $autoload_types as $type => $prefix ) { $autoload_dir = \trailingslashit( __DIR__ . DIRECTORY_SEPARATOR . $type ); $autoload_path = sprintf( '%s%s-%s.php', $autoload_dir, $prefix, strtolower( str_replace( '_', '-', $class_name ) ) ); if ( file_exists( $autoload_path ) ) { require_once $autoload_path; // NOSONAR - WP compatible. break; } } } } spl_autoload_register( 'mainwp_autoload' ); require_once MAINWP_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'functions.php'; // NOSONAR -- WP compatible. require_once MAINWP_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'core-functions.php'; // NOSONAR -- WP compatible. require_once MAINWP_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'compatible.php'; // NOSONAR -- WP compatible. require_once MAINWP_PLUGIN_DIR . 'includes' . DIRECTORY_SEPARATOR . 'class-mainwp-includes.php'; // NOSONAR -- WP compatible. // Detect if secupress_scanner is running. $mainwp_is_secupress_scanning = false; if ( ! empty( $_GET ) && isset( $_GET['test'] ) && isset( $_GET['action'] ) && 'secupress_scanner' === $_GET['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized.Recommended $mainwp_is_secupress_scanning = true; } // Fix a conflict with SecuPress plugin. if ( ! $mainwp_is_secupress_scanning ) { $mainWP = new MainWP\Dashboard\MainWP_System( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . plugin_basename( __FILE__ ) ); register_activation_hook( __FILE__, array( $mainWP, 'activation' ) ); register_deactivation_hook( __FILE__, array( $mainWP, 'deactivation' ) ); add_action( 'plugins_loaded', array( $mainWP, 'update_install' ) ); }