REST APIeasy-svg-pro/v1/audit/sources/clean

easy-svg-pro/v1/audit/sources/clean

Cleans one stored library or set icon after keeping its original.

REST endpoint · Easy SVG Pro · Status: Internal · Defined in includes/core/rest.php

Internal: not part of the promised public surface. It may change without notice.

Usage

POST /wp-json/easy-svg-pro/v1/audit/sources/clean

Example

curl -u admin:app-password -H 'Content-Type: application/json' -d '{"ref":"set:42:arrow"}' https://example.com/wp-json/easy-svg-pro/v1/audit/sources/clean

Description

The ref names icon:<id> for a free library icon or set:<id>:<slug> for an icon in a set. A folder ref is refused with 400 easy_svg_pro_not_cleanable: fix that file where it comes from. A set clean takes the set write lock first. 404 easy_svg_pro_no_icon or easy_svg_pro_no_set when the target is gone, 409 when the free plugin is missing or too old. Permission: Requires manage_options, an active licence and the audit feature (SVG cleaner) switched on.

Permission: Requires manage_options, an active licence and the audit feature (SVG cleaner) switched on.

Parameters

body
refstring
Required

Which stored icon to clean: icon:<id> or set:<id>:<slug>.

Return value

returnWP_REST_Response|WP_Error

state: cleaned, already_clean, refused_malformed, refused, backup_failed, not_found or write_failed.

Response

state: cleaned, already_clean, refused_malformed, refused, backup_failed, not_found or write_failed.

{
  "state": "cleaned"
}
The icon is rewritten for every page that shows it. The original is kept and can be downloaded from /audit/originals.