Passed
Push — lsx-wp6 ( 4c21d3 )
by
unknown
04:54
created

LSX_Popup_Maker   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 53
rs 10
c 1
b 0
f 0
wmc 6

4 Methods

Rating   Name   Duplication   Size   Complexity  
A lsx_popup_maker_scripts_add_styles() 0 2 1
A __construct() 0 3 1
A get_instance() 0 6 2
A remove_pop_up_controls_panel() 0 4 2
1
<?php
2
/**
3
 * LSX Popup Maker Class
4
 *
5
 * @package    lsx
6
 * @subpackage popup-maker
7
 */
8
9
if ( ! defined( 'ABSPATH' ) ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
10
	exit;
11
}
12
13
if ( ! class_exists( 'LSX_Popup_Maker' ) ) :
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
14
15
	/**
16
	 * The LSX Popup_Maker integration class
17
	 */
18
	class LSX_Popup_Maker {
19
20
		/**
21
		 * Holds class instance
22
		 *
23
		 * @since 1.0.0
24
		 * @var      object
25
		 */
26
		protected static $instance = null;
27
28
		/**
29
		 * Setup class.
30
		 *
31
		 * @since 1.0
32
		 */
33
		public function __construct() {
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
34
			add_action( 'init', array( $this, 'remove_pop_up_controls_panel' ) );
35
			add_action( 'wp_enqueue_scripts', array( $this, 'lsx_popup_maker_scripts_add_styles' ) );
36
		}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
37
38
		/**
39
		 * Return an instance of this class.
40
		 *
41
		 * @since 1.0.0
42
		 * @return    object    A single instance of this class.
43
		 */
44
		public static function get_instance() {
45
			// If the single instance hasn't been set, set it now.
46
			if ( null === self::$instance ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
47
				self::$instance = new self();
48
			}
0 ignored issues
show
Coding Style introduced by
No blank line found after control structure
Loading history...
49
			return self::$instance;
50
		}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
51
52
		/**
53
		 * Popup_Maker enqueue styles.
54
		 *
55
		 * @package    lsx
56
		 * @subpackage popup-maker
57
		 */
58
		public function lsx_popup_maker_scripts_add_styles() {
59
			wp_enqueue_style( 'popup-maker-lsx', LSX_CUSTOMIZER_URL . 'assets/css/popup-maker/popup-maker.css', array( 'lsx_main' ), LSX_VERSION );
60
		}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
61
62
		/**
63
		 * This removes the PUM pop up controls box.
64
		 *
65
		 * @return void
66
		 */
67
		public function remove_pop_up_controls_panel() {
68
			if ( is_admin() ) {
0 ignored issues
show
Coding Style introduced by
Expected 0 spaces after opening bracket; 1 found
Loading history...
Coding Style introduced by
Expected 0 spaces before closing bracket; 1 found
Loading history...
69
				remove_action( 'enqueue_block_editor_assets', array( 'PUM_Site_Assets', 'register_styles' ) );
70
				remove_action( 'enqueue_block_editor_assets', array( 'PUM_Admin_BlockEditor', 'register_editor_assets' ) );
71
			}
72
		}
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
73
	}
74
75
endif;
76
77
LSX_Popup_Maker::get_instance();
78