' .
esc_html__( 'Shiftora requires PHP 8.1 or higher. Please upgrade PHP.', 'shiftora' ) .
'
';
}
);
return;
}
// Autoloader.
if ( file_exists( SHIFTORA_DIR . 'vendor/autoload.php' ) ) {
require_once SHIFTORA_DIR . 'vendor/autoload.php';
} else {
add_action(
'admin_notices',
static function (): void {
echo '' .
esc_html__(
'Shiftora: Composer autoloader not found. Please run composer install.',
'shiftora'
) .
'
';
}
);
return;
}
// Load the bundled Action Scheduler before Plugin::init() so its hooks are
// registered in time on sites where no other plugin provides it.
$shiftora_as_path = SHIFTORA_DIR . 'vendor/woocommerce/action-scheduler/action-scheduler.php';
if ( file_exists( $shiftora_as_path ) ) {
require_once $shiftora_as_path;
}
// Activation and deactivation hooks are registered before Plugin::init() so they
// exist while the plugin is being activated.
register_activation_hook( SHIFTORA_FILE, [ 'Shiftora\\Core\\Installer', 'activate' ] );
register_deactivation_hook( SHIFTORA_FILE, [ 'Shiftora\\Core\\Uninstaller', 'deactivate' ] );
// Bootstrap the plugin.
add_action( 'plugins_loaded', [ 'Shiftora\\Core\\Plugin', 'init' ] );