Safe SVG

Description

Safe SVG is the best way to Allow SVG Uploads in WordPress!

It gives you the ability to allow SVG uploads whilst making sure that they’re sanitized to stop SVG/XML vulnerabilities affecting your site.
It also gives you the ability to preview your uploaded SVGs in the media library in all views.

Loving Safe SVG? Try the Pro version for extra features.

Free Features

  • Sanitised SVGs – Don’t open up security holes in your WordPress site by allowing uploads of unsanitised files.
  • View SVGs in the Media Library – Gone are the days of guessing which SVG is the correct one, we’ll enable SVG previews in the WordPress media library.

Pro Features

  • SVGO Optimisation – You’ll have the option to run your SVGs through our SVGO server on upload to save you space.
  • Choose Who Can Upload – Restrict SVG uploads to certain users on your WordPress site or allow anyone to upload.
  • Premium Support – Pro users get premium support whilst free support is offered in the WordPress forums in our spare time

Initially a proof of concept for #24251

SVG Sanitization is done through the following library: https://github.com/darylldoyle/svg-sanitizer

Installation

Install through the WordPress directory or download, unzip and upload the files to your /wp-content/plugins/ directory

Reviews

Pure Awesomeness

Finally, I can quit looking for workarounds. This plugin is amazing. Stress level diminished. Thank you.

Neat & Complete!

I think this is the neatest and complete SVG plugin on the repo. Thanks for building the sanitization library and integrating it into WP Daryll.

Finally, somebody gets it!

I have literally been waiting on SVG support for a while. Obviously, I could add MIME support snippet and be done… but I was waiting for someone to at least add some sanitization logic, along with media library support. Thanks a bunch Daryll! Hopefully one day we can see this in WordPress core, but until then, I will be using your plugin 🙂

Read all 9 reviews

Contributors & Developers

“Safe SVG” is open source software. The following people have contributed to this plugin.

Contributors

Translate “Safe SVG” into your language.

Interested in development?

Browse the code or subscribe to the development log by RSS.

Changelog

1.4.3

  • WordPress 4.7.3 Compatibility
  • Expanded SVG previews in media library

1.4.2

  • Added a check / fix for when mb_* functions are not available

1.4.1

  • Updated underlying library to allow attributes/tags in all case variations

1.4.0

  • Added ability to preview SVG on both grid and list view in the wp-admin media area
  • Updated underlying library version

1.3.4

  • A fix for SVGZ uploads failing and not sanitising correctly

1.3.3

  • Allow SVGZ uploads

1.3.2

  • Fix for the mime type issue in 4.7.1. Mad props to @lewiscowles

1.3.1

  • Updated underlying library version

1.3.0

  • Minify SVGs after cleaning so they can be loaded correctly through file_get_contents

1.2.0

  • Added support for camel case attributes such as viewBox

1.1.1

  • Fixed an issue with empty svg elements self-closing

1.1.0

  • Added i18n
  • Added da, de ,en, es, fr, nl and ru translations
  • Fixed an issue with filename not being pulled over on failed uploads

1.0.0

  • Initial Release