| assets | ||
| inc | ||
| lib | ||
| .gitignore | ||
| composer.json | ||
| gd-better-svg.php | ||
| index.php | ||
| README.md | ||
Description
This simple WordPress plugin allows you to upload SVG files through the media library. It uses Daryll Doyles svg-sanitizer library to sanitize the code of uploaded SVG files.
To learn more about the risks when uploading SVG files you should read these websites:
- https://www.bjornjohansen.com/svg-in-wordpress
- https://security.stackexchange.com/questions/26264/what-does-a-html-filter-need-to-do-to-protect-against-svg-attacks/30390#30390
To learn more about svg-sanitizer, take a look at Daryll Doyles github:
Features
- Enables users to upload SVG files through WP Media Library
- Automatically sanitizes uploaded SVG files with svg-sanitizer
- Ability to localize plugin with language files
- Prevents upload of malformed SVG files
- Displays a preview of the SVG in the Media Library
- and more...
Installation
Through WordPress backend:
- Download the zip file of this repo to your computer
- Log in to your WordPress admin area, go to "Plugins" -> "Install"
- Click on "Upload file" and choose the zip you just downloaded
- Click on "Activate" after the plugin has been uploaded
Manual installation:
- Download the zip file of this repo to your computer
- Unpack the zip file
- Upload the unpacked folder with a FTP program to "/wp-config/plugins" (default path, maybe different for your WP installation)
- Log in to your WordPress admin area, go to "Plugins" and activate the plugin
Development
All development work is done on this website. This plugin is not published to the official WordPress plugin repository, as I don't have time to support it on their forums.
Note about support:
This plugin is distributed AS IS.
I do not support it in any way. If you have issues, you have to solve them on your own.
I won't add any features, however you can simply fork this repo and start developing anything you need.
Requirements
Requires PHP > 7.4 and WordPress > 5.6
Changelog
v1.0.0
- Initial Release
v1.0.1
- 🧨 Breaking change: 🧨
Switched the hosting of the plugin development from Github to my self-hosted GitLab instance. The old versions are still available on Github but won't get any further updates. If you installed this plugin via Composer please change the URLs in your composer.json! - Minor bugfixes
- Code cleanup
- Updated translation files and added missing language domains
v1.0.2
- Minor bugfixes
- Removed old "composer/installers" (v1.0) dependency from composer.json
- Updated svg-sanitizer library
Additional information
All my domains (flowzen.de and gitlab.flowzen.de) could have minor errors, since I am developing in my spare time. However, it is usually stable.
Note about versioning: Versions are cut in Major.Minor.Patch schema. Patch is incremental by every build. If there is a breaking change, it should be noted in the readme.