'class.add-from-server.php', 'features' => 'includes/class-features.php', 'capabilities' => 'includes/class-capabilities.php', 'installer' => 'includes/class-installer.php', 'import-job-repository' => 'includes/class-import-job-repository.php', 'import-processor' => 'includes/class-import-processor.php', 'import-ajax' => 'includes/class-import-ajax.php', 'file-filters' => 'includes/class-file-filters.php', 'path-guard' => 'includes/class-path-guard.php', 'pro-teaser' => 'includes/class-pro-teaser.php', 'pro-locked-screens' => 'includes/class-pro-locked-screens.php', // Pro feature implementations live in add-from-server-reloaded-pro. ); if ( ! isset( $map[ $relative ] ) ) { return; } $file = AFSRRELOADED_PLUGIN_DIR_PATH . $map[ $relative ]; if ( is_readable( $file ) ) { require_once $file; } } ); // Load PHP8 compat functions. require __DIR__ . '/compat.php'; // Old versions of WordPress or PHP. if ( version_compare( $GLOBALS['wp_version'], AFSRRELOADED_MIN_WP, '<' ) || version_compare( phpversion(), AFSRRELOADED_MIN_PHP, '<' ) ) { require __DIR__ . '/old-versions.php'; AFSRReloaded\Plugin::instance(); return; } register_activation_hook( __FILE__, array( 'AFSRReloaded\\Installer', 'activate' ) ); /** * Bootstrap the plugin. * * Loads in admin, AJAX, cron, REST, and WP-CLI contexts so imports can run. * * @since 5.3.0 */ function afsrreloaded_bootstrap() { $should_load = is_admin() || wp_doing_cron() || wp_doing_ajax() || ( defined( 'WP_CLI' ) && WP_CLI ) || ( defined( 'REST_REQUEST' ) && REST_REQUEST ); if ( ! $should_load ) { return; } AFSRReloaded\Plugin::instance(); } add_action( 'plugins_loaded', 'afsrreloaded_bootstrap' ); /** * Ensure plugin boots for REST even when REST_REQUEST is not defined yet. * * @since 5.4.0 */ function afsrreloaded_bootstrap_rest() { AFSRReloaded\Plugin::instance(); } add_action( 'rest_api_init', 'afsrreloaded_bootstrap_rest', 0 );