@@ -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.1' ); |
|
| 38 | +if ( ! defined('GMB_VERSION')) { |
|
| 39 | + define('GMB_VERSION', '2.1.1'); |
|
| 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(); |
@@ -121,17 +121,17 @@ discard block |
||
| 121 | 121 | self::$instance->settings = new Google_Maps_Builder_Settings(); |
| 122 | 122 | self::$instance->engine = new Google_Maps_Builder_Engine(); |
| 123 | 123 | |
| 124 | - register_activation_hook( __FILE__, array( |
|
| 124 | + register_activation_hook(__FILE__, array( |
|
| 125 | 125 | self::$instance->activate, |
| 126 | 126 | 'activation_flush_rewrites' |
| 127 | - ) ); |
|
| 127 | + )); |
|
| 128 | 128 | |
| 129 | 129 | // Read plugin meta |
| 130 | 130 | // Check that function get_plugin_data exists |
| 131 | - if ( ! function_exists( 'get_plugin_data' ) ) { |
|
| 132 | - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
|
| 131 | + if ( ! function_exists('get_plugin_data')) { |
|
| 132 | + require_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
| 133 | 133 | } |
| 134 | - self::$instance->meta = get_plugin_data( GMB_PLUGIN_FILE, false ); |
|
| 134 | + self::$instance->meta = get_plugin_data(GMB_PLUGIN_FILE, false); |
|
| 135 | 135 | |
| 136 | 136 | } |
| 137 | 137 | |
@@ -152,9 +152,9 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | $this->cmb2_load(); |
| 154 | 154 | $this->load_files(); |
| 155 | - require_once GMB_PLUGIN_PATH . 'includes/class-gmb-scripts.php'; |
|
| 155 | + require_once GMB_PLUGIN_PATH.'includes/class-gmb-scripts.php'; |
|
| 156 | 156 | |
| 157 | - if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { |
|
| 157 | + if (is_admin() || (defined('WP_CLI') && WP_CLI)) { |
|
| 158 | 158 | |
| 159 | 159 | $this->load_admin(); |
| 160 | 160 | //Admin |