@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | */ |
16 | 16 | |
17 | 17 | // If this file is called directly, abort. |
18 | -if ( ! defined( 'ABSPATH' ) ) { |
|
18 | +if ( ! defined('ABSPATH')) { |
|
19 | 19 | exit; |
20 | 20 | } |
21 | 21 | |
@@ -23,34 +23,34 @@ discard block |
||
23 | 23 | * Define Constants |
24 | 24 | */ |
25 | 25 | // Plugin Folder Path |
26 | -if ( ! defined( 'GMB_PLUGIN_PATH' ) ) { |
|
27 | - define( 'GMB_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); |
|
26 | +if ( ! defined('GMB_PLUGIN_PATH')) { |
|
27 | + define('GMB_PLUGIN_PATH', plugin_dir_path(__FILE__)); |
|
28 | 28 | } |
29 | 29 | // Plugin Folder URL |
30 | -if ( ! defined( 'GMB_PLUGIN_URL' ) ) { |
|
31 | - define( 'GMB_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
|
30 | +if ( ! defined('GMB_PLUGIN_URL')) { |
|
31 | + define('GMB_PLUGIN_URL', plugin_dir_url(__FILE__)); |
|
32 | 32 | } |
33 | 33 | // Plugin base |
34 | -if ( ! defined( 'GMB_PLUGIN_BASE' ) ) { |
|
35 | - define( 'GMB_PLUGIN_BASE', plugin_basename( __FILE__ ) ); |
|
34 | +if ( ! defined('GMB_PLUGIN_BASE')) { |
|
35 | + define('GMB_PLUGIN_BASE', plugin_basename(__FILE__)); |
|
36 | 36 | } |
37 | 37 | // Plugin version |
38 | -if ( ! defined( 'GMB_VERSION' ) ) { |
|
39 | - define( 'GMB_VERSION', '2.1.2' ); |
|
38 | +if ( ! defined('GMB_VERSION')) { |
|
39 | + define('GMB_VERSION', '2.1.2'); |
|
40 | 40 | } |
41 | 41 | // Plugin Root File |
42 | -if ( ! defined( 'GMB_PLUGIN_FILE' ) ) { |
|
43 | - define( 'GMB_PLUGIN_FILE', __FILE__ ); |
|
42 | +if ( ! defined('GMB_PLUGIN_FILE')) { |
|
43 | + define('GMB_PLUGIN_FILE', __FILE__); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | -if ( ! class_exists( 'Google_Maps_Builder' ) ) : |
|
47 | +if ( ! class_exists('Google_Maps_Builder')) : |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Load plugin if core lib is present |
51 | 51 | */ |
52 | - if ( ! file_exists( GMB_PLUGIN_PATH . 'vendor/wordimpress/maps-builder-core/core.php' ) ) { |
|
53 | - add_action( 'admin_notices', 'gmb_no_core_lib' ); |
|
52 | + if ( ! file_exists(GMB_PLUGIN_PATH.'vendor/wordimpress/maps-builder-core/core.php')) { |
|
53 | + add_action('admin_notices', 'gmb_no_core_lib'); |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * Print admin notice if no dependencies |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | * @uses "admin_notice" hook |
59 | 59 | */ |
60 | 60 | function gmb_no_core_lib() { |
61 | - printf( '<div class="notice notice-error"><p>%s</p></div>', esc_html__( 'Your install of Maps Builder is missing its Composer dependencies and can not load.', 'maps-builder-pro' ) ); |
|
61 | + printf('<div class="notice notice-error"><p>%s</p></div>', esc_html__('Your install of Maps Builder is missing its Composer dependencies and can not load.', 'maps-builder-pro')); |
|
62 | 62 | } |
63 | 63 | } else { |
64 | - require_once GMB_PLUGIN_PATH . 'vendor/wordimpress/maps-builder-core/core.php'; |
|
64 | + require_once GMB_PLUGIN_PATH.'vendor/wordimpress/maps-builder-core/core.php'; |
|
65 | 65 | |
66 | 66 | /** |
67 | 67 | * Main Maps Builder Class |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | * @return Google_Maps_Builder |
110 | 110 | */ |
111 | 111 | public static function instance() { |
112 | - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Google_Maps_Builder ) ) { |
|
112 | + if ( ! isset(self::$instance) && ! (self::$instance instanceof Google_Maps_Builder)) { |
|
113 | 113 | |
114 | 114 | self::$instance = new Google_Maps_Builder(); |
115 | 115 | |
116 | - add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) ); |
|
116 | + add_action('plugins_loaded', array(self::$instance, 'load_textdomain')); |
|
117 | 117 | |
118 | 118 | self::$instance->includes(); |
119 | 119 | self::$instance->activate = new Google_Maps_Builder_Activate(); |
@@ -124,10 +124,10 @@ discard block |
||
124 | 124 | |
125 | 125 | // Read plugin meta |
126 | 126 | // Check that function get_plugin_data exists |
127 | - if ( ! function_exists( 'get_plugin_data' ) ) { |
|
128 | - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
|
127 | + if ( ! function_exists('get_plugin_data')) { |
|
128 | + require_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
129 | 129 | } |
130 | - self::$instance->meta = get_plugin_data( GMB_PLUGIN_FILE, false ); |
|
130 | + self::$instance->meta = get_plugin_data(GMB_PLUGIN_FILE, false); |
|
131 | 131 | |
132 | 132 | } |
133 | 133 | |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | |
149 | 149 | $this->cmb2_load(); |
150 | 150 | $this->load_files(); |
151 | - require_once GMB_PLUGIN_PATH . 'includes/class-gmb-scripts.php'; |
|
152 | - require_once GMB_PLUGIN_PATH . 'includes/class-gmb-html-elements.php'; |
|
151 | + require_once GMB_PLUGIN_PATH.'includes/class-gmb-scripts.php'; |
|
152 | + require_once GMB_PLUGIN_PATH.'includes/class-gmb-html-elements.php'; |
|
153 | 153 | |
154 | - if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { |
|
154 | + if (is_admin() || (defined('WP_CLI') && WP_CLI)) { |
|
155 | 155 | |
156 | 156 | $this->load_admin(); |
157 | 157 | //Admin |