@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ( ! defined( 'ABSPATH' ) ) { |
|
3 | +if ( ! defined('ABSPATH')) { |
|
4 | 4 | exit; |
5 | 5 | } |
6 | 6 | |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | * Constructor. |
27 | 27 | */ |
28 | 28 | public function __construct() { |
29 | - add_filter( 'style_loader_tag', array( $this, 'preload_css' ), 100, 4 ); |
|
30 | - add_filter( 'script_loader_tag', array( $this, 'defer_parsing_of_js' ), 100, 3 ); |
|
31 | - add_action( 'init', array( $this, 'pum_remove_admin_bar_tools' ), 100 ); |
|
29 | + add_filter('style_loader_tag', array($this, 'preload_css'), 100, 4); |
|
30 | + add_filter('script_loader_tag', array($this, 'defer_parsing_of_js'), 100, 3); |
|
31 | + add_action('init', array($this, 'pum_remove_admin_bar_tools'), 100); |
|
32 | 32 | } |
33 | 33 | /** |
34 | 34 | * Return an instance of this class. |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public static function get_instance() { |
40 | 40 | // If the single instance hasn't been set, set it now. |
41 | - if ( null === self::$instance ) { |
|
41 | + if (null === self::$instance) { |
|
42 | 42 | self::$instance = new self; |
43 | 43 | } |
44 | 44 | return self::$instance; |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | * @param string $url The url to check and defer. |
51 | 51 | * @return string |
52 | 52 | */ |
53 | - public function preload_css( $tag, $handle, $href, $media ) { |
|
54 | - if ( 'lsx_fonts' === $handle || 'fontawesome' === $handle ) { |
|
55 | - $tag = str_replace( 'href', ' preload href', $tag ); |
|
53 | + public function preload_css($tag, $handle, $href, $media) { |
|
54 | + if ('lsx_fonts' === $handle || 'fontawesome' === $handle) { |
|
55 | + $tag = str_replace('href', ' preload href', $tag); |
|
56 | 56 | } |
57 | 57 | return $tag; |
58 | 58 | } |
@@ -63,17 +63,17 @@ discard block |
||
63 | 63 | * @param string $url The url to check and defer. |
64 | 64 | * @return string |
65 | 65 | */ |
66 | - public function defer_parsing_of_js( $tag, $handle, $href ) { |
|
67 | - if ( ! is_admin() && false !== stripos( $href, '.js' ) && false === stripos( $href, 'jquery.js' ) ) { |
|
68 | - $tag = str_replace( 'src=', ' defer src=', $tag ); |
|
66 | + public function defer_parsing_of_js($tag, $handle, $href) { |
|
67 | + if ( ! is_admin() && false !== stripos($href, '.js') && false === stripos($href, 'jquery.js')) { |
|
68 | + $tag = str_replace('src=', ' defer src=', $tag); |
|
69 | 69 | } |
70 | 70 | return $tag; |
71 | 71 | } |
72 | 72 | |
73 | 73 | public function pum_remove_admin_bar_tools() { |
74 | - remove_action( 'admin_bar_menu', array( 'PUM_Modules_Admin_Bar', 'toolbar_links' ), 999 ); |
|
75 | - remove_action( 'wp_footer', array( 'PUM_Modules_Admin_Bar', 'admin_bar_styles' ), 999 ); |
|
76 | - remove_action( 'init', array( 'PUM_Modules_Admin_Bar', 'show_debug_bar' ) ); |
|
74 | + remove_action('admin_bar_menu', array('PUM_Modules_Admin_Bar', 'toolbar_links'), 999); |
|
75 | + remove_action('wp_footer', array('PUM_Modules_Admin_Bar', 'admin_bar_styles'), 999); |
|
76 | + remove_action('init', array('PUM_Modules_Admin_Bar', 'show_debug_bar')); |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | LSX_Optimisation::get_instance(); |