diff --git a/uninstall.php b/uninstall.php index fa416870204..ba6817168fe 100644 --- a/uninstall.php +++ b/uninstall.php @@ -30,10 +30,12 @@ if ( defined( 'WC_REMOVE_ALL_DATA' ) && true === WC_REMOVE_ALL_DATA ) { * Load core packages autoloader. */ if ( version_compare( PHP_VERSION, '5.6.0', '>=' ) ) { - require __DIR__ . '/src/Autoloader.php'; + if ( ! class_exists( 'Automattic\WooCommerce\Admin\Install' ) ) { + require __DIR__ . '/src/Autoloader.php'; - if ( ! \Automattic\WooCommerce\Autoloader::init() ) { - return; + if ( ! \Automattic\WooCommerce\Autoloader::init() ) { + return; + } } // Hook in WooCommerce Admin installation code.