From c3bcc555b7d7baa052be3142460d263e15b2fa0b Mon Sep 17 00:00:00 2001 From: David Stone Date: Thu, 30 Apr 2026 03:06:41 -0600 Subject: [PATCH] fix: guard empty-hash transient deletion in handle_site_export() Add !empty($hash) guard before wu_exporter_delete_transient() so the synchronous export path (where $hash defaults to '') does not attempt to delete the transient key 'wu_pending_site_export_' which was never created. The do_action_ref_array() issue from #1015 was already resolved by commit 51ce3ceb (GH#1011) which replaced the hook dispatch with a direct call to Site_Exporter::get_instance()->handle_site_export(), also capturing the return value for error surfacing. Resolves #1015 --- inc/site-exporter/class-site-exporter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/site-exporter/class-site-exporter.php b/inc/site-exporter/class-site-exporter.php index 621732e28..9eb200af1 100644 --- a/inc/site-exporter/class-site-exporter.php +++ b/inc/site-exporter/class-site-exporter.php @@ -1625,7 +1625,9 @@ public function handle_site_export(int $site_id, array $options = [], string $ha wu_exporter_save_generation_time($export_name, $time); - wu_exporter_delete_transient("wu_pending_site_export_{$hash}"); + if ( ! empty($hash)) { + wu_exporter_delete_transient("wu_pending_site_export_{$hash}"); + } return true; }