[wp-trac] [WordPress Trac] #44081: Privacy email request failures do not get reported if there are also successful ones
WordPress Trac
noreply at wordpress.org
Mon Sep 10 17:01:22 UTC 2018
#44081: Privacy email request failures do not get reported if there are also
successful ones
--------------------------+-----------------------------
Reporter: desrosj | Owner: javorszky
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.9.9
Component: Privacy | Version: 4.9.6
Severity: normal | Resolution:
Keywords: has-patch | Focuses: administration
--------------------------+-----------------------------
Comment (by birgire):
Thanks for the patch @javorszky
In [attachment:"44081.2.diff"] I was wondering if we might simplify:
{{{
if ( $resend && is_wp_error( $resend ) ) {
$failure_count++;
}
}}}
with
{{{
if ( is_wp_error( $resend ) ) {
$failure_count++;
}
}}}
as it looks like {{{$resend}}} is either {{{true}}} or {{{WP_Error}}}.
Another minor suggestion is to skip the {{{else}}}-part:
{{{
if ( empty( $request_ids ) ) {
add_settings_error(
'bulk_action',
'bulk_action',
__( 'There were no requests to act on.' )
);
return;
}
check_admin_referer( 'bulk-privacy_requests' );
}}}
instead of
{{{
if ( $request_ids ) {
check_admin_referer( 'bulk-privacy_requests' );
} else {
add_settings_error(
'bulk_action',
'bulk_action',
__( 'There were no requests to act on.' )
);
return;
}
}}}
ps: It looks like {{{_wp_privacy_resend_request()}}} might need
adjustments for it's inline docs, as it says it can return false, but it
doesn't look like it.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44081#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list