Passed
Push — master ( e4ac59...e8d602 )
by Brian
10:43
created

WP_Font_Awesome_Settings   F

Complexity

Total Complexity 61

Size/Duplication

Total Lines 532
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 202
dl 0
loc 532
rs 3.52
c 0
b 0
f 0
wmc 61

14 Methods

Rating   Name   Duplication   Size   Complexity  
A instance() 0 15 4
B get_url() 0 24 10
A enqueue_style() 0 18 3
B remove_font_awesome() 0 22 9
A rtl_inline_css() 0 4 1
B init() 0 27 11
B settings_page() 0 176 4
A validate_version_number() 0 9 2
A register_settings() 0 2 1
A menu_item() 0 5 1
A get_settings() 0 23 1
A get_latest_version_from_api() 0 11 6
A get_latest_version() 0 18 6
A enqueue_scripts() 0 14 2

How to fix   Complexity   

Complex Class

Complex classes like WP_Font_Awesome_Settings often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use WP_Font_Awesome_Settings, and based on these observations, apply Extract Interface, too.

1
<?php
2
/**
3
 * A class for adjusting font awesome settings on WordPress
4
 *
5
 * This class can be added to any plugin or theme and will add a settings screen to WordPress to control Font Awesome settings.
6
 *
7
 * @link https://github.com/AyeCode/wp-font-awesome-settings
8
 *
9
 * @internal This file should not be edited directly but pulled from the github repo above.
10
 */
11
12
/**
13
 * Bail if we are not in WP.
14
 */
15
if ( ! defined( 'ABSPATH' ) ) {
16
	exit;
17
}
18
19
/**
20
 * Only add if the class does not already exist.
21
 */
22
if ( ! class_exists( 'WP_Font_Awesome_Settings' ) ) {
23
24
	/**
25
	 * A Class to be able to change settings for Font Awesome.
26
	 *
27
	 * Class WP_Font_Awesome_Settings
28
	 * @since 1.0.10 Now able to pass wp.org theme check.
29
	 * @since 1.0.11 Font Awesome Pro now supported.
30
	 * @since 1.0.11 Font Awesome Kits now supported.
31
	 * @since 1.0.13 RTL language support added.
32
	 * @ver 1.0.13
33
	 * @todo decide how to implement textdomain
34
	 */
35
	class WP_Font_Awesome_Settings {
36
37
		/**
38
		 * Class version version.
39
		 *
40
		 * @var string
41
		 */
42
		public $version = '1.0.13';
43
44
		/**
45
		 * Class textdomain.
46
		 *
47
		 * @var string
48
		 */
49
		public $textdomain = 'font-awesome-settings';
50
51
		/**
52
		 * Latest version of Font Awesome at time of publish published.
53
		 *
54
		 * @var string
55
		 */
56
		public $latest = "5.8.2";
57
58
		/**
59
		 * The title.
60
		 *
61
		 * @var string
62
		 */
63
		public $name = 'Font Awesome';
64
65
		/**
66
		 * Holds the settings values.
67
		 *
68
		 * @var array
69
		 */
70
		private $settings;
71
72
		/**
73
		 * WP_Font_Awesome_Settings instance.
74
		 *
75
		 * @access private
76
		 * @since  1.0.0
77
		 * @var    WP_Font_Awesome_Settings There can be only one!
78
		 */
79
		private static $instance = null;
80
81
		/**
82
		 * Main WP_Font_Awesome_Settings Instance.
83
		 *
84
		 * Ensures only one instance of WP_Font_Awesome_Settings is loaded or can be loaded.
85
		 *
86
		 * @since 1.0.0
87
		 * @static
88
		 * @return WP_Font_Awesome_Settings - Main instance.
89
		 */
90
		public static function instance() {
91
			if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WP_Font_Awesome_Settings ) ) {
92
				self::$instance = new WP_Font_Awesome_Settings;
93
94
				add_action( 'init', array( self::$instance, 'init' ) ); // set settings
95
96
				if ( is_admin() ) {
97
					add_action( 'admin_menu', array( self::$instance, 'menu_item' ) );
98
					add_action( 'admin_init', array( self::$instance, 'register_settings' ) );
99
				}
100
101
				do_action( 'wp_font_awesome_settings_loaded' );
102
			}
103
104
			return self::$instance;
105
		}
106
107
		/**
108
		 * Initiate the settings and add the required action hooks.
109
		 *
110
		 * @since 1.0.8 Settings name wrong - FIXED
111
		 */
112
		public function init() {
113
			$this->settings = $this->get_settings();
114
115
			if ( $this->settings['type'] == 'CSS' ) {
116
117
				if ( $this->settings['enqueue'] == '' || $this->settings['enqueue'] == 'frontend' ) {
118
					add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ), 5000 );
119
				}
120
121
				if ( $this->settings['enqueue'] == '' || $this->settings['enqueue'] == 'backend' ) {
122
					add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_style' ), 5000 );
123
				}
124
125
			} else {
126
127
				if ( $this->settings['enqueue'] == '' || $this->settings['enqueue'] == 'frontend' ) {
128
					add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 5000 );
129
				}
130
131
				if ( $this->settings['enqueue'] == '' || $this->settings['enqueue'] == 'backend' ) {
132
					add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 5000 );
133
				}
134
			}
135
136
			// remove font awesome if set to do so
137
			if ( $this->settings['dequeue'] == '1' ) {
138
				add_action( 'clean_url', array( $this, 'remove_font_awesome' ), 5000, 3 );
139
			}
140
141
		}
142
143
		/**
144
		 * Adds the Font Awesome styles.
145
		 */
146
		public function enqueue_style() {
147
			// build url
148
			$url = $this->get_url();
149
150
			wp_deregister_style( 'font-awesome' ); // deregister in case its already there
151
			wp_register_style( 'font-awesome', $url, array(), null );
152
			wp_enqueue_style( 'font-awesome' );
153
154
			// RTL language support CSS.
155
			if ( is_rtl() ) {
156
				wp_add_inline_style( 'font-awesome', $this->rtl_inline_css() );
157
			}
158
159
			if ( $this->settings['shims'] ) {
160
				$url = $this->get_url( true );
161
				wp_deregister_style( 'font-awesome-shims' ); // deregister in case its already there
162
				wp_register_style( 'font-awesome-shims', $url, array(), null );
163
				wp_enqueue_style( 'font-awesome-shims' );
164
			}
165
		}
166
167
		/**
168
		 * Adds the Font Awesome JS.
169
		 */
170
		public function enqueue_scripts() {
171
			// build url
172
			$url = $this->get_url();
173
174
			$deregister_function = 'wp' . '_' . 'deregister' . '_' . 'script';
175
			call_user_func( $deregister_function, 'font-awesome' ); // deregister in case its already there
176
			wp_register_script( 'font-awesome', $url, array(), null );
177
			wp_enqueue_script( 'font-awesome' );
178
179
			if ( $this->settings['shims'] ) {
180
				$url = $this->get_url( true );
181
				call_user_func( $deregister_function, 'font-awesome-shims' ); // deregister in case its already there
182
				wp_register_script( 'font-awesome-shims', $url, array(), null );
183
				wp_enqueue_script( 'font-awesome-shims' );
184
			}
185
		}
186
187
		/**
188
		 * Get the url of the Font Awesome files.
189
		 *
190
		 * @param bool $shims If this is a shim file or not.
191
		 *
192
		 * @return string The url to the file.
193
		 */
194
		public function get_url( $shims = false ) {
195
			$script  = $shims ? 'v4-shims' : 'all';
196
			$sub     = $this->settings['pro'] ? 'pro' : 'use';
197
			$type    = $this->settings['type'];
198
			$version = $this->settings['version'];
199
			$kit_url = $this->settings['kit-url'] ? esc_url( $this->settings['kit-url'] ) : '';
200
			$url     = '';
201
202
			if ( $type == 'KIT' && $kit_url ) {
203
				if ( $shims ) {
204
					// if its a kit then we don't add shims here
205
					return '';
206
				}
207
				$url .= $kit_url; // CDN
208
				$url .= "?wpfas=true"; // set our var so our version is not removed
209
			} else {
210
				$url .= "https://$sub.fontawesome.com/releases/"; // CDN
211
				$url .= ! empty( $version ) ? "v" . $version . '/' : "v" . $this->get_latest_version() . '/'; // version
212
				$url .= $type == 'CSS' ? 'css/' : 'js/'; // type
213
				$url .= $type == 'CSS' ? $script . '.css' : $script . '.js'; // type
214
				$url .= "?wpfas=true"; // set our var so our version is not removed
215
			}
216
217
			return $url;
218
		}
219
220
		/**
221
		 * Try and remove any other versions of Font Awesome added by other plugins/themes.
222
		 *
223
		 * Uses the clean_url filter to try and remove any other Font Awesome files added, it can also add pseudo-elements flag for the JS version.
224
		 *
225
		 * @param $url
226
		 * @param $original_url
227
		 * @param $_context
228
		 *
229
		 * @return string The filtered url.
230
		 */
231
		public function remove_font_awesome( $url, $original_url, $_context ) {
232
233
			if ( $_context == 'display'
234
			     && ( strstr( $url, "fontawesome" ) !== false || strstr( $url, "font-awesome" ) !== false )
235
			     && ( strstr( $url, ".js" ) !== false || strstr( $url, ".css" ) !== false )
236
			) {// it's a font-awesome-url (probably)
237
238
				if ( strstr( $url, "wpfas=true" ) !== false ) {
239
					if ( $this->settings['type'] == 'JS' ) {
240
						if ( $this->settings['js-pseudo'] ) {
241
							$url .= "' data-search-pseudo-elements defer='defer";
242
						} else {
243
							$url .= "' defer='defer";
244
						}
245
					}
246
				} else {
247
					$url = ''; // removing the url removes the file
248
				}
249
250
			}
251
252
			return $url;
253
		}
254
255
		/**
256
		 * Register the database settings with WordPress.
257
		 */
258
		public function register_settings() {
259
			register_setting( 'wp-font-awesome-settings', 'wp-font-awesome-settings' );
260
		}
261
262
		/**
263
		 * Add the WordPress settings menu item.
264
		 * @since 1.0.10 Calling function name direct will fail theme check so we don't.
265
		 */
266
		public function menu_item() {
267
			$menu_function = 'add' . '_' . 'options' . '_' . 'page'; // won't pass theme check if function name present in theme
268
			call_user_func( $menu_function, $this->name, $this->name, 'manage_options', 'wp-font-awesome-settings', array(
269
				$this,
270
				'settings_page'
271
			) );
272
		}
273
274
		/**
275
		 * Get the current Font Awesome output settings.
276
		 *
277
		 * @return array The array of settings.
278
		 */
279
		public function get_settings() {
280
281
			$db_settings = get_option( 'wp-font-awesome-settings' );
282
283
			$defaults = array(
284
				'type'      => 'CSS', // type to use, CSS or JS or KIT
285
				'version'   => '', // latest
286
				'enqueue'   => '', // front and backend
287
				'shims'     => '0', // default OFF now in 2020
288
				'js-pseudo' => '0', // if the pseudo elements flag should be set (CPU intensive)
289
				'dequeue'   => '0', // if we should try to remove other versions added by other plugins/themes
290
				'pro'       => '0', // if pro CDN url should be used
291
				'kit-url'   => '', // the kit url
292
			);
293
294
			$settings = wp_parse_args( $db_settings, $defaults );
0 ignored issues
show
Bug introduced by
It seems like $db_settings can also be of type false; however, parameter $args of wp_parse_args() does only seem to accept array|object|string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

294
			$settings = wp_parse_args( /** @scrutinizer ignore-type */ $db_settings, $defaults );
Loading history...
295
296
			/**
297
			 * Filter the Font Awesome settings.
298
			 *
299
			 * @todo if we add this filer people might use it and then it defeates the purpose of this class :/
300
			 */
301
			return $this->settings = apply_filters( 'wp-font-awesome-settings', $settings, $db_settings, $defaults );
302
		}
303
304
305
		/**
306
		 * The settings page html output.
307
		 */
308
		public function settings_page() {
309
			if ( ! current_user_can( 'manage_options' ) ) {
310
				wp_die( __( 'You do not have sufficient permissions to access this page.', 'font-awesome-settings' ) );
311
			}
312
313
			// a hidden way to force the update of the version number via api instead of waiting the 48 hours
314
			if ( isset( $_REQUEST['force-version-check'] ) ) {
315
				$this->get_latest_version( $force_api = true );
316
			}
317
			?>
318
			<style>
319
				.wpfas-kit-show {
320
					display: none;
321
				}
322
323
				.wpfas-kit-set .wpfas-kit-hide {
324
					display: none;
325
				}
326
327
				.wpfas-kit-set .wpfas-kit-show {
328
					display: table-row;
329
				}
330
			</style>
331
			<div class="wrap">
332
				<h1><?php echo $this->name; ?></h1>
333
				<form method="post" action="options.php">
334
					<?php
335
					settings_fields( 'wp-font-awesome-settings' );
336
					do_settings_sections( 'wp-font-awesome-settings' );
337
					$kit_set = $this->settings['type'] == 'KIT' ? 'wpfas-kit-set' : '';
338
					?>
339
					<table class="form-table wpfas-table-settings <?php echo esc_attr( $kit_set ); ?>">
340
						<tr valign="top">
341
							<th scope="row"><label
342
									for="wpfas-type"><?php _e( 'Type', 'font-awesome-settings' ); ?></label></th>
343
							<td>
344
								<select name="wp-font-awesome-settings[type]" id="wpfas-type"
345
								        onchange="if(this.value=='KIT'){jQuery('.wpfas-table-settings').addClass('wpfas-kit-set');}else{jQuery('.wpfas-table-settings').removeClass('wpfas-kit-set');}">
346
									<option
347
										value="CSS" <?php selected( $this->settings['type'], 'CSS' ); ?>><?php _e( 'CSS (default)', 'font-awesome-settings' ); ?></option>
348
									<option value="JS" <?php selected( $this->settings['type'], 'JS' ); ?>>JS</option>
349
									<option
350
										value="KIT" <?php selected( $this->settings['type'], 'KIT' ); ?>><?php _e( 'Kits (settings managed on fontawesome.com)', 'font-awesome-settings' ); ?></option>
351
								</select>
352
							</td>
353
						</tr>
354
355
						<tr valign="top" class="wpfas-kit-show">
356
							<th scope="row"><label
357
									for="wpfas-kit-url"><?php _e( 'Kit URL', 'font-awesome-settings' ); ?></label></th>
358
							<td>
359
								<input class="regular-text" id="wpfas-kit-url" type="url"
360
								       name="wp-font-awesome-settings[kit-url]"
361
								       value="<?php echo esc_attr( $this->settings['kit-url'] ); ?>"
362
								       placeholder="<?php echo 'https://kit.font';echo 'awesome.com/123abc.js'; // this won't pass theme check :(?>"/>
363
								<span><?php
364
									echo sprintf(
365
										__( 'Requires a free account with Font Awesome. %sGet kit url%s', 'font-awesome-settings' ),
366
										'<a rel="noopener noreferrer" target="_blank" href="https://fontawesome.com/kits"><i class="fas fa-external-link-alt"></i>',
367
										'</a>'
368
									);
369
									?></span>
370
							</td>
371
						</tr>
372
373
						<tr valign="top" class="wpfas-kit-hide">
374
							<th scope="row"><label
375
									for="wpfas-version"><?php _e( 'Version', 'font-awesome-settings' ); ?></label></th>
376
							<td>
377
								<select name="wp-font-awesome-settings[version]" id="wpfas-version">
378
									<option
379
										value="" <?php selected( $this->settings['version'], '' ); ?>><?php echo sprintf( __( 'Latest - %s (default)', 'font-awesome-settings' ), $this->get_latest_version() ); ?>
380
									</option>
381
									<option value="5.6.0" <?php selected( $this->settings['version'], '5.6.0' ); ?>>
382
										5.6.0
383
									</option>
384
									<option value="5.5.0" <?php selected( $this->settings['version'], '5.5.0' ); ?>>
385
										5.5.0
386
									</option>
387
									<option value="5.4.0" <?php selected( $this->settings['version'], '5.4.0' ); ?>>
388
										5.4.0
389
									</option>
390
									<option value="5.3.0" <?php selected( $this->settings['version'], '5.3.0' ); ?>>
391
										5.3.0
392
									</option>
393
									<option value="5.2.0" <?php selected( $this->settings['version'], '5.2.0' ); ?>>
394
										5.2.0
395
									</option>
396
									<option value="5.1.0" <?php selected( $this->settings['version'], '5.1.0' ); ?>>
397
										5.1.0
398
									</option>
399
									<option value="4.7.0" <?php selected( $this->settings['version'], '4.7.0' ); ?>>
400
										4.7.1 (CSS only)
401
									</option>
402
								</select>
403
							</td>
404
						</tr>
405
406
						<tr valign="top">
407
							<th scope="row"><label
408
									for="wpfas-enqueue"><?php _e( 'Enqueue', 'font-awesome-settings' ); ?></label></th>
409
							<td>
410
								<select name="wp-font-awesome-settings[enqueue]" id="wpfas-enqueue">
411
									<option
412
										value="" <?php selected( $this->settings['enqueue'], '' ); ?>><?php _e( 'Frontend + Backend (default)', 'font-awesome-settings' ); ?></option>
413
									<option
414
										value="frontend" <?php selected( $this->settings['enqueue'], 'frontend' ); ?>><?php _e( 'Frontend', 'font-awesome-settings' ); ?></option>
415
									<option
416
										value="backend" <?php selected( $this->settings['enqueue'], 'backend' ); ?>><?php _e( 'Backend', 'font-awesome-settings' ); ?></option>
417
								</select>
418
							</td>
419
						</tr>
420
421
						<tr valign="top" class="wpfas-kit-hide">
422
							<th scope="row"><label
423
									for="wpfas-pro"><?php _e( 'Enable pro', 'font-awesome-settings' ); ?></label></th>
424
							<td>
425
								<input type="hidden" name="wp-font-awesome-settings[pro]" value="0"/>
426
								<input type="checkbox" name="wp-font-awesome-settings[pro]"
427
								       value="1" <?php checked( $this->settings['pro'], '1' ); ?> id="wpfas-pro"/>
428
								<span><?php
429
									echo sprintf(
430
										__( 'Requires a subscription. %sLearn more%s %sManage my allowed domains%s', 'font-awesome-settings' ),
431
										'<a rel="noopener noreferrer" target="_blank" href="https://fontawesome.com/pro"><i class="fas fa-external-link-alt"></i>',
432
										'</a>',
433
										'<a rel="noopener noreferrer" target="_blank" href="https://fontawesome.com/account/cdn"><i class="fas fa-external-link-alt"></i>',
434
										'</a>'
435
									);
436
									?></span>
437
							</td>
438
						</tr>
439
440
						<tr valign="top" class="wpfas-kit-hide">
441
							<th scope="row"><label
442
									for="wpfas-shims"><?php _e( 'Enable v4 shims compatibility', 'font-awesome-settings' ); ?></label>
443
							</th>
444
							<td>
445
								<input type="hidden" name="wp-font-awesome-settings[shims]" value="0"/>
446
								<input type="checkbox" name="wp-font-awesome-settings[shims]"
447
								       value="1" <?php checked( $this->settings['shims'], '1' ); ?> id="wpfas-shims"/>
448
								<span><?php _e( 'This enables v4 classes to work with v5, sort of like a band-aid until everyone has updated everything to v5.', 'font-awesome-settings' ); ?></span>
449
							</td>
450
						</tr>
451
452
						<tr valign="top" class="wpfas-kit-hide">
453
							<th scope="row"><label
454
									for="wpfas-js-pseudo"><?php _e( 'Enable JS pseudo elements (not recommended)', 'font-awesome-settings' ); ?></label>
455
							</th>
456
							<td>
457
								<input type="hidden" name="wp-font-awesome-settings[js-pseudo]" value="0"/>
458
								<input type="checkbox" name="wp-font-awesome-settings[js-pseudo]"
459
								       value="1" <?php checked( $this->settings['js-pseudo'], '1' ); ?>
460
								       id="wpfas-js-pseudo"/>
461
								<span><?php _e( 'Used only with the JS version, this will make pseudo-elements work but can be CPU intensive on some sites.', 'font-awesome-settings' ); ?></span>
462
							</td>
463
						</tr>
464
465
						<tr valign="top">
466
							<th scope="row"><label
467
									for="wpfas-dequeue"><?php _e( 'Dequeue', 'font-awesome-settings' ); ?></label></th>
468
							<td>
469
								<input type="hidden" name="wp-font-awesome-settings[dequeue]" value="0"/>
470
								<input type="checkbox" name="wp-font-awesome-settings[dequeue]"
471
								       value="1" <?php checked( $this->settings['dequeue'], '1' ); ?>
472
								       id="wpfas-dequeue"/>
473
								<span><?php _e( 'This will try to dequeue any other Font Awesome versions loaded by other sources if they are added with `font-awesome` or `fontawesome` in the name.', 'font-awesome-settings' ); ?></span>
474
							</td>
475
						</tr>
476
477
					</table>
478
					<?php
479
					submit_button();
480
					?>
481
				</form>
482
483
				<div id="wpfas-version"><?php echo $this->version; ?></div>
484
			</div>
485
486
			<?php
487
		}
488
489
		/**
490
		 * Check a version number is valid and if so return it or else return an empty string.
491
		 *
492
		 * @param $version string The version number to check.
493
		 *
494
		 * @since 1.0.6
495
		 *
496
		 * @return string Either a valid version number or an empty string.
497
		 */
498
		public function validate_version_number( $version ) {
499
500
			if ( version_compare( $version, '0.0.1', '>=' ) >= 0 ) {
501
				// valid
502
			} else {
503
				$version = '';// not validated
504
			}
505
506
			return $version;
507
		}
508
509
510
		/**
511
		 * Get the latest version of Font Awesome.
512
		 *
513
		 * We check for a cached version and if none we will check for a live version via API and then cache it for 48 hours.
514
		 *
515
		 * @since 1.0.7
516
		 * @return mixed|string The latest version number found.
517
		 */
518
		public function get_latest_version( $force_api = false ) {
519
			$latest_version = $this->latest;
520
521
			$cache = get_transient( 'wp-font-awesome-settings-version' );
522
523
			if ( $cache === false || $force_api ) { // its not set
524
				$api_ver = $this->get_latest_version_from_api();
525
				if ( version_compare( $api_ver, $this->latest, '>=' ) >= 0 ) {
526
					$latest_version = $api_ver;
527
					set_transient( 'wp-font-awesome-settings-version', $api_ver, 48 * HOUR_IN_SECONDS );
528
				}
529
			} elseif ( $this->validate_version_number( $cache ) ) {
530
				if ( version_compare( $cache, $this->latest, '>=' ) >= 0 ) {
531
					$latest_version = $cache;
532
				}
533
			}
534
535
			return $latest_version;
536
		}
537
538
		/**
539
		 * Get the latest Font Awesome version from the github API.
540
		 *
541
		 * @since 1.0.7
542
		 * @return string The latest version number or `0` on API fail.
543
		 */
544
		public function get_latest_version_from_api() {
545
			$version  = "0";
546
			$response = wp_remote_get( "https://api.github.com/repos/FortAwesome/Font-Awesome/releases/latest" );
547
			if ( ! is_wp_error( $response ) && is_array( $response ) ) {
548
				$api_response = json_decode( wp_remote_retrieve_body( $response ), true );
549
				if ( isset( $api_response['tag_name'] ) && version_compare( $api_response['tag_name'], $this->latest, '>=' ) >= 0 && empty( $api_response['prerelease'] ) ) {
550
					$version = $api_response['tag_name'];
551
				}
552
			}
553
554
			return $version;
555
		}
556
557
		/**
558
		 * Inline CSS for RTL language support.
559
		 *
560
		 * @since 1.0.13
561
		 * @return string Inline CSS.
562
		 */
563
		public function rtl_inline_css() {
564
			$inline_css = '[dir=rtl] .fa-address,[dir=rtl] .fa-address-card,[dir=rtl] .fa-adjust,[dir=rtl] .fa-alarm-clock,[dir=rtl] .fa-align-left,[dir=rtl] .fa-align-right,[dir=rtl] .fa-analytics,[dir=rtl] .fa-angle-double-left,[dir=rtl] .fa-angle-double-right,[dir=rtl] .fa-angle-left,[dir=rtl] .fa-angle-right,[dir=rtl] .fa-arrow-alt-circle-left,[dir=rtl] .fa-arrow-alt-circle-right,[dir=rtl] .fa-arrow-alt-from-left,[dir=rtl] .fa-arrow-alt-from-right,[dir=rtl] .fa-arrow-alt-left,[dir=rtl] .fa-arrow-alt-right,[dir=rtl] .fa-arrow-alt-square-left,[dir=rtl] .fa-arrow-alt-square-right,[dir=rtl] .fa-arrow-alt-to-left,[dir=rtl] .fa-arrow-alt-to-right,[dir=rtl] .fa-arrow-circle-left,[dir=rtl] .fa-arrow-circle-right,[dir=rtl] .fa-arrow-from-left,[dir=rtl] .fa-arrow-from-right,[dir=rtl] .fa-arrow-left,[dir=rtl] .fa-arrow-right,[dir=rtl] .fa-arrow-square-left,[dir=rtl] .fa-arrow-square-right,[dir=rtl] .fa-arrow-to-left,[dir=rtl] .fa-arrow-to-right,[dir=rtl] .fa-balance-scale-left,[dir=rtl] .fa-balance-scale-right,[dir=rtl] .fa-bed,[dir=rtl] .fa-bed-bunk,[dir=rtl] .fa-bed-empty,[dir=rtl] .fa-border-left,[dir=rtl] .fa-border-right,[dir=rtl] .fa-calendar-check,[dir=rtl] .fa-caret-circle-left,[dir=rtl] .fa-caret-circle-right,[dir=rtl] .fa-caret-left,[dir=rtl] .fa-caret-right,[dir=rtl] .fa-caret-square-left,[dir=rtl] .fa-caret-square-right,[dir=rtl] .fa-cart-arrow-down,[dir=rtl] .fa-cart-plus,[dir=rtl] .fa-chart-area,[dir=rtl] .fa-chart-bar,[dir=rtl] .fa-chart-line,[dir=rtl] .fa-chart-line-down,[dir=rtl] .fa-chart-network,[dir=rtl] .fa-chart-pie,[dir=rtl] .fa-chart-pie-alt,[dir=rtl] .fa-chart-scatter,[dir=rtl] .fa-check-circle,[dir=rtl] .fa-check-square,[dir=rtl] .fa-chevron-circle-left,[dir=rtl] .fa-chevron-circle-right,[dir=rtl] .fa-chevron-double-left,[dir=rtl] .fa-chevron-double-right,[dir=rtl] .fa-chevron-left,[dir=rtl] .fa-chevron-right,[dir=rtl] .fa-chevron-square-left,[dir=rtl] .fa-chevron-square-right,[dir=rtl] .fa-clock,[dir=rtl] .fa-file,[dir=rtl] .fa-file-alt,[dir=rtl] .fa-file-archive,[dir=rtl] .fa-file-audio,[dir=rtl] .fa-file-chart-line,[dir=rtl] .fa-file-chart-pie,[dir=rtl] .fa-file-code,[dir=rtl] .fa-file-excel,[dir=rtl] .fa-file-image,[dir=rtl] .fa-file-pdf,[dir=rtl] .fa-file-powerpoint,[dir=rtl] .fa-file-video,[dir=rtl] .fa-file-word,[dir=rtl] .fa-flag,[dir=rtl] .fa-folder,[dir=rtl] .fa-folder-open,[dir=rtl] .fa-hand-lizard,[dir=rtl] .fa-hand-point-down,[dir=rtl] .fa-hand-point-left,[dir=rtl] .fa-hand-point-right,[dir=rtl] .fa-hand-point-up,[dir=rtl] .fa-hand-scissors,[dir=rtl] .fa-image,[dir=rtl] .fa-long-arrow-alt-left,[dir=rtl] .fa-long-arrow-alt-right,[dir=rtl] .fa-long-arrow-left,[dir=rtl] .fa-long-arrow-right,[dir=rtl] .fa-luggage-cart,[dir=rtl] .fa-moon,[dir=rtl] .fa-pencil,[dir=rtl] .fa-pencil-alt,[dir=rtl] .fa-play-circle,[dir=rtl] .fa-project-diagram,[dir=rtl] .fa-quote-left,[dir=rtl] .fa-quote-right,[dir=rtl] .fa-shopping-cart,[dir=rtl] .fa-thumbs-down,[dir=rtl] .fa-thumbs-up,[dir=rtl] .fa-user-chart{filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);transform:scale(-1,1)}[dir=rtl] .fa-spin{animation-direction:reverse}';
565
566
			return $inline_css;
567
		}
568
569
	}
570
571
	/**
572
	 * Run the class if found.
573
	 */
574
	WP_Font_Awesome_Settings::instance();
575
}