SVG Support - Version 2.2

Version Description

  • Added support to make SVG thumbnails visible in all media library screens.
  • Added SVGZ to the mime types.
  • Automatically removes the width and height attributes when inserting SVG files.
  • Added ability to choose whether the target class is automatically inserted into img tags or not, stripping the default WordPress classes.
  • Added ability to choose whether script is output in footer - true or false.
  • Blocked direct access to PHP files.
  • Added SCSS support using CodeKit - minified CSS + JS files.
  • Updated spelling for incorrect function name.
  • Changed comment formatting across all files for conistency.
  • Added link to $25 Free credit at GoWebben on the settings page.
  • Tested in WordPress 4.3.
  • Updated Readme file.
Download this release

Release Info

Developer Benbodhi
Plugin Icon 128x128 SVG Support
Version 2.2
Comparing to
See all releases

Code changes from version 2.1.7 to 2.2

admin/admin-init.php CHANGED
@@ -1,7 +1,10 @@
1
  <?php
2
- /********************************************
3
- * ADMIN INIT
4
- ********************************************/
 
 
 
5
 
6
  // add menu item to wp-admin
7
  add_action( 'admin_menu', 'bodhi_svgs_admin_menu' );
1
  <?php
2
+ /**
3
+ * ADMIN INIT
4
+ */
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly
7
+ }
8
 
9
  // add menu item to wp-admin
10
  add_action( 'admin_menu', 'bodhi_svgs_admin_menu' );
admin/plugin-action-meta-links.php CHANGED
@@ -1,7 +1,10 @@
1
  <?php
2
- /********************************************
3
- * PLUGIN ACTION & ROW META LINKS
4
- ********************************************/
 
 
 
5
 
6
  // add plugin_action_links
7
  add_filter( 'plugin_action_links_' . $plugin_file, 'bodhi_svgs_plugin_action_links' );
@@ -25,7 +28,8 @@ function bodhi_svgs_plugin_meta_links( $links, $file ) {
25
  $links,
26
  array(
27
  '<a target="_blank" href="http://wordpress.org/support/plugin/svg-support">' . __( 'Get Support', 'svgsupport') . '</a>',
28
- '<a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=F7W2NUFAVQGW2">' . __( 'Donate to author', 'svgsupport') . '</a>'
 
29
  )
30
  );
31
  }
1
  <?php
2
+ /**
3
+ * PLUGIN ACTION & ROW META LINKS
4
+ */
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly
7
+ }
8
 
9
  // add plugin_action_links
10
  add_filter( 'plugin_action_links_' . $plugin_file, 'bodhi_svgs_plugin_action_links' );
28
  $links,
29
  array(
30
  '<a target="_blank" href="http://wordpress.org/support/plugin/svg-support">' . __( 'Get Support', 'svgsupport') . '</a>',
31
+ '<a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=F7W2NUFAVQGW2">' . __( 'Donate to author', 'svgsupport') . '</a>',
32
+ '<a target="_blank" href="https://secure.gowebben.com/cart.php?promocode=SVGSUPPORT">' . __( '$25 Free Credit from GoWebben', 'svgsupport') . '</a>'
33
  )
34
  );
35
  }
admin/svgs-settings-page.php CHANGED
@@ -51,6 +51,28 @@
51
  <?php _e( 'Yes', 'svgsupport' ); ?><br /><small class="description"><?php _e(' Restricts SVG upload priveledges to Administrators.', 'svgsupport' ); ?></small>
52
  </td>
53
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  <tr valign="top">
55
  <th scope="row">
56
  <label for="bodhi_svgs_settings[css_target]"><strong><?php _e( 'CSS Class to target', 'svgsupport' ); ?></strong></label>
@@ -87,7 +109,9 @@
87
  <p><?php _e( 'The whole IMG tag element will now be dynamically replaced by the actual code of your SVG, making the inner content targetable.', 'svgsupport' ); ?><br />
88
  <?php _e( 'This allows you to target elements within your SVG using CSS.', 'svgsupport' ); ?></p>
89
 
90
- <p><em><?php _e( 'Note: Your uploaded image needs to be an SVG file for this plugin to replace the img tag with the inline SVG code. It will not create SVG files for you.', 'svgsupport' ); ?></em></p>
 
 
91
 
92
  </div> <!-- .inside -->
93
 
@@ -104,7 +128,7 @@
104
 
105
  <div class="postbox">
106
 
107
- <h3><span><?php _e( 'Features', 'svgsupport' ); ?></span></h3>
108
  <div class="inside">
109
  <ul>
110
  <li><?php _e( 'SVG Support for your media library', 'svgsupport' ); ?></li>
@@ -118,7 +142,7 @@
118
 
119
  <div class="postbox">
120
 
121
- <h3><span><?php _e( 'About the plugin', 'svgsupport' ); ?></span></h3>
122
  <div class="inside">
123
  <p><?php _e( 'You can read about this plugin in detail on', 'svgsupport' ); ?> <a target="_blank" href="http://wordpress.org/plugins/svg-support/"><?php _e( 'The WordPress Plugin Repository', 'svgsupport' ); ?></a>.</p>
124
  <p><?php _e( 'Need help?', 'svgsupport' ); ?> <a target="_blank" href="http://wordpress.org/support/plugin/svg-support"><?php _e( 'Visit Support', 'svgsupport' ); ?></a>.</p>
@@ -128,6 +152,15 @@
128
 
129
  </div> <!-- .postbox -->
130
 
 
 
 
 
 
 
 
 
 
131
  </div> <!-- .meta-box-sortables -->
132
 
133
  </div> <!-- #postbox-container-1 .postbox-container -->
51
  <?php _e( 'Yes', 'svgsupport' ); ?><br /><small class="description"><?php _e(' Restricts SVG upload priveledges to Administrators.', 'svgsupport' ); ?></small>
52
  </td>
53
  </tr>
54
+ <tr valign="top">
55
+ <!-- Allow choice of js in footer true or false -->
56
+ <th scope="row">
57
+ <label for="bodhi_svgs_settings[js_foot_choice]"><strong><?php _e( 'Output JS in Footer?', 'svgsupport' ); ?></strong></label>
58
+ </th>
59
+ <td>
60
+ <?php printf(
61
+ '<input id="bodhi_svgs_settings[js_foot_choice]" name="bodhi_svgs_settings[js_foot_choice]" type="checkbox" %2$s />', 'bodhi_svgs_settings_js_foot_choice', checked( isset( $bodhi_svgs_options['js_foot_choice'] ), true, false ) ); ?>
62
+ <?php _e( 'Yes', 'svgsupport' ); ?><br /><small class="description"><?php _e(' Normally, scripts are placed in <code>head</code> of the HTML document. If this parameter is true, the script is placed before the closing <code>body</code> tag. This requires the theme to have the <code>wp_footer()</code> template tag in the appropriate place.', 'svgsupport' ); ?></small>
63
+ </td>
64
+ </tr>
65
+ <tr valign="top">
66
+ <!-- Automatically insert class to target in images when inserting into posts/pages -->
67
+ <th scope="row">
68
+ <label for="bodhi_svgs_settings[auto_insert_class]"><strong><?php _e( 'Automatically insert class?', 'svgsupport' ); ?></strong></label>
69
+ </th>
70
+ <td>
71
+ <?php printf(
72
+ '<input id="bodhi_svgs_settings[auto_insert_class]" name="bodhi_svgs_settings[auto_insert_class]" type="checkbox" %2$s />', 'bodhi_svgs_settings_auto_insert_class', checked( isset( $bodhi_svgs_options['auto_insert_class'] ), true, false ) ); ?>
73
+ <?php _e( 'Yes', 'svgsupport' ); ?><br /><small class="description"><?php _e(' Checking this will make sure that either the default class or the custom one you set below is inserted into the style attributes of <code>img</code> tags when you insert images. Additionally, it will remove all of the default WordPress classes.', 'svgsupport' ); ?></small>
74
+ </td>
75
+ </tr>
76
  <tr valign="top">
77
  <th scope="row">
78
  <label for="bodhi_svgs_settings[css_target]"><strong><?php _e( 'CSS Class to target', 'svgsupport' ); ?></strong></label>
109
  <p><?php _e( 'The whole IMG tag element will now be dynamically replaced by the actual code of your SVG, making the inner content targetable.', 'svgsupport' ); ?><br />
110
  <?php _e( 'This allows you to target elements within your SVG using CSS.', 'svgsupport' ); ?></p>
111
 
112
+ <p><em><?php _e( 'Please Note:', 'svgsupport' ); ?></em>
113
+ <br><em><?php _e( '- You will need to set your own height and width in your CSS for SVG files to display correctly.', 'svgsupport' ); ?></em>
114
+ <br><em><?php _e( '- Your uploaded image needs to be an SVG file for this plugin to replace the img tag with the inline SVG code. It will not create SVG files for you.', 'svgsupport' ); ?></em></p>
115
 
116
  </div> <!-- .inside -->
117
 
128
 
129
  <div class="postbox">
130
 
131
+ <h3><span><?php _e( 'Plugin Features', 'svgsupport' ); ?></span></h3>
132
  <div class="inside">
133
  <ul>
134
  <li><?php _e( 'SVG Support for your media library', 'svgsupport' ); ?></li>
142
 
143
  <div class="postbox">
144
 
145
+ <h3><span><?php _e( 'About The Plugin', 'svgsupport' ); ?></span></h3>
146
  <div class="inside">
147
  <p><?php _e( 'You can read about this plugin in detail on', 'svgsupport' ); ?> <a target="_blank" href="http://wordpress.org/plugins/svg-support/"><?php _e( 'The WordPress Plugin Repository', 'svgsupport' ); ?></a>.</p>
148
  <p><?php _e( 'Need help?', 'svgsupport' ); ?> <a target="_blank" href="http://wordpress.org/support/plugin/svg-support"><?php _e( 'Visit Support', 'svgsupport' ); ?></a>.</p>
152
 
153
  </div> <!-- .postbox -->
154
 
155
+ <div class="postbox">
156
+
157
+ <h3><span><?php _e( 'GoWebben Hosting', 'svgsupport' ); ?></span></h3>
158
+ <div class="inside">
159
+ <p><a target="_blank" href="https://secure.gowebben.com/cart.php?promocode=SVGSUPPORT"><?php _e( 'Claim your FREE $25 credit from', 'svgsupport' ); ?> GoWebben</a> - <?php _e( 'No catch, just free credit for using this plugin! It will be applied automatically using the link provided, but in any case you can simply use code: SVGSUPPORT during checkout.', 'svgsupport' ); ?></p>
160
+ </div> <!-- .inside -->
161
+
162
+ </div> <!-- .postbox -->
163
+
164
  </div> <!-- .meta-box-sortables -->
165
 
166
  </div> <!-- #postbox-container-1 .postbox-container -->
css/.sass-cache/2d7711e41fe8fdd2638823a7fcb5fbf7b4fba050/svgs-admin.scssc ADDED
Binary file
css/svgs-admin.css CHANGED
@@ -1,7 +1 @@
1
- .svgs-version {
2
- font-size: 10px;
3
- margin-left: 7px;
4
- }
5
- .postbox .inside a {
6
- text-decoration: none;
7
- }
1
+ .svgs-version{font-size:10px;margin-left:7px}.postbox .inside a{text-decoration:none}
 
 
 
 
 
 
css/svgs-admin.scss ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ .svgs-version {
2
+ font-size: 10px;
3
+ margin-left: 7px;
4
+ }
5
+ .postbox .inside a {
6
+ text-decoration: none;
7
+ }
functions/attribute-control.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Attribute Control
4
+ */
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly
7
+ }
8
+
9
+ // filters the img tag class during insertion and returns SVG Support class
10
+ function bodhi_svgs_image_class_filter($classes) {
11
+
12
+ global $bodhi_svgs_options;
13
+
14
+ if ( !empty( $bodhi_svgs_options['css_target'] ) ) {
15
+ $classes = $bodhi_svgs_options['css_target'];
16
+ } else {
17
+ $classes = 'style-svg';
18
+ }
19
+ return $classes;
20
+
21
+ }
22
+ if ( !empty( $bodhi_svgs_options['auto_insert_class'] ) ) {
23
+ add_filter('get_image_tag_class', 'bodhi_svgs_image_class_filter');
24
+ }
25
+
26
+ // removes the width and height attributes during insertion of svg
27
+ function remove_dimensions_svg( $html='' ) {
28
+ if( preg_match( '/src="(.*[.]svg)"\s/', $html ) ) {
29
+ //$html = preg_replace( '/(width|height)="\d*"\s/', "", $html );
30
+ }
31
+ return str_ireplace( array( " width=\"1\"", " height=\"1\"" ), "", $html );
32
+ }
33
+ add_filter( 'post_thumbnail_html', 'remove_dimensions_svg', 10 );
34
+ add_filter( 'image_send_to_editor', 'remove_dimensions_svg', 10 );
functions/enqueue.php CHANGED
@@ -1,7 +1,10 @@
1
  <?php
2
- /********************************************
3
- * ENQUEUE SCRIPTS AND STYLES
4
- ********************************************/
 
 
 
5
 
6
  // enqueue and localize JS for IMG tag replacement
7
  add_action( 'wp_enqueue_scripts', 'bodhi_svgs_inline' );
@@ -12,14 +15,18 @@ function bodhi_svgs_inline() {
12
 
13
  $css_target = 'img.'. $bodhi_svgs_options['css_target']; // sets the custom class for use in JS
14
 
15
- wp_register_script('bodhi_svg_inline', plugins_url('svg-support/js/svg-inline.js'), array('jquery'), '1.0.0', false );
 
 
 
 
16
  wp_enqueue_script('bodhi_svg_inline');
17
  wp_localize_script( 'bodhi_svg_inline', 'cssTarget', $css_target );
18
 
19
  }
20
 
21
- // Check if we're on our settings page for conditional loading
22
- function bodhi_svgs_setings_page_only() {
23
 
24
  $screen = get_current_screen();
25
 
@@ -36,7 +43,7 @@ add_action( 'admin_enqueue_scripts', 'bodhi_svgs_admin_style' );
36
 
37
  function bodhi_svgs_admin_style() {
38
 
39
- if( bodhi_svgs_setings_page_only() ) {
40
  wp_enqueue_style( 'bodhi_svgs_admin_style', plugins_url('svg-support/css/svgs-admin.css') );
41
  }
42
 
1
  <?php
2
+ /**
3
+ * ENQUEUE SCRIPTS AND STYLES
4
+ */
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly
7
+ }
8
 
9
  // enqueue and localize JS for IMG tag replacement
10
  add_action( 'wp_enqueue_scripts', 'bodhi_svgs_inline' );
15
 
16
  $css_target = 'img.'. $bodhi_svgs_options['css_target']; // sets the custom class for use in JS
17
 
18
+ if ( ! empty( $bodhi_svgs_options['js_foot_choice'] ) ) {
19
+ wp_register_script('bodhi_svg_inline', plugins_url('svg-support/js/min/svg-inline-min.js'), array('jquery'), '1.0.0', true );
20
+ } else {
21
+ wp_register_script('bodhi_svg_inline', plugins_url('svg-support/js/min/svg-inline-min.js'), array('jquery'), '1.0.0', false );
22
+ }
23
  wp_enqueue_script('bodhi_svg_inline');
24
  wp_localize_script( 'bodhi_svg_inline', 'cssTarget', $css_target );
25
 
26
  }
27
 
28
+ // check if we're on our settings page for conditional loading
29
+ function bodhi_svgs_settings_page_only() {
30
 
31
  $screen = get_current_screen();
32
 
43
 
44
  function bodhi_svgs_admin_style() {
45
 
46
+ if( bodhi_svgs_settings_page_only() ) {
47
  wp_enqueue_style( 'bodhi_svgs_admin_style', plugins_url('svg-support/css/svgs-admin.css') );
48
  }
49
 
functions/localization.php CHANGED
@@ -1,7 +1,10 @@
1
  <?php
2
- /********************************************
3
- * INTERNATIONALIZATION / LOCALIZATION
4
- ********************************************/
 
 
 
5
 
6
  add_action( 'plugins_loaded', 'bodhi_svgs_localization' );
7
 
1
  <?php
2
+ /**
3
+ * INTERNATIONALIZATION / LOCALIZATION
4
+ */
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly
7
+ }
8
 
9
  add_action( 'plugins_loaded', 'bodhi_svgs_localization' );
10
 
functions/mime-types.php CHANGED
@@ -1,7 +1,10 @@
1
  <?php
2
- /********************************************
3
- * ADD MIME TYPES
4
- ********************************************/
 
 
 
5
 
6
  add_filter( 'upload_mimes', 'bodhi_svgs_upload_mimes' );
7
 
@@ -12,6 +15,7 @@ function bodhi_svgs_upload_mimes($mimes = array()) {
12
  if( empty( $bodhi_svgs_options['restrict'] ) || current_user_can( 'administrator' ) ) {
13
  // allow SVG file upload
14
  $mimes['svg'] = 'image/svg+xml';
 
15
  return $mimes;
16
  } else {
17
  return $mimes;
1
  <?php
2
+ /**
3
+ * ADD MIME TYPES
4
+ */
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly
7
+ }
8
 
9
  add_filter( 'upload_mimes', 'bodhi_svgs_upload_mimes' );
10
 
15
  if( empty( $bodhi_svgs_options['restrict'] ) || current_user_can( 'administrator' ) ) {
16
  // allow SVG file upload
17
  $mimes['svg'] = 'image/svg+xml';
18
+ $mimes['svgz'] = 'image/svg+xml';
19
  return $mimes;
20
  } else {
21
  return $mimes;
functions/thumbnail-display.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * ADD ABILITY TO VIEW THUMBNAILS IN WP 4.0+
4
+ */
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly
7
+ }
8
+
9
+ add_action('admin_init', 'bodhi_svgs_display_thumbs');
10
+
11
+ function bodhi_svgs_display_thumbs() {
12
+
13
+ ob_start();
14
+
15
+ add_action( 'shutdown', function() {
16
+
17
+ $final = '';
18
+ $ob_levels = count( ob_get_level() );
19
+
20
+ for ( $i = 0; $i < $ob_levels; $i++ ) {
21
+
22
+ $final .= ob_get_clean();
23
+
24
+ }
25
+
26
+ echo apply_filters( 'final_output', $final );
27
+
28
+ }, 0 );
29
+
30
+ add_filter( 'final_output', function( $content ) {
31
+
32
+ $content = str_replace(
33
+ '<# } else if ( \'image\' === data.type && data.sizes && data.sizes.full ) { #>',
34
+ '<# } else if ( \'svg+xml\' === data.subtype ) { #>
35
+ <img class="details-image" src="{{ data.url }}" draggable="false" />
36
+ <# } else if ( \'image\' === data.type && data.sizes && data.sizes.full ) { #>',
37
+
38
+ $content
39
+ );
40
+
41
+ $content = str_replace(
42
+ '<# } else if ( \'image\' === data.type && data.sizes ) { #>',
43
+ '<# } else if ( \'svg+xml\' === data.subtype ) { #>
44
+ <div class="centered">
45
+ <img src="{{ data.url }}" class="thumbnail" draggable="false" />
46
+ </div>
47
+ <# } else if ( \'image\' === data.type && data.sizes ) { #>',
48
+
49
+ $content
50
+ );
51
+
52
+ return $content;
53
+
54
+ });
55
+ }
js/min/svg-inline-min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function($){"img."!=cssTarget?jQuery(cssTarget).each(function(){var t=jQuery(this),e=t.attr("id"),r=t.attr("class"),a=t.attr("src");jQuery.get(a,function(a){var s=jQuery(a).find("svg");"undefined"!=typeof e&&(s=s.attr("id",e)),"undefined"!=typeof r&&(s=s.attr("class",r+" replaced-svg")),s=s.removeAttr("xmlns:a"),t.replaceWith(s)},"xml")}):jQuery("img.style-svg").each(function(){var t=jQuery(this),e=t.attr("id"),r=t.attr("class"),a=t.attr("src");jQuery.get(a,function(a){var s=jQuery(a).find("svg");"undefined"!=typeof e&&(s=s.attr("id",e)),"undefined"!=typeof r&&(s=s.attr("class",r+" replaced-svg")),s=s.removeAttr("xmlns:a"),t.replaceWith(s)},"xml")})});
languages/svgsupport-en_AU.mo CHANGED
Binary file
languages/svgsupport-en_AU.po CHANGED
@@ -1,239 +1,246 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: SVG Support v2.1.4\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2014-07-24 02:31:01+0000\n"
7
- "Last-Translator: Benbodhi <wp@benbodhi.com>\n"
8
- "Language-Team: \n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
- "X-Generator: CSL v1.x\n"
14
- "X-Poedit-Language: English\n"
15
- "X-Poedit-Country: AUSTRALIA\n"
16
- "X-Poedit-SourceCharset: utf-8\n"
17
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
18
- "X-Poedit-Basepath: ../\n"
19
- "X-Poedit-Bookmarks: \n"
20
- "X-Poedit-SearchPath-0: .\n"
21
- "X-Textdomain-Support: yes"
22
-
23
- #: admin/admin-init.php:12
24
- #@ svgsupport
25
- msgid "SVG Support Options and Instructions"
26
- msgstr ""
27
-
28
- #. translators: plugin header field 'Name'
29
- #: admin/admin-init.php:13
30
- #: svg-support.php:0
31
- #@ svgsupport
32
- msgid "SVG Support"
33
- msgstr ""
34
-
35
- #: admin/admin-init.php:26
36
- #@ svgsupport
37
- msgid "You can't play with this."
38
- msgstr ""
39
-
40
- #: admin/plugin-action-meta-links.php:27
41
- #@ svgsupport
42
- msgid "Get Support"
43
- msgstr ""
44
-
45
- #: admin/plugin-action-meta-links.php:28
46
- #@ svgsupport
47
- msgid "Donate to author"
48
- msgstr ""
49
-
50
- #: admin/svgs-settings-page.php:4
51
- #@ svgsupport
52
- msgid "SVG Support Settings and Usage"
53
- msgstr ""
54
-
55
- #: admin/svgs-settings-page.php:12
56
- #@ svgsupport
57
- msgid "Introduction"
58
- msgstr ""
59
-
60
- #: admin/svgs-settings-page.php:15
61
- #@ svgsupport
62
- msgid "When using SVG images on your WordPress site, it can be hard to style elements within the SVG using CSS. <strong>Now you can, easily!</strong>"
63
- msgstr ""
64
-
65
- #: admin/svgs-settings-page.php:16
66
- #@ svgsupport
67
- msgid "This plugin not only provides SVG Support like the name says, it also allows you to easily embed your full SVG file's code using a simple IMG tag. By adding the class <code>style-svg</code> to your IMG elements, this plugin dynamically replaces any IMG elements containing the <code>style-svg</code> class with your complete SVG."
68
- msgstr ""
69
-
70
- #: admin/svgs-settings-page.php:17
71
- #@ svgsupport
72
- msgid "The main purpose of this is to allow styling of SVG elements. Usually your styling options are restricted when using <code>embed</code>, <code>object</code> or <code>img</code> tags alone."
73
- msgstr ""
74
-
75
- #: admin/svgs-settings-page.php:34
76
- #@ svgsupport
77
- msgid "Settings"
78
- msgstr ""
79
-
80
- #: admin/svgs-settings-page.php:46
81
- #@ svgsupport
82
- msgid "Restrict to Administrators"
83
- msgstr ""
84
-
85
- #: admin/svgs-settings-page.php:51
86
- #@ svgsupport
87
- msgid "Yes"
88
- msgstr ""
89
-
90
- #: admin/svgs-settings-page.php:51
91
- #@ svgsupport
92
- msgid " Restricts SVG upload priveledges to Administrators."
93
- msgstr ""
94
-
95
- #: admin/svgs-settings-page.php:56
96
- #@ svgsupport
97
- msgid "CSS Class to target"
98
- msgstr ""
99
-
100
- #: admin/svgs-settings-page.php:59
101
- #@ svgsupport
102
- msgid "The default target class is <code>style-svg</code>. You can change it to your own class such as <code>my-class</code> by typing it here.<br />Leave blank to use the default class."
103
- msgstr ""
104
-
105
- #: admin/svgs-settings-page.php:65
106
- #@ svgsupport
107
- msgid "Save Changes"
108
- msgstr ""
109
-
110
- #: admin/svgs-settings-page.php:76
111
- #@ svgsupport
112
- msgid "Usage"
113
- msgstr ""
114
-
115
- #: admin/svgs-settings-page.php:79
116
- #@ svgsupport
117
- msgid "You can simply upload SVG images to your media library like any other file."
118
- msgstr ""
119
-
120
- #: admin/svgs-settings-page.php:80
121
- #@ svgsupport
122
- msgid "Now, embed your SVG image like a standard image with the addition of adding the class <code>style-svg</code> (or your custom class from above) to any IMG tags that you want this plugin to swap out with your actual SVG code."
123
- msgstr ""
124
-
125
- #: admin/svgs-settings-page.php:81
126
- #@ svgsupport
127
- msgid "For example:"
128
- msgstr ""
129
-
130
- #: admin/svgs-settings-page.php:84
131
- #@ svgsupport
132
- msgid "or"
133
- msgstr ""
134
-
135
- #: admin/svgs-settings-page.php:87
136
- #@ svgsupport
137
- msgid "The whole IMG tag element will now be dynamically replaced by the actual code of your SVG, making the inner content targetable."
138
- msgstr ""
139
-
140
- #: admin/svgs-settings-page.php:88
141
- #@ svgsupport
142
- msgid "This allows you to target elements within your SVG using CSS."
143
- msgstr ""
144
-
145
- #: admin/svgs-settings-page.php:90
146
- #@ svgsupport
147
- msgid "Note: Your uploaded image needs to be an SVG file for this plugin to replace the img tag with the inline SVG code. It will not create SVG files for you."
148
- msgstr ""
149
-
150
- #: admin/svgs-settings-page.php:107
151
- #@ svgsupport
152
- msgid "Features"
153
- msgstr ""
154
-
155
- #: admin/svgs-settings-page.php:110
156
- #@ svgsupport
157
- msgid "SVG Support for your media library"
158
- msgstr ""
159
-
160
- #: admin/svgs-settings-page.php:111
161
- #@ svgsupport
162
- msgid "Style SVG elements directly using CSS"
163
- msgstr ""
164
-
165
- #: admin/svgs-settings-page.php:112
166
- #@ svgsupport
167
- msgid "Restrict to Administrators only"
168
- msgstr ""
169
-
170
- #: admin/svgs-settings-page.php:113
171
- #@ svgsupport
172
- msgid "Extremely Simple To Use"
173
- msgstr ""
174
-
175
- #: admin/svgs-settings-page.php:121
176
- #@ svgsupport
177
- msgid "About the plugin"
178
- msgstr ""
179
-
180
- #: admin/svgs-settings-page.php:123
181
- #@ svgsupport
182
- msgid "You can read about this plugin in detail on"
183
- msgstr ""
184
-
185
- #: admin/svgs-settings-page.php:123
186
- #@ svgsupport
187
- msgid "The WordPress Plugin Repository"
188
- msgstr ""
189
-
190
- #: admin/svgs-settings-page.php:124
191
- #@ svgsupport
192
- msgid "Need help?"
193
- msgstr ""
194
-
195
- #: admin/svgs-settings-page.php:124
196
- #@ svgsupport
197
- msgid "Visit Support"
198
- msgstr ""
199
-
200
- #: admin/svgs-settings-page.php:125
201
- #@ svgsupport
202
- msgid "Buy Benbodhi a Beer &rarr;"
203
- msgstr ""
204
-
205
- #: admin/svgs-settings-page.php:126
206
- #@ svgsupport
207
- msgid "from"
208
- msgstr ""
209
-
210
- #. translators: plugin header field 'PluginURI'
211
- #: svg-support.php:0
212
- #@ svgsupport
213
- msgid "http://wordpress.org/plugins/svg-support/"
214
- msgstr ""
215
-
216
- #. translators: plugin header field 'Description'
217
- #: svg-support.php:0
218
- #@ svgsupport
219
- msgid "Allow SVG file uploads using the WordPress Media Library uploader plus direct styling of SVG elements using CSS."
220
- msgstr ""
221
-
222
- #. translators: plugin header field 'Author'
223
- #: svg-support.php:0
224
- #@ svgsupport
225
- msgid "Benbodhi"
226
- msgstr ""
227
-
228
- #. translators: plugin header field 'AuthorURI'
229
- #: svg-support.php:0
230
- #@ svgsupport
231
- msgid "http://benbodhi.com"
232
- msgstr ""
233
-
234
- #. translators: plugin header field 'Version'
235
- #: svg-support.php:0
236
- #@ svgsupport
237
- msgid "2.1.4"
238
- msgstr ""
239
-
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: SVG Support v2.1.4\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: Sat Aug 08 2015 12:47:54 GMT+1000 (AEST)\n"
7
+ "Last-Translator: Benbodhi <benbodhi@gmail.com>\n"
8
+ "Language-Team: \n"
9
+ "Language: English (Australia)\n"
10
+ "Plural-Forms: nplurals=2; plural=n != 1\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Generator: Loco - https://localise.biz/\n"
16
+ "X-Poedit-Language: English\n"
17
+ "X-Poedit-Country: AUSTRALIA\n"
18
+ "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
19
+ "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
20
+ "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
21
+ "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
22
+ "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
23
+ "X-Poedit-Basepath: ../\n"
24
+ "X-Poedit-Bookmarks: \n"
25
+ "X-Poedit-SearchPath-0: .\n"
26
+ "X-Textdomain-Support: yes\n"
27
+ "X-Loco-Target-Locale: en_AU"
28
+
29
+ #: admin/admin-init.php:12
30
+ msgid "SVG Support Options and Instructions"
31
+ msgstr "SVG Support Options and Instructions"
32
+
33
+ #. translators: plugin header field 'Name'
34
+ #: admin/admin-init.php:13
35
+ #: svg-support.php:0
36
+ msgid "SVG Support"
37
+ msgstr "SVG Support"
38
+
39
+ #: admin/admin-init.php:26
40
+ msgid "You can't play with this."
41
+ msgstr "You can't play with this."
42
+
43
+ #: admin/plugin-action-meta-links.php:27
44
+ msgid "Get Support"
45
+ msgstr "Get Support"
46
+
47
+ #: admin/plugin-action-meta-links.php:28
48
+ msgid "Donate to author"
49
+ msgstr "Donate to author"
50
+
51
+ #: admin/svgs-settings-page.php:4
52
+ msgid "SVG Support Settings and Usage"
53
+ msgstr "SVG Support Settings and Usage"
54
+
55
+ #: admin/svgs-settings-page.php:12
56
+ msgid "Introduction"
57
+ msgstr "Introduction"
58
+
59
+ #: admin/svgs-settings-page.php:15
60
+ msgid ""
61
+ "When using SVG images on your WordPress site, it can be hard to style "
62
+ "elements within the SVG using CSS. <strong>Now you can, easily!</strong>"
63
+ msgstr ""
64
+ "When using SVG images on your WordPress site, it can be hard to style "
65
+ "elements within the SVG using CSS. <strong>Now you can, easily!</strong>"
66
+
67
+ #: admin/svgs-settings-page.php:16
68
+ msgid ""
69
+ "This plugin not only provides SVG Support like the name says, it also allows "
70
+ "you to easily embed your full SVG file's code using a simple IMG tag. By "
71
+ "adding the class <code>style-svg</code> to your IMG elements, this plugin "
72
+ "dynamically replaces any IMG elements containing the <code>style-svg</code> "
73
+ "class with your complete SVG."
74
+ msgstr ""
75
+ "This plugin not only provides SVG Support like the name says, it also allows "
76
+ "you to easily embed your full SVG file's code using a simple IMG tag. By "
77
+ "adding the class <code>style-svg</code> to your IMG elements, this plugin "
78
+ "dynamically replaces any IMG elements containing the <code>style-svg</code> "
79
+ "class with your complete SVG."
80
+
81
+ #: admin/svgs-settings-page.php:17
82
+ msgid ""
83
+ "The main purpose of this is to allow styling of SVG elements. Usually your "
84
+ "styling options are restricted when using <code>embed</code>, "
85
+ "<code>object</code> or <code>img</code> tags alone."
86
+ msgstr ""
87
+ "The main purpose of this is to allow styling of SVG elements. Usually your "
88
+ "styling options are restricted when using <code>embed</code>, "
89
+ "<code>object</code> or <code>img</code> tags alone."
90
+
91
+ #: admin/svgs-settings-page.php:34
92
+ msgid "Settings"
93
+ msgstr "Settings"
94
+
95
+ #: admin/svgs-settings-page.php:46
96
+ msgid "Restrict to Administrators"
97
+ msgstr "Restrict to Administrators"
98
+
99
+ #: admin/svgs-settings-page.php:51
100
+ msgid "Yes"
101
+ msgstr "Yes"
102
+
103
+ #: admin/svgs-settings-page.php:51
104
+ msgid " Restricts SVG upload priveledges to Administrators."
105
+ msgstr " Restricts SVG upload priveledges to Administrators."
106
+
107
+ #: admin/svgs-settings-page.php:56
108
+ msgid "CSS Class to target"
109
+ msgstr "CSS Class to target"
110
+
111
+ #: admin/svgs-settings-page.php:59
112
+ msgid ""
113
+ "The default target class is <code>style-svg</code>. You can change it to "
114
+ "your own class such as <code>my-class</code> by typing it here.<br />Leave "
115
+ "blank to use the default class."
116
+ msgstr ""
117
+ "The default target class is <code>style-svg</code>. You can change it to "
118
+ "your own class such as <code>my-class</code> by typing it here.<br />Leave "
119
+ "blank to use the default class."
120
+
121
+ #: admin/svgs-settings-page.php:65
122
+ msgid "Save Changes"
123
+ msgstr "Save Changes"
124
+
125
+ #: admin/svgs-settings-page.php:76
126
+ msgid "Usage"
127
+ msgstr "Usage"
128
+
129
+ #: admin/svgs-settings-page.php:79
130
+ msgid "You can simply upload SVG images to your media library like any other file."
131
+ msgstr "You can simply upload SVG images to your media library like any other file."
132
+
133
+ #: admin/svgs-settings-page.php:80
134
+ msgid ""
135
+ "Now, embed your SVG image like a standard image with the addition of adding "
136
+ "the class <code>style-svg</code> (or your custom class from above) to any "
137
+ "IMG tags that you want this plugin to swap out with your actual SVG code."
138
+ msgstr ""
139
+ "Now, embed your SVG image like a standard image with the addition of adding "
140
+ "the class <code>style-svg</code> (or your custom class from above) to any "
141
+ "IMG tags that you want this plugin to swap out with your actual SVG code."
142
+
143
+ #: admin/svgs-settings-page.php:81
144
+ msgid "For example:"
145
+ msgstr "For example:"
146
+
147
+ #: admin/svgs-settings-page.php:84
148
+ msgid "or"
149
+ msgstr "or"
150
+
151
+ #: admin/svgs-settings-page.php:87
152
+ msgid ""
153
+ "The whole IMG tag element will now be dynamically replaced by the actual "
154
+ "code of your SVG, making the inner content targetable."
155
+ msgstr ""
156
+ "The whole IMG tag element will now be dynamically replaced by the actual "
157
+ "code of your SVG, making the inner content targetable."
158
+
159
+ #: admin/svgs-settings-page.php:88
160
+ msgid "This allows you to target elements within your SVG using CSS."
161
+ msgstr "This allows you to target elements within your SVG using CSS."
162
+
163
+ #: admin/svgs-settings-page.php:90
164
+ msgid ""
165
+ "Note: Your uploaded image needs to be an SVG file for this plugin to replace "
166
+ "the img tag with the inline SVG code. It will not create SVG files for you."
167
+ msgstr ""
168
+ "Note: Your uploaded image needs to be an SVG file for this plugin to replace "
169
+ "the img tag with the inline SVG code. It will not create SVG files for you."
170
+
171
+ #: admin/svgs-settings-page.php:107
172
+ msgid "Features"
173
+ msgstr "Features"
174
+
175
+ #: admin/svgs-settings-page.php:110
176
+ msgid "SVG Support for your media library"
177
+ msgstr "SVG Support for your media library"
178
+
179
+ #: admin/svgs-settings-page.php:111
180
+ msgid "Style SVG elements directly using CSS"
181
+ msgstr "Style SVG elements directly using CSS"
182
+
183
+ #: admin/svgs-settings-page.php:112
184
+ msgid "Restrict to Administrators only"
185
+ msgstr "Restrict to Administrators only"
186
+
187
+ #: admin/svgs-settings-page.php:113
188
+ msgid "Extremely Simple To Use"
189
+ msgstr "Extremely Simple To Use"
190
+
191
+ #: admin/svgs-settings-page.php:121
192
+ msgid "About the plugin"
193
+ msgstr "About the plugin"
194
+
195
+ #: admin/svgs-settings-page.php:123
196
+ msgid "You can read about this plugin in detail on"
197
+ msgstr "You can read about this plugin in detail on"
198
+
199
+ #: admin/svgs-settings-page.php:123
200
+ msgid "The WordPress Plugin Repository"
201
+ msgstr "The WordPress Plugin Repository"
202
+
203
+ #: admin/svgs-settings-page.php:124
204
+ msgid "Need help?"
205
+ msgstr "Need help?"
206
+
207
+ #: admin/svgs-settings-page.php:124
208
+ msgid "Visit Support"
209
+ msgstr "Visit Support"
210
+
211
+ #: admin/svgs-settings-page.php:125
212
+ msgid "Buy Benbodhi a Beer &rarr;"
213
+ msgstr "Buy Benbodhi a Beer &rarr;"
214
+
215
+ #: admin/svgs-settings-page.php:126
216
+ msgid "from"
217
+ msgstr "from"
218
+
219
+ #. translators: plugin header field 'PluginURI'
220
+ #: svg-support.php:0
221
+ msgid "http://wordpress.org/plugins/svg-support/"
222
+ msgstr "http://wordpress.org/plugins/svg-support/"
223
+
224
+ #. translators: plugin header field 'Description'
225
+ #: svg-support.php:0
226
+ msgid ""
227
+ "Allow SVG file uploads using the WordPress Media Library uploader plus "
228
+ "direct styling of SVG elements using CSS."
229
+ msgstr ""
230
+ "Allow SVG file uploads using the WordPress Media Library uploader plus "
231
+ "direct styling of SVG elements using CSS."
232
+
233
+ #. translators: plugin header field 'Author'
234
+ #: svg-support.php:0
235
+ msgid "Benbodhi"
236
+ msgstr "Benbodhi"
237
+
238
+ #. translators: plugin header field 'AuthorURI'
239
+ #: svg-support.php:0
240
+ msgid "http://benbodhi.com"
241
+ msgstr "http://benbodhi.com"
242
+
243
+ #. translators: plugin header field 'Version'
244
+ #: svg-support.php:0
245
+ msgid "2.1.4"
246
+ msgstr "2.1.4"
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: Benbodhi
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=F7W2NUFAVQGW2
4
  Tags: svg, vector, css, style, mime, mime type, embed, img, inline
5
- Requires at least: 3.4
6
- Tested up to: 4.2
7
- Stable tag: 2.1.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -30,21 +30,15 @@ The main purpose of this is to allow styling of SVG elements. Usually your styli
30
  * Set custom css target class
31
  * **Extremely Simple To Use**
32
 
33
- = Note: =
34
- This plugin works up to WordPress v4.0 but after v3.9.2 the thumbnails do not display in the new media library grid view or modal window from the grid view.
35
- You can still see them in the list view of v4.0 (they are super small) and can see them perfectly when in the edit media screen from the list view.
36
-
37
- Apart from this, **all of the main functionality is still working**. I am working on a fix to display the thumbnails in the media library.
38
-
39
  = Usage =
40
 
41
  Firstly, install SVG Support (this plugin) and activate it.
42
 
43
  Once activated, you can simply upload SVG images to your media library like any other file.
44
 
45
- As an administrator, you can go to the admin settings page 'Settings' > 'SVG Support' and restrict SVG file uploads to administrators only and even define a custom class to target if you wish.
46
 
47
- Now, embed your SVG images just like you would a standard image with the addition of adding the class `"style-svg"` (or the custom class you defined) to your IMG tags that you want this plugin to swap out with your actual SVG code.<br />
48
  For example:
49
 
50
  `<img class="style-svg" alt="alt-text" src="image-source.svg" />`
@@ -54,6 +48,8 @@ or
54
  The whole IMG tag element will now be dynamically replaced by the actual code of your SVG, making the inner content targetable.<br />
55
  This allows you to target elements within your SVG using CSS.
56
 
 
 
57
  *If you are having any issues, please use the support tab and I will try my best to get back to you quickly*
58
 
59
  = Security =
@@ -67,7 +63,7 @@ As with allowing uploads of any files, there is potential risks involved. Only a
67
  * *Your translation? - [Just send it in](http://gowebben.com/contact/)*
68
 
69
  *Note:* This plugin is localized/translateable by default. This is very important for all users worldwide. So please contribute your language to the plugin to make it even more useful.<br />
70
- For translating I recommend the awesome ["Codestyling Localization" plugin](http://wordpress.org/extend/plugins/codestyling-localization/) and for validating the ["Poedit Editor"](http://www.poedit.net/).
71
 
72
  = Feedback =
73
 
@@ -113,6 +109,21 @@ I will put the answers to any questions asked here.
113
 
114
  == Changelog ==
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  = 2.1.7 =
117
 
118
  * Tested in WordPress 4.0 and added plugin icons for the new interface.
@@ -163,6 +174,10 @@ I will put the answers to any questions asked here.
163
 
164
  == Upgrade Notice ==
165
 
 
 
 
 
166
  = 2.1.7 =
167
 
168
  * Tested in WordPress 4.0 and added plugin icons for the new interface.
@@ -209,7 +224,7 @@ I will put the answers to any questions asked here.
209
  * Serbian - translated and submitted by Ogi Djuraskovic from [first site guide]( http://firstsiteguide.com/)
210
  * *Your translation? - [Just send it in](mailto:wp@benbodhi.com)*
211
 
212
- *Note:* This plugin is localized/translateable by default. This is very important for all users worldwide. So please contribute your language to the plugin to make it even more useful. For translating I recommend the awesome ["Codestyling Localization" plugin](http://wordpress.org/extend/plugins/codestyling-localization/) and for validating the ["Poedit Editor"](http://www.poedit.net/).
213
 
214
  == Additional Info ==
215
  **Idea Behind / Philosophy:** I needed an easy way to include SVG support in sites instead of having to copy and paste the code for each one. I found a [really cool snippet](http://stackoverflow.com/questions/11978995/how-to-change-color-of-svg-image-using-css-jquery-svg-image-replacement) of jQuery written by Drew Baker a while ago and have used it (modified for WordPress) a few times until I was inspired to build it all into a plugin for ease of use and to share with others. Now styling SVG elements is super easy :)
2
  Contributors: Benbodhi
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=F7W2NUFAVQGW2
4
  Tags: svg, vector, css, style, mime, mime type, embed, img, inline
5
+ Requires at least: 4.0
6
+ Tested up to: 4.3
7
+ Stable tag: 2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
30
  * Set custom css target class
31
  * **Extremely Simple To Use**
32
 
 
 
 
 
 
 
33
  = Usage =
34
 
35
  Firstly, install SVG Support (this plugin) and activate it.
36
 
37
  Once activated, you can simply upload SVG images to your media library like any other file.
38
 
39
+ As an administrator, you can go to the admin settings page 'Settings' > 'SVG Support' and restrict SVG file uploads to administrators only and even define a custom CSS class to target if you wish.
40
 
41
+ Now, embed your SVG images just like you would a standard image with the addition of adding (in text view) the class `"style-svg"` (or the custom class you defined) to your IMG tags that you want this plugin to swap out with your actual SVG code. You can also remove any other attributes from the tag and use CSS to manage the size.<br />
42
  For example:
43
 
44
  `<img class="style-svg" alt="alt-text" src="image-source.svg" />`
48
  The whole IMG tag element will now be dynamically replaced by the actual code of your SVG, making the inner content targetable.<br />
49
  This allows you to target elements within your SVG using CSS.
50
 
51
+ Please Note: You will need to set your own height and width in your CSS for SVG files to display correctly.
52
+
53
  *If you are having any issues, please use the support tab and I will try my best to get back to you quickly*
54
 
55
  = Security =
63
  * *Your translation? - [Just send it in](http://gowebben.com/contact/)*
64
 
65
  *Note:* This plugin is localized/translateable by default. This is very important for all users worldwide. So please contribute your language to the plugin to make it even more useful.<br />
66
+ For translating I recommend ["Loco Translate" plugin](https://wordpress.org/plugins/loco-translate/) and for validating the ["Poedit Editor"](http://www.poedit.net/).
67
 
68
  = Feedback =
69
 
109
 
110
  == Changelog ==
111
 
112
+ = 2.2 =
113
+
114
+ * Added support to make SVG thumbnails visible in all media library screens.
115
+ * Added SVGZ to the mime types.
116
+ * Automatically removes the width and height attributes when inserting SVG files.
117
+ * Added ability to choose whether the target class is automatically inserted into img tags or not, stripping the default WordPress classes.
118
+ * Added ability to choose whether script is output in footer - true or false.
119
+ * Blocked direct access to PHP files.
120
+ * Added SCSS support using CodeKit - minified CSS + JS files.
121
+ * Updated spelling for incorrect function name.
122
+ * Changed comment formatting across all files for conistency.
123
+ * Added link to $25 Free credit at GoWebben on the settings page.
124
+ * Tested in WordPress 4.3.
125
+ * Updated Readme file.
126
+
127
  = 2.1.7 =
128
 
129
  * Tested in WordPress 4.0 and added plugin icons for the new interface.
174
 
175
  == Upgrade Notice ==
176
 
177
+ = 2.2 =
178
+
179
+ * Significant changes, added functionality, please BACKUP BEFORE UPDATING just in case.
180
+
181
  = 2.1.7 =
182
 
183
  * Tested in WordPress 4.0 and added plugin icons for the new interface.
224
  * Serbian - translated and submitted by Ogi Djuraskovic from [first site guide]( http://firstsiteguide.com/)
225
  * *Your translation? - [Just send it in](mailto:wp@benbodhi.com)*
226
 
227
+ *Note:* This plugin is localized/translateable by default. This is very important for all users worldwide. So please contribute your language to the plugin to make it even more useful. For translating I recommend ["Loco Translate" plugin](https://wordpress.org/plugins/loco-translate/) and for validating the ["Poedit Editor"](http://www.poedit.net/).
228
 
229
  == Additional Info ==
230
  **Idea Behind / Philosophy:** I needed an easy way to include SVG support in sites instead of having to copy and paste the code for each one. I found a [really cool snippet](http://stackoverflow.com/questions/11978995/how-to-change-color-of-svg-image-using-css-jquery-svg-image-replacement) of jQuery written by Drew Baker a while ago and have used it (modified for WordPress) a few times until I was inspired to build it all into a plugin for ease of use and to share with others. Now styling SVG elements is super easy :)
svg-support.php CHANGED
@@ -3,33 +3,39 @@
3
  Plugin Name: SVG Support
4
  Plugin URI: http://wordpress.org/plugins/svg-support/
5
  Description: Allow SVG file uploads using the WordPress Media Library uploader plus direct styling of SVG elements using CSS.
 
6
  Author: Benbodhi
7
  Author URI: http://benbodhi.com
8
  Text Domain: svgsupport
9
  Domain Path: /languages
10
  License: GPL2
11
- Version: 2.1.7
12
- */
13
- /* Copyright 2013 Benbodhi (email : wp@benbodhi.com)
14
 
15
  This program is free software; you can redistribute it and/or modify
16
- it under the terms of the GNU General Public License, version 2, as
17
- published by the Free Software Foundation.
18
 
19
  This program is distributed in the hope that it will be useful,
20
  but WITHOUT ANY WARRANTY; without even the implied warranty of
21
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
  GNU General Public License for more details.
23
 
24
- You should have received a copy of the GNU General Public License
25
- along with this program; if not, write to the Free Software
26
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
27
  */
28
 
 
 
 
 
29
  /********************************************
30
  * GLOBAL VARIABLES
31
  ********************************************/
32
- $plugin_version = '2.1.7'; // for use on admin pages
33
  $plugin_file = plugin_basename(__FILE__); // plugin file for reference
34
  define( 'BODHI_SVGS_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); // define the absolute plugin path for includes
35
  $bodhi_svgs_options = get_option('bodhi_svgs_settings'); // retrieve our plugin settings from the options table
@@ -40,7 +46,9 @@ $bodhi_svgs_options = get_option('bodhi_svgs_settings'); // retrieve our plugi
40
  include( BODHI_SVGS_PLUGIN_PATH . 'admin/admin-init.php' ); // initialize admin menu & settings page
41
  include( BODHI_SVGS_PLUGIN_PATH . 'admin/plugin-action-meta-links.php' ); // add links to the plugin on the plugins page
42
  include( BODHI_SVGS_PLUGIN_PATH . 'functions/mime-types.php' ); // setup mime types support for SVG
 
43
  include( BODHI_SVGS_PLUGIN_PATH . 'functions/enqueue.php' ); // enqueue js & css for inline replacement & admin
44
  include( BODHI_SVGS_PLUGIN_PATH . 'functions/localization.php' ); // setup localization & languages
 
45
 
46
  ?>
3
  Plugin Name: SVG Support
4
  Plugin URI: http://wordpress.org/plugins/svg-support/
5
  Description: Allow SVG file uploads using the WordPress Media Library uploader plus direct styling of SVG elements using CSS.
6
+ Version: 2.2
7
  Author: Benbodhi
8
  Author URI: http://benbodhi.com
9
  Text Domain: svgsupport
10
  Domain Path: /languages
11
  License: GPL2
12
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
+
14
+ Copyright 2013 Benbodhi (email : wp@benbodhi.com)
15
 
16
  This program is free software; you can redistribute it and/or modify
17
+ it under the terms of the GNU General Public License, version 2,
18
+ as published by the Free Software Foundation.
19
 
20
  This program is distributed in the hope that it will be useful,
21
  but WITHOUT ANY WARRANTY; without even the implied warranty of
22
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
  GNU General Public License for more details.
24
 
25
+ The license for this software can likely be found here:
26
+ http://www.gnu.org/licenses/gpl-2.0.html
27
+ If not, write to the Free Software Foundation Inc.
28
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
  */
30
 
31
+ if ( ! defined( 'ABSPATH' ) ) {
32
+ exit; // Exit if accessed directly
33
+ }
34
+
35
  /********************************************
36
  * GLOBAL VARIABLES
37
  ********************************************/
38
+ $plugin_version = '2.2'; // for use on admin pages
39
  $plugin_file = plugin_basename(__FILE__); // plugin file for reference
40
  define( 'BODHI_SVGS_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); // define the absolute plugin path for includes
41
  $bodhi_svgs_options = get_option('bodhi_svgs_settings'); // retrieve our plugin settings from the options table
46
  include( BODHI_SVGS_PLUGIN_PATH . 'admin/admin-init.php' ); // initialize admin menu & settings page
47
  include( BODHI_SVGS_PLUGIN_PATH . 'admin/plugin-action-meta-links.php' ); // add links to the plugin on the plugins page
48
  include( BODHI_SVGS_PLUGIN_PATH . 'functions/mime-types.php' ); // setup mime types support for SVG
49
+ include( BODHI_SVGS_PLUGIN_PATH . 'functions/thumbnail-display.php' ); // make SVG thumbnails display correctly in media library
50
  include( BODHI_SVGS_PLUGIN_PATH . 'functions/enqueue.php' ); // enqueue js & css for inline replacement & admin
51
  include( BODHI_SVGS_PLUGIN_PATH . 'functions/localization.php' ); // setup localization & languages
52
+ include( BODHI_SVGS_PLUGIN_PATH . 'functions/attribute-control.php' ); // auto set SVG class & remove dimensions during insertion
53
 
54
  ?>