WordPress plugin intelligence profile

CodePros SVG Secure Support

Highly secure SVG upload support for WordPress. Validates, sanitizes, and protects SVG files through a multi-layer security pipeline.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 7.0
Current version1.0.0
WordPress coverageTested up to WordPress 7.0
Minimum stackWP 6.0 · PHP 7.4
Directory statusactive
Last directory update15 Jun 20264mo ago
Active installationsNewAdoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records CodePros SVG Secure Support version 1.0.0 as active, updated 4mo ago and tested up to WordPress 7.0.

Overview

About this plugin

WordPress does not support SVG uploads natively — and naive SVG plugins are a well-known attack surface. SVG files are XML documents that can carry XSS payloads, XXE attacks, external resource injection, and embedded HTML. CodePros SVG Secure Support adds safe, production-ready SVG uploads through a layered defense pipeline.

Security Pipeline

Every uploaded SVG passes through five sequential checks before it is accepted:

  • Extension check — Blocks double-extension filenames (e.g. payload.php.svg ) and enforces.svg only.
  • MIME check — Verifies actual file bytes return image/svg+xml via finfo; confirms <svg or <?xml is present in the header bytes.
  • Size check — Rejects files exceeding the configured maximum (default 1 MB).
  • Node-count check — Parses the XML and counts DOM nodes; rejects files above the threshold (default 5,000 nodes) to prevent node-flood DoS attacks.
  • Dimension check — Reads the root <svg> width/height/viewBox; rejects unreasonably large declared dimensions (default 10,000 px).

After validation, the file is sanitized:

  • DOM sanitization via the battle-tested enshrined/svg-sanitize library with custom tag and attribute whitelists.
  • Remote reference stripping — all external URLs are removed.
  • Final string-level regex scan for javascript:, <script, inline event handlers ( on*= ), and CSS expression() — any match causes the upload to be rejected entirely.

Security Headers

When SVG attachment pages are served, the plugin adds:

  • Content-Security-Policy (configurable, secure default provided)
  • X-Content-Type-Options: nosniff
  • X-Frame-Options: SAMEORIGIN

Server-Level Hardening (Optional but Recommended)

The plugin’s PHP layer covers every SVG upload that passes through WordPress. g. svg — WordPress is bypassed entirely, so the PHP security headers are never sent.

The plugin ships two ready-to-use server configuration snippets to close that gap:

  • uploads-htaccess.txt — for Apache / LiteSpeed servers
  • uploads-nginx.conf — for Nginx servers

Each snippet does three things:

  • Blocks server-side script execution in wp-content/uploads/ — if an attacker somehow uploads a.php file and tries to access it directly, the server returns 403 instead of executing it.
  • Enforces the correct SVG MIME type ( image/svg+xml ) — some server setups serve SVGs as text/plain, which prevents browsers from honouring Content Security Policy rules scoped to that MIME type.
  • Adds security headers on direct SVG requests — the same X-Content-Type-Options, X-Frame-Options, and Content-Security-Policy headers that the PHP layer adds on WordPress attachment pages, so direct file links are equally protected.

Applying these snippets is the difference between WordPress-mediated access being protected and all access (direct URL, CDN pull, hotlink) being protected.

Admin UI

A tabbed settings page under Settings → SVG Secure Support provides:

  • Settings tab — Configure allowed upload roles, file size/node/dimension limits, sanitization options, CSP header value, and logging preferences.
  • Security Logs tab — Paginated, filterable log viewer showing every security event (blocked upload, removed tag/attribute, suspicious payload). Includes a log purge action.

Key Features

  • Role-based upload access — select one or more WordPress roles (default: Administrator) whose members may upload SVG files
  • Automatic upload-time sanitization — clean SVG replaces the original tmp file before WordPress moves it
  • Security event logging to the WordPress debug log and a dedicated database table
  • Configurable log retention with one-click purge
  • Bundled.htaccess and Nginx config snippets for the uploads directory
WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • xss protection
  • sanitize
  • security
  • svg
  • upload
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 7.0

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 7.0.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to7.0
Minimum requirementsWordPress 6.0 · PHP 7.4
Update activity15 Jun 20264mo ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.