Better Font Awesome - Version 0.9.7

Version Description

  • Fixed bug causing warning notices and missing icons.
Download this release

Release Info

Developer McGuive7
Plugin Icon 128x128 Better Font Awesome
Version 0.9.7
Comparing to
See all releases

Code changes from version 0.9.6 to 0.9.7

Files changed (2) hide show
  1. better-font-awesome.php +26 -22
  2. readme.txt +8 -2
better-font-awesome.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Better Font Awesome
4
  * Plugin URI: http://wordpress.org/plugins/better-font-awesome
5
  * Description: The ultimate Font Awesome icon plugin for Wordpress.
6
- * Version: 0.9.6
7
  * Author: MIGHTYminnow
8
  * Author URI: mickey@mickeykaycreative.com
9
  * License: GPLv2+
@@ -157,27 +157,31 @@ class BetterFontAwesome {
157
  */
158
  function get_icons() {
159
  // Get Font Awesome CSS
160
-
161
-
162
- $remote_data = wp_remote_get( '//s' . $this->stylesheet_url );
163
- $css = wp_remote_retrieve_body( $remote_data );
164
-
165
- // Get all CSS selectors that have a content: pseudo-element rule
166
- preg_match_all('/(\.[^}]*)\s*{\s*(content:)/s', $css, $matches );
167
- $selectors = $matches[1];
168
-
169
- // Select all icon- and fa- selectors from and split where there are commas
170
- foreach ( $selectors as $selector ) {
171
- preg_match_all('/\.(icon-|fa-)([^,]*)\s*:before/s', $selector, $matches );
172
- $clean_selectors = $matches[2];
173
-
174
- // Create array of selectors
175
- foreach( $clean_selectors as $clean_selector )
176
- $this->icons[] = $clean_selector;
177
- }
178
-
179
- // Alphabetize & join with comma for use in JS array
180
- sort( $this->icons );
 
 
 
 
181
  }
182
 
183
  /**
3
  * Plugin Name: Better Font Awesome
4
  * Plugin URI: http://wordpress.org/plugins/better-font-awesome
5
  * Description: The ultimate Font Awesome icon plugin for Wordpress.
6
+ * Version: 0.9.7
7
  * Author: MIGHTYminnow
8
  * Author URI: mickey@mickeykaycreative.com
9
  * License: GPLv2+
157
  */
158
  function get_icons() {
159
  // Get Font Awesome CSS
160
+ if ( is_ssl() ) {
161
+ $prefix = 'https:';
162
+ } else {
163
+ $prefix = 'http:';
164
+ }
165
+
166
+ $remote_data = wp_remote_get( $prefix . $this->stylesheet_url );
167
+ $css = wp_remote_retrieve_body( $remote_data );
168
+
169
+ // Get all CSS selectors that have a content: pseudo-element rule
170
+ preg_match_all( '/(\.[^}]*)\s*{\s*(content:)/s', $css, $matches );
171
+ $selectors = $matches[1];
172
+
173
+ // Select all icon- and fa- selectors from and split where there are commas
174
+ foreach ( $selectors as $selector ) {
175
+ preg_match_all( '/\.(icon-|fa-)([^,]*)\s*:before/s', $selector, $matches );
176
+ $clean_selectors = $matches[2];
177
+
178
+ // Create array of selectors
179
+ foreach ( $clean_selectors as $clean_selector )
180
+ $this->icons[] = $clean_selector;
181
+ }
182
+
183
+ // Alphabetize & join with comma for use in JS array
184
+ sort( $this->icons );
185
  }
186
 
187
  /**
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: McGuive7, MIGHTYminnow
3
  Tags: better, font, awesome, icon, bootstrap, fontstrap, cdn, shortcode
4
  Donate link: http://mightyminnow.com
5
  Requires at least: 3.0
6
- Tested up to: 3.9
7
- Stable tag: 0.9.6
8
  License: GPLv2+
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -112,6 +112,9 @@ Better Font Awesome does it's best to load after any existing Font Awesome CSS,
112
 
113
  == Changelog ==
114
 
 
 
 
115
  = 0.9.6 =
116
  * Fixed missing icon previews in WordPress 3.8 and below.
117
 
@@ -141,6 +144,9 @@ Better Font Awesome does it's best to load after any existing Font Awesome CSS,
141
 
142
  == Upgrade Notice ==
143
 
 
 
 
144
  = 0.9.6 =
145
  * Fixed missing icon previews in WordPress 3.8 and below.
146
 
3
  Tags: better, font, awesome, icon, bootstrap, fontstrap, cdn, shortcode
4
  Donate link: http://mightyminnow.com
5
  Requires at least: 3.0
6
+ Tested up to: 3.9.1
7
+ Stable tag: 0.9.7
8
  License: GPLv2+
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
112
 
113
  == Changelog ==
114
 
115
+ = 0.9.7 =
116
+ * Fixed bug causing warning notices and missing icons.
117
+
118
  = 0.9.6 =
119
  * Fixed missing icon previews in WordPress 3.8 and below.
120
 
144
 
145
  == Upgrade Notice ==
146
 
147
+ = 0.9.7 =
148
+ * Fixed bug causing warning notices and missing icons.
149
+
150
  = 0.9.6 =
151
  * Fixed missing icon previews in WordPress 3.8 and below.
152