REST APIeasy-svg-pro/v1/audit/scan

easy-svg-pro/v1/audit/scan

Scans one chunk of SVG attachments from an offset and stores the running report.

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/scan

Example

curl -u admin:app-password -H 'Content-Type: application/json' -d '{"offset":0}' https://example.com/wp-json/easy-svg-pro/v1/audit/scan

Description

One call scans one chunk. Start with offset 0, then call again with the next value from the answer until next is null. A call whose offset does not match the stored report's next answers 409 easy_svg_pro_stale_scan, because another scan started in between. Nothing is changed in the files. 409 easy_svg_pro_no_sanitizer when the free plugin is inactive. 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
offsetinteger

Where in the attachment list this chunk starts. Default 0.

Return value

returnWP_REST_Response|WP_Error

The report so far: at, scanned, found, unreadable, next and rows. 409 easy_svg_pro_stale_scan when another scan started meanwhile.

Response

The report so far: at, scanned, found, unreadable, next and rows. 409 easy_svg_pro_stale_scan when another scan started meanwhile.

{
  "at": 1792800000,
  "scanned": 50,
  "found": 1,
  "unreadable": 0,
  "next": 50,
  "rows": {
    "101": {
      "tags": [
        "script"
      ],
      "attrs": [],
      "bad": false
    }
  }
}