Bug
Calling wu_exporter_export() (synchronous or via admin UI) fatally crashes with:
Fatal error: Call to undefined function TenUp\MU_Migration\Helpers\maybe_switch_to_blog()
in inc/site-exporter/mu-migration/includes/commands/class-mu-migration-export.php:396
Root Cause
Site_Exporter::load_dependencies() gates ALL file loading behind a check for inc/site-exporter/mu-migration/vendor/autoload.php, but that directory is not tracked in git and does not exist:
public function load_dependencies(): void {
$base_path = wu_path('inc/site-exporter/mu-migration');
if (file_exists($base_path . '/vendor/autoload.php')) { // always false
require_once $base_path . '/vendor/autoload.php';
require_once $base_path . '/includes/helpers.php'; // never loaded
// ...
}
}
Meanwhile, the ExportCommand and ImportCommand classes ARE autoloaded by the main Composer classmap (in vendor/composer/autoload_classmap.php), so they can be instantiated — but they crash immediately when calling helper functions that were never loaded.
Steps to Reproduce
wp eval 'wu_exporter_export(2, ["uploads" => true], false);' --url=http://wordpress.local:8080
Or click "Export" on any site in the admin UI.
Expected
Export creates a ZIP file.
Actual
Fatal error — helpers.php functions undefined.
Fix
load_dependencies() should load helpers.php and the command classes unconditionally (they have no external dependency). The vendor/autoload.php check should only gate loading of the Alchemy\Zippy\Zippy dependency (which is handled by the separate Zippy issue).
Files to modify
EDIT: inc/site-exporter/class-site-exporter.php:1618-1632 — restructure load_dependencies() to always load helpers.php and command files; only gate vendor autoloader behind the file_exists check
Severity
Blocker — export is completely non-functional.
aidevops.sh v3.13.11 plugin for OpenCode v1.3.17 with claude-opus-4-6 spent 4m and 11,361 tokens on this as a headless worker.
Bug
Calling
wu_exporter_export()(synchronous or via admin UI) fatally crashes with:Root Cause
Site_Exporter::load_dependencies()gates ALL file loading behind a check forinc/site-exporter/mu-migration/vendor/autoload.php, but that directory is not tracked in git and does not exist:Meanwhile, the
ExportCommandandImportCommandclasses ARE autoloaded by the main Composer classmap (invendor/composer/autoload_classmap.php), so they can be instantiated — but they crash immediately when calling helper functions that were never loaded.Steps to Reproduce
Or click "Export" on any site in the admin UI.
Expected
Export creates a ZIP file.
Actual
Fatal error —
helpers.phpfunctions undefined.Fix
load_dependencies()should loadhelpers.phpand the command classes unconditionally (they have no external dependency). Thevendor/autoload.phpcheck should only gate loading of theAlchemy\Zippy\Zippydependency (which is handled by the separate Zippy issue).Files to modify
EDIT: inc/site-exporter/class-site-exporter.php:1618-1632— restructureload_dependencies()to always load helpers.php and command files; only gate vendor autoloader behind the file_exists checkSeverity
Blocker — export is completely non-functional.
aidevops.sh v3.13.11 plugin for OpenCode v1.3.17 with claude-opus-4-6 spent 4m and 11,361 tokens on this as a headless worker.