Search Over 30,000 FREE Plugins from the Official WordPress Plugin Directory Repository

Enable SVG

Enables SVG uploads in the Media Library. Specifically designed to address changes to file upload validation introduced in WordPress 4.7.

This plugin serves one simple purpose: to add support for uploading SVG files in the WordPress Media Library.

WordPress 4.7 introduced changes to the file validation process for images. While this generally makes image uploads more secure, it breaks existing plugins that made SVG uploads available.

This is because the SVG format uses the MIME type "image/svg+xml", and WordPress 4.7 uses a pair of core PHP functions for validating any file that has an "image/" MIME type, but those functions don't handle SVG.

This plugin detects whether the uploaded file is an SVG and, if so, replaces the new WordPress image validation with checks that 1) the uploaded file is valid XML, and 2) it contains certain required text strings expected in an SVG file. Please note: For performance reasons, this is not a strict SVG validator, and does not provide complete protection from possible SVG security exploits.

Do not use this plugin if you are concerned about SVG as a possible security risk. This plugin is provided as-is with no warranty whatsoever.

Author Room 34 Creative Services, LLC
Profile
Contributors room34
Tags file uploads, media library, svg

1.1.1

Updated description and fixed an additional false negative validation issue.

1.1.0

Revised SVG validation criteria to resolve possible false negatives.

1.0.0

Initial version.

Can the SVG image preview show in the Media Library instead of the generic file icon?

This is coming in a future update.

Share  
Download
Version 1.1.1

Requires WordPress version: 4.7 or higher

Compatible up to: 4.7.2

Last Updated 09 Feb 2017

Date Added: 09 Feb 2017

Plugin Homepage

Evaluation
star1
star2
star3
star4
star5

0 stars
0 ratings
24 downloads

Compatibility

Not Enough Data

Reports:
Works: 0
Broken: 0