Add a Support Diagnostics Section
Added feature/security-diagnostics-hardening (Batch 3), 2026-09-11. The hidden Support Diagnostics panel (an admin with manage_options reaches it by appending &bc_support_diag=1 to any Benecaster admin page URL — deliberately undiscoverable, no menu entry) is a genuine extension point: an add-on can append its own diagnostic section so a support agent troubleshooting one issue doesn’t have to separately learn where the add-on keeps its own logs.
⚠ Your render callback must echo its own output rather than return a string — the panel calls each section’s callback in sequence and does not capture a return value.
Code
<?php
add_filter( 'benecaster_support_diagnostics_sections', function ( array $sections ): array {
$sections[] = [
'id' => 'my-addon-health',
'title' => __( 'My Add-on Health', 'my-addon' ),
'render' => function () {
// Echo your own markup — this is called with no arguments.
echo '<p>' . esc_html( my_addon_get_last_sync_status() ) . '</p>';
},
];
return $sections;
} );
Hooks Used
Need this built rather than just documented? See our services →