. * * @author Arindo Duque and NextPress * @category Core * @package WP_Ultimo * @version 2.3.3 */ // Exit if accessed directly defined('ABSPATH') || exit; if ( defined('WP_SANDBOX_SCRAPING') && WP_SANDBOX_SCRAPING ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; if ( is_plugin_active( 'wp-ultimo/wp-ultimo.php' ) ) { // old plugin still installed and active with the old name and path // and the user is trying to activate this plugin. We must return here, or we'll get name conflicts. return; } } // Check if old name is installed and we should upgrade. require_once ABSPATH . 'wp-admin/includes/plugin.php'; if ( is_plugin_active( 'wp-ultimo/wp-ultimo.php' ) ) { deactivate_plugins( 'wp-ultimo/wp-ultimo.php', true, true); wp_admin_notice( __( 'The WP Ultimo plugin has been deactivated because it conflicts with WP Multisite WaaS', 'wp-ultimo' ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); if ( file_exists(WP_CONTENT_DIR . '/sunrise.php')) { $possible_sunrises = array( WP_PLUGIN_DIR . '/wp-multisite-waas/sunrise.php', WPMU_PLUGIN_DIR . '/wp-multisite-waas/sunrise.php', ); foreach ( $possible_sunrises as $new_file ) { if ( ! file_exists( $new_file ) ) { continue; } $copy_results = @copy( $new_file, WP_CONTENT_DIR . '/sunrise.php' ); // phpcs:ignore if ( ! $copy_results ) { continue; } break; } return; } } if (!defined('WP_ULTIMO_PLUGIN_FILE')) { define('WP_ULTIMO_PLUGIN_FILE', __FILE__); } /** * Require core file dependencies */ require_once __DIR__ . '/constants.php'; require_once __DIR__ . '/autoload.php'; require_once __DIR__ . '/inc/class-autoloader.php'; require_once __DIR__ . '/dependencies/woocommerce/action-scheduler/action-scheduler.php'; require_once __DIR__ . '/inc/traits/trait-singleton.php'; /** * Setup autoloader */ WP_Ultimo\Autoloader::init(); /** * Setup activation/deactivation hooks */ WP_Ultimo\Hooks::init(); if ( ! function_exists('WP_Ultimo')) { /** * Initializes the WP Ultimo class * * This function returns the WP_Ultimo class singleton, and * should be used to avoid declaring globals. * * @return WP_Ultimo * @since 2.0.0 */ function WP_Ultimo() { // phpcs:ignore return WP_Ultimo::get_instance(); } // end WP_Ultimo; } // Initialize and set to global for back-compat $GLOBALS['WP_Ultimo'] = WP_Ultimo();