Admineasy_svg_support_report

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

body
$linesarray
Required

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

returnarray

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

  1. The Tools page loads the report through GET /wp-json/easy-svg/v1/support/report. The route requires manage_options and answers { "text": "..." }, one line per entry.
  2. easy_svg_support_lines() builds the default lines from the saved settings and applies the filter.
  3. easy_svg_support_scrub() checks every line. It is dropped when the label sounds like a secret (for example License 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, a Bearer token, a license key pattern, or a run of 32 or more letters, digits, _ and -.
  4. Paths are hidden: the WP_CONTENT_DIR path becomes [content], the ABSPATH path [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 keys line stays, a key or Lizenzschlüssel line 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 uploads always says on.
  • Lines with the same label overwrite each other. The lines are an array keyed by label. Use a label of your own.