%s

', esc_html__( 'MigrateX is installed twice. Deactivate one copy; only the first one loaded is running.', 'migratex' ) ); } ); return; } define( 'MIGRATEX_VERSION', '0.1.3' ); define( 'MIGRATEX_FILE', __FILE__ ); define( 'MIGRATEX_DIR', plugin_dir_path( __FILE__ ) ); define( 'MIGRATEX_URL', plugin_dir_url( __FILE__ ) ); define( 'MIGRATEX_REST_NAMESPACE', 'migratex/v1' ); define( 'MIGRATEX_ARCHIVE_EXT', 'wpmig' ); // Browser upload slice size. The server enforces it as a hard ceiling per chunk. // Largest piece the browser sends per request. Environment::chunkBytes() lowers it on hosts whose // post_max_size or memory_limit could not take that much. define( 'MIGRATEX_CHUNK_SIZE', 5 * 1024 * 1024 ); // Piece size for a site-to-site transfer (server to server, so no browser or post_max_size limit applies). // The destination may ask for less during the handshake; see Environment::remoteChunkMax(). define( 'MIGRATEX_REMOTE_CHUNK_SIZE', 10 * 1024 * 1024 ); if ( version_compare( PHP_VERSION, '7.4', '<' ) ) { add_action( 'admin_notices', static function () { printf( '

%s

', esc_html( sprintf( /* translators: %s: current PHP version */ __( 'MigrateX requires PHP 7.4 or higher. You are running PHP %s.', 'migratex' ), PHP_VERSION ) ) ); } ); return; } if ( is_readable( MIGRATEX_DIR . 'vendor/autoload.php' ) ) { require_once MIGRATEX_DIR . 'vendor/autoload.php'; } else { require_once MIGRATEX_DIR . 'src/Autoloader.php'; \MigrateX\Autoloader::register( MIGRATEX_DIR . 'src/' ); } register_activation_hook( __FILE__, static function () { \MigrateX\Filesystem\Paths::ensureStorage(); } ); register_deactivation_hook( __FILE__, static function () { // No cron event should outlive the plugin that handles it. \MigrateX\Job\Janitor::unschedule(); \MigrateX\Schedule\Scheduler::unschedule(); } ); add_action( 'plugins_loaded', static function () { \MigrateX\Plugin::instance()->boot(); } );