DiagnosticLogSender
\Benecaster\Admin\DiagnosticLogSender
Builds and sends a diagnostic snapshot to Benecaster support. It is driven from the Support Mode panel in Settings → Tools and sends only when an admin clicks the button while Support Mode is active — nothing here runs on a schedule or in the background.
The request body carries no credential of any kind. It holds host metadata — site URL, plugin, PHP and WordPress versions, the active bridge slugs across published shows — and the recent debug log entries, gzipped and base64-encoded. The site is identified by the bearer token on the request itself, which the server resolves to a customer record, so nothing identifying needs to travel in the body.
The body previously also carried license_key_hash, and it must not come back. It was a sha-256 cross-reference for installs predating the OAuth pivot; no such install exists, so on every site that has ever run this code it hashed nothing and sent an empty string. It was removed on 2026-08-31 along with the option behind it. The trap for anyone reinstating it: hashing the empty string rather than sending an empty string publishes the same constant on every install, and that constant is indistinguishable from a real customer hash.
There is deliberately no licence-key precondition. One used to run first and made the send dead on every correctly-connected site — it refused before reaching the network while telling the operator their plugin was unactivated, sending them to look at their licence instead of reporting the bug they were trying to report. The only precondition is that at least one show is connected.
Constructor Dependencies
| Type | Description |
|---|---|
\Benecaster\License\LicenseClient |
|
\Benecaster\Admin\DebugLog |
|
\Benecaster\Admin\SupportMode |
|
\Benecaster\Bridge\BridgeManager |
|
\Benecaster\License\ShowTokenRepository |
Methods
| Method | Visibility | Since | Description |
|---|---|---|---|
send(): array|WP_Error |
Public | — | Builds the payload, sends it, and returns either the server-issued identifier the customer quotes when contacting support, or a WP_Error. Refuses without a network call when Support Mode is off (support_mode_off) or when no show on the site is connected (license_key_missing). That second error code is historical and does not describe the condition — what is missing is the connection, not a licence key. It is kept because support tooling matches on the string. A network call that fails, returns a non-2xx, or returns unusable JSON gives send_failed. |
Constants
| Name | Value | Description |
|---|---|---|
DEFAULT_LOG_LIMIT |
200 |
Number of recent log entries included in the snapshot. Override with the benecaster_support_mode_log_limit filter; a value below 1 falls back to this default. |