Scalable Vector Graphics (SVG) - Version 3.1

Version Description

Download this release

Release Info

Developer sterlo
Plugin Icon Scalable Vector Graphics (SVG)
Version 3.1
Comparing to
See all releases

Code changes from version 3.0 to 3.1

Files changed (2) hide show
  1. readme.txt +31 -31
  2. scalable-vector-graphics.php +2 -2
readme.txt CHANGED
@@ -25,45 +25,25 @@ Resources for understanding security risks:
25
 
26
  == Installation ==
27
 
28
- === Manually ===
29
  1. Upload scalable-vector-graphics-svg into your plugins directory.
30
- 1. Activate the plugin through the 'Plugins' menu in WordPress
31
  1. Use SVG files just like you would use a normal image file.
32
 
33
- === Plugin Manager ===
34
- 1. Go to your plugin manager, located generally at ``/wp-admin/plugins.php`
35
- 1. Click "Add New"
36
- 1. Search for "Scalable Vector Graphics SVG"
37
- 1. Click "Install Now"
38
- 1. Click "Activate Plugin"
39
 
40
- === WP-CLI ===
41
  1. Be in the root of your WordPress installation.
42
- 1. Run `wp plugin install scalable-vector-graphics-svg`
43
- 1. Run `wp activate scalable-vector-graphics-svg`
44
 
45
  == Changelog ==
46
 
47
- = 1.0 =
48
- * I N C E P T I O N
49
- = 1.1 =
50
- * Fixing a typo. This typo caused ONLY SVG files to be allowed to upload via the media uploader.
51
- = 1.2 =
52
- * One less required parameter and a graceful fail over to a valid implementation type. Props @Phil
53
- = 2.0 =
54
- * I broke everything. I'm sorry, but it had to be done.
55
- * Basically how I had approached the problem before was wrong. It is now being done properly using the correct mime/type.
56
- * Shortcodes are no longer needed, you can now use SVG files as you would any other image.
57
- * Previews now show up in the media area for SVG files.
58
- * IMPORTANT: Anyone using the version prior to 2.0 were using shortcodes to display SVG files. You will have to go back and replace those shortcodes with actual image tags. If you're not familiar with HTML, you can just delete the shortcode out of the page/post and then insert the SVG file as you would any other image.
59
- * Thanks to the guys over at mozilla.org for kicking me in the butt to actually fix this thing: https://bugzilla.mozilla.org/show_bug.cgi?id=721830
60
- = 2.2.1 =
61
- * Added a security library to scan all uploaded SVG files. It has a list of "expected" elements and attributes, if the file contains thing it does not expect, it removes them. This will include things like Javascript.
62
- * The security cannot be perfect and it is recommended to only provide upload privileges to trusted users.
63
- * Props to thedwards for bringing this to my attention.
64
- = 2.3.1 =
65
- * Added inline styling to the administration area so SVG attachments will show up in list/grid views.
66
- * Props to shield-9 (Daisuke Takahashi) for the code.
67
  = 3.0 =
68
  * Removed the sanitizer. This plugin isn't about security. It's about letting you use SVG files easily.
69
  * Added more styling to improve Media Manager, including adjustments Grid View and Listing View
@@ -71,3 +51,23 @@ Resources for understanding security risks:
71
  * Reduced overall code footprint and complexity.
72
  * Added code documentation.
73
  * Resolved several serverside issues you may have been encountering having to do with security related stuff.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
  == Installation ==
27
 
28
+ = Manually =
29
  1. Upload scalable-vector-graphics-svg into your plugins directory.
30
+ 1. Activate the plugin through the 'Plugins' menu in WordPress.
31
  1. Use SVG files just like you would use a normal image file.
32
 
33
+ = Plugin Manager =
34
+ 1. Go to your plugin manager, located generally at `/wp-admin/plugins.php`.
35
+ 1. Click "Add New".
36
+ 1. Search for "Scalable Vector Graphics SVG".
37
+ 1. Click "Install Now".
38
+ 1. Click "Activate Plugin".
39
 
40
+ = WP CLI =
41
  1. Be in the root of your WordPress installation.
42
+ 1. Run `wp plugin install scalable-vector-graphics-svg`.
43
+ 1. Run `wp activate scalable-vector-graphics-svg`.
44
 
45
  == Changelog ==
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  = 3.0 =
48
  * Removed the sanitizer. This plugin isn't about security. It's about letting you use SVG files easily.
49
  * Added more styling to improve Media Manager, including adjustments Grid View and Listing View
51
  * Reduced overall code footprint and complexity.
52
  * Added code documentation.
53
  * Resolved several serverside issues you may have been encountering having to do with security related stuff.
54
+ = 2.3.1 =
55
+ * Added inline styling to the administration area so SVG attachments will show up in list/grid views.
56
+ * Props to shield-9 (Daisuke Takahashi) for the code.
57
+ = 2.2.1 =
58
+ * Added a security library to scan all uploaded SVG files. It has a list of "expected" elements and attributes, if the file contains thing it does not expect, it removes them. This will include things like Javascript.
59
+ * The security cannot be perfect and it is recommended to only provide upload privileges to trusted users.
60
+ * Props to thedwards for bringing this to my attention.
61
+ = 2.0 =
62
+ * I broke everything. I'm sorry, but it had to be done.
63
+ * Basically how I had approached the problem before was wrong. It is now being done properly using the correct mime/type.
64
+ * Shortcodes are no longer needed, you can now use SVG files as you would any other image.
65
+ * Previews now show up in the media area for SVG files.
66
+ * IMPORTANT: Anyone using the version prior to 2.0 were using shortcodes to display SVG files. You will have to go back and replace those shortcodes with actual image tags. If you're not familiar with HTML, you can just delete the shortcode out of the page/post and then insert the SVG file as you would any other image.
67
+ * Thanks to the guys over at mozilla.org for kicking me in the butt to actually fix this thing: https://bugzilla.mozilla.org/show_bug.cgi?id=721830
68
+ = 1.2 =
69
+ * One less required parameter and a graceful fail over to a valid implementation type. Props @Phil
70
+ = 1.1 =
71
+ * Fixing a typo. This typo caused ONLY SVG files to be allowed to upload via the media uploader.
72
+ = 1.0 =
73
+ * I N C E P T I O N
scalable-vector-graphics.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Scalable Vector Graphics (SVG)
4
  * Plugin URI: http://www.sterlinghamilton.com/projects/scalable-vector-graphics/
5
  * Description: Scalable Vector Graphics are two-dimensional vector graphics, that can be both static and dynamic. This plugin allows your to easily use them on your site.
6
- * Version: 3.0
7
  * Author: Sterling Hamilton
8
  * Author URI: http://www.sterlinghamilton.com/
9
  * License: GPLv2 or later
@@ -29,7 +29,7 @@ namespace SterlingHamilton\Plugins\ScalableVectorGraphics;
29
  // RFC 3023: https://www.ietf.org/rfc/rfc3023.txt 8.19, A.1, A.2, A.3, A.5, and A.7
30
  // Expects to interface with https://codex.wordpress.org/Plugin_API/Filter_Reference/upload_mimes
31
  function allow_svg_uploads( $existing_mime_types = array() ) {
32
- return array( 'svg' => 'image/svg+xml' );
33
  }
34
 
35
  // This is a decent way of grabbing the dimensions of SVG files.
3
  * Plugin Name: Scalable Vector Graphics (SVG)
4
  * Plugin URI: http://www.sterlinghamilton.com/projects/scalable-vector-graphics/
5
  * Description: Scalable Vector Graphics are two-dimensional vector graphics, that can be both static and dynamic. This plugin allows your to easily use them on your site.
6
+ * Version: 3.1
7
  * Author: Sterling Hamilton
8
  * Author URI: http://www.sterlinghamilton.com/
9
  * License: GPLv2 or later
29
  // RFC 3023: https://www.ietf.org/rfc/rfc3023.txt 8.19, A.1, A.2, A.3, A.5, and A.7
30
  // Expects to interface with https://codex.wordpress.org/Plugin_API/Filter_Reference/upload_mimes
31
  function allow_svg_uploads( $existing_mime_types = array() ) {
32
+ return $existing_mime_types + array( 'svg' => 'image/svg+xml' );
33
  }
34
 
35
  // This is a decent way of grabbing the dimensions of SVG files.