Bug
The synchronous export path in wu_exporter_export() uses do_action_ref_array() incorrectly:
do_action_ref_array(
'wu_export_site',
[
'site_id' => $site_id,
'options' => $options,
],
'site-exporter' // this 3rd arg is silently ignored
);
do_action_ref_array() only accepts 2 arguments: the hook name and an array of args. The third argument 'site-exporter' is silently ignored.
The handler handle_site_export() expects (int $site_id, array $options, string $hash):
add_action('wu_export_site', [$this, 'handle_site_export'], 10, 3);
While the array values are correctly unpacked as positional params, the $hash parameter is never passed in the synchronous path, so it defaults to ''. This means the export tries to delete a non-existent transient on line 1527:
wu_exporter_delete_transient("wu_pending_site_export_{$hash}");
// hash is '' — deletes "wu_pending_site_export_" which never exists
This is harmless but indicates confused API design — the synchronous path shouldn't be using the same handler as the async path.
Impact
Low — mostly code quality and potential for confusion. The extra do_action_ref_array argument and the empty hash transient deletion are both no-ops.
Suggested Fix
- Remove the extra 3rd argument from the
do_action_ref_array() call
- Guard the transient deletion in
handle_site_export() with if (!empty($hash))
Files to modify
EDIT: inc/functions/exporter.php:45-52 — remove extra argument
EDIT: inc/site-exporter/class-site-exporter.php:1527 — guard with !empty($hash)
Severity
Low — code quality issue, no functional impact.
aidevops.sh v3.13.11 plugin for OpenCode v1.3.17 with claude-opus-4-6 spent 9m and 19,115 tokens on this as a headless worker.
Bug
The synchronous export path in
wu_exporter_export()usesdo_action_ref_array()incorrectly:do_action_ref_array()only accepts 2 arguments: the hook name and an array of args. The third argument'site-exporter'is silently ignored.The handler
handle_site_export()expects(int $site_id, array $options, string $hash):While the array values are correctly unpacked as positional params, the
$hashparameter is never passed in the synchronous path, so it defaults to''. This means the export tries to delete a non-existent transient on line 1527:This is harmless but indicates confused API design — the synchronous path shouldn't be using the same handler as the async path.
Impact
Low — mostly code quality and potential for confusion. The extra
do_action_ref_arrayargument and the empty hash transient deletion are both no-ops.Suggested Fix
do_action_ref_array()callhandle_site_export()withif (!empty($hash))Files to modify
EDIT: inc/functions/exporter.php:45-52— remove extra argumentEDIT: inc/site-exporter/class-site-exporter.php:1527— guard with!empty($hash)Severity
Low — code quality issue, no functional impact.
aidevops.sh v3.13.11 plugin for OpenCode v1.3.17 with claude-opus-4-6 spent 9m and 19,115 tokens on this as a headless worker.