From 7ac1336c7f1eee11438edc0f3e1719c403d7b0d6 Mon Sep 17 00:00:00 2001 From: David Stone Date: Thu, 30 Apr 2026 00:34:37 -0600 Subject: [PATCH] fix: remove spurious do_action_ref_array arg and guard empty-hash transient deletion - Remove the silently-ignored third argument 'site-exporter' from the do_action_ref_array() call in wu_exporter_export(). do_action_ref_array() only accepts two arguments (hook name + args array). - Guard the transient deletion in handle_site_export() with !empty($hash) so the synchronous code path (where $hash defaults to '') does not attempt to delete a transient key 'wu_pending_site_export_' that was never created. Fixes #1015 --- inc/functions/exporter.php | 3 +-- inc/site-exporter/class-site-exporter.php | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/inc/functions/exporter.php b/inc/functions/exporter.php index 7bdbd22ee..1fe24c3ee 100644 --- a/inc/functions/exporter.php +++ b/inc/functions/exporter.php @@ -47,8 +47,7 @@ function wu_exporter_export(int $site_id, array $options = [], bool $async = fal [ 'site_id' => $site_id, 'options' => $options, - ], - 'site-exporter' + ] ); } diff --git a/inc/site-exporter/class-site-exporter.php b/inc/site-exporter/class-site-exporter.php index 770294763..99bf78eb2 100644 --- a/inc/site-exporter/class-site-exporter.php +++ b/inc/site-exporter/class-site-exporter.php @@ -1524,7 +1524,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; }