Summary
Addon_Repository::upgrader_pre_download() in inc/class-addon-repository.php:152 declares a strict bool $reply type hint:
public function upgrader_pre_download(bool $reply, $package, \WP_Upgrader $upgrader, $hook_extra) {
The WordPress upgrader_pre_download filter can legitimately pass WP_Error or string (file path) values through the callback chain — not just bool. When any earlier-priority filter returns WP_Error, this method throws a fatal TypeError.
Steps to Reproduce
- Install Ultimate Multisite on a WordPress Multisite
- Install any plugin that hooks
upgrader_pre_download and may return WP_Error (e.g., Kadence Blocks Pro via StellarWP Uplink, WooCommerce Helper, GPLVault)
- Attempt to update any plugin via WP-CLI or the admin UI
Expected Behavior
The filter callback should accept any value that WordPress core may pass through the filter chain, including WP_Error and string.
Actual Behavior
Fatal error:
Fatal error: Uncaught TypeError: WP_Ultimo\Addon_Repository::upgrader_pre_download():
Argument #1 ($reply) must be of type bool, WP_Error given
This crashes the entire update process.
Suggested Fix
Remove the bool type hint from $reply, or accept mixed and handle non-bool values:
// Option 1: Remove type hint (matches WordPress core's filter signature)
public function upgrader_pre_download($reply, $package, \WP_Upgrader $upgrader, $hook_extra) {
if (!is_bool($reply)) {
return $reply; // Pass through non-bool values from other filters
}
// ... existing logic
}
// Option 2: Accept mixed and guard
public function upgrader_pre_download(mixed $reply, $package, \WP_Upgrader $upgrader, $hook_extra) {
if ($reply !== false) {
return $reply;
}
// ... existing logic
}
Environment
- WordPress 6.7+
- PHP 8.1+
- Ultimate Multisite (latest from GitHub)
- Conflicting plugins: Kadence Blocks Pro (StellarWP Uplink), GPLVault Updater, WooCommerce
Summary
Addon_Repository::upgrader_pre_download()ininc/class-addon-repository.php:152declares a strictbool $replytype hint:The WordPress
upgrader_pre_downloadfilter can legitimately passWP_Errororstring(file path) values through the callback chain — not justbool. When any earlier-priority filter returnsWP_Error, this method throws a fatalTypeError.Steps to Reproduce
upgrader_pre_downloadand may returnWP_Error(e.g., Kadence Blocks Pro via StellarWP Uplink, WooCommerce Helper, GPLVault)Expected Behavior
The filter callback should accept any value that WordPress core may pass through the filter chain, including
WP_Errorandstring.Actual Behavior
Fatal error:
This crashes the entire update process.
Suggested Fix
Remove the
booltype hint from$reply, or acceptmixedand handle non-bool values:Environment