easy_svg_support_report
Add your own lines to the support report under Easy SVG, Tools, Support. Every line is scrubbed afterwards, so no secret reaches the report.
Filter, Easy SVG, Status: Stable
Under Easy SVG → Tools, the panel shows a "Support report" that an administrator copies into a support request with "Copy report". The report is made of Label: value lines. With this filter an add-on adds its own lines or changes the existing ones.
Usage
apply_filters( 'easy_svg_support_report', array $lines )
Applied in includes/support.php, inside easy_svg_support_lines(). The result then goes through easy_svg_support_scrub().
When to use it
- Your add-on needs its own version, its license state or which of its features are on in support requests.
- You look after client sites and want a note about your own configuration in the report.
Do not use it when:
- you want to pass on license keys, tokens, passwords or e-mail addresses. Such lines are dropped (see How it works).
Parameters
The lines as label => value. Easy SVG passes Site, WordPress, PHP, Easy SVG, Theme, SVG uploads (on or off) and Icon manager (on or off).
Return value
The lines as label => value. The result is cast to an array. Values that are not scalar (arrays, objects, null) are dropped, all others become strings.
Default
array(
'Site' => home_url(),
'WordPress' => get_bloginfo( 'version' ),
'PHP' => PHP_VERSION,
'Easy SVG' => '5.0', // from the plugin header
'Theme' => 'Name Version',
'SVG uploads' => 'on', // always on
'Icon manager' => 'off',
)
Examples
Append a line of your own
function myaddon_support_report( $lines ) {
$lines['My Add-on'] = defined( 'MYADDON_VERSION' ) ? MYADDON_VERSION : 'unknown';
return $lines;
}
add_filter( 'easy_svg_support_report', 'myaddon_support_report' );
The report then reads My Add-on: 1.2.0.
How it works
- The Tools page loads the report through
GET /wp-json/easy-svg/v1/support/report. The route requiresmanage_optionsand answers{ "text": "..." }, one line per entry. easy_svg_support_lines()builds the default lines from the saved settings and applies the filter.easy_svg_support_scrub()checks every line. It is dropped when the label sounds like a secret (for exampleLicense key,API key,key,Token,Secret,Password,E-Mail,Contact,Passwort,Kennwort,Lizenzschlüssel,Schlüssel), or when the label or the value looks like one: an e-mail address, a JWT, aBearertoken, a license key pattern, or a run of 32 or more letters, digits,_and-.- Paths are hidden: the
WP_CONTENT_DIRpath becomes[content], theABSPATHpath[site], the longer path first.
Easy SVG Pro uses this filter to add the lines Easy SVG Pro, License (active or inactive), Pro features and Integrations found.
Pitfalls
- A value that looks like a token disappears. Long hashes, license keys and commit ids of 32 or more characters are dropped. Shorten them if you need them in the report.
- The label decides too. A
Feature keysline stays, akeyorLizenzschlüsselline is dropped whatever its value. - The two switch lines show the settings as the plugin acts on them. They come from the settings as the plugin reads them, so
SVG uploadsalways sayson. - Lines with the same label overwrite each other. The lines are an array keyed by label. Use a label of your own.