@@ -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 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | //add_action( 'plugins_loaded', array( 'Google_Maps_Builder_Engine', 'get_instance' ) ); |
| 32 | 32 | |
| 33 | 33 | |
| 34 | -if ( ! class_exists( 'Google_Maps_Builder' ) ) : /** |
|
| 34 | +if ( ! class_exists('Google_Maps_Builder')) : /** |
|
| 35 | 35 | * Main Give Class |
| 36 | 36 | * |
| 37 | 37 | * @since 2.0 |
@@ -119,12 +119,12 @@ discard block |
||
| 119 | 119 | * @return Google_Maps_Builder |
| 120 | 120 | */ |
| 121 | 121 | public static function instance() { |
| 122 | - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Google_Maps_Builder ) ) { |
|
| 122 | + if ( ! isset(self::$instance) && ! (self::$instance instanceof Google_Maps_Builder)) { |
|
| 123 | 123 | |
| 124 | 124 | self::$instance = new Google_Maps_Builder(); |
| 125 | 125 | self::$instance->setup_constants(); |
| 126 | 126 | |
| 127 | - add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) ); |
|
| 127 | + add_action('plugins_loaded', array(self::$instance, 'load_textdomain')); |
|
| 128 | 128 | |
| 129 | 129 | self::$instance->includes(); |
| 130 | 130 | self::$instance->activate = new Google_Maps_Builder_Activate(); |
@@ -132,14 +132,14 @@ discard block |
||
| 132 | 132 | self::$instance->settings = new Google_Maps_Builder_Settings(); |
| 133 | 133 | self::$instance->engine = new Google_Maps_Builder_Engine(); |
| 134 | 134 | |
| 135 | - register_activation_hook( __FILE__, array( self::$instance->activate, 'activation_flush_rewrites' ) ); |
|
| 135 | + register_activation_hook(__FILE__, array(self::$instance->activate, 'activation_flush_rewrites')); |
|
| 136 | 136 | |
| 137 | 137 | // Read plugin meta |
| 138 | 138 | // Check that function get_plugin_data exists |
| 139 | - if ( ! function_exists( 'get_plugin_data' ) ) { |
|
| 140 | - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
|
| 139 | + if ( ! function_exists('get_plugin_data')) { |
|
| 140 | + require_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
| 141 | 141 | } |
| 142 | - self::$instance->meta = get_plugin_data( GMB_PLUGIN_FILE, false ); |
|
| 142 | + self::$instance->meta = get_plugin_data(GMB_PLUGIN_FILE, false); |
|
| 143 | 143 | |
| 144 | 144 | } |
| 145 | 145 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | public function __clone() { |
| 160 | 160 | // Cloning instances of the class is forbidden |
| 161 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'gmb' ), '2.0' ); |
|
| 161 | + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'gmb'), '2.0'); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | public function __wakeup() { |
| 172 | 172 | // Unserializing instances of the class is forbidden |
| 173 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'gmb' ), '2.0' ); |
|
| 173 | + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'gmb'), '2.0'); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** |
@@ -184,24 +184,24 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | // Define Constants |
| 186 | 186 | // Plugin Folder Path |
| 187 | - if ( ! defined( 'GMB_PLUGIN_PATH' ) ) { |
|
| 188 | - define( 'GMB_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); |
|
| 187 | + if ( ! defined('GMB_PLUGIN_PATH')) { |
|
| 188 | + define('GMB_PLUGIN_PATH', plugin_dir_path(__FILE__)); |
|
| 189 | 189 | } |
| 190 | 190 | // Plugin Folder URL |
| 191 | - if ( ! defined( 'GMB_PLUGIN_URL' ) ) { |
|
| 192 | - define( 'GMB_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
|
| 191 | + if ( ! defined('GMB_PLUGIN_URL')) { |
|
| 192 | + define('GMB_PLUGIN_URL', plugin_dir_url(__FILE__)); |
|
| 193 | 193 | } |
| 194 | 194 | // Plugin base |
| 195 | - if ( ! defined( 'GMB_PLUGIN_BASE' ) ) { |
|
| 196 | - define( 'GMB_PLUGIN_BASE', plugin_basename( __FILE__ ) ); |
|
| 195 | + if ( ! defined('GMB_PLUGIN_BASE')) { |
|
| 196 | + define('GMB_PLUGIN_BASE', plugin_basename(__FILE__)); |
|
| 197 | 197 | } |
| 198 | 198 | // Plugin version |
| 199 | - if ( ! defined( 'GMB_VERSION' ) ) { |
|
| 200 | - define( 'GMB_VERSION', '2.0.2' ); |
|
| 199 | + if ( ! defined('GMB_VERSION')) { |
|
| 200 | + define('GMB_VERSION', '2.0.2'); |
|
| 201 | 201 | } |
| 202 | 202 | // Plugin Root File |
| 203 | - if ( ! defined( 'GMB_PLUGIN_FILE' ) ) { |
|
| 204 | - define( 'GMB_PLUGIN_FILE', __FILE__ ); |
|
| 203 | + if ( ! defined('GMB_PLUGIN_FILE')) { |
|
| 204 | + define('GMB_PLUGIN_FILE', __FILE__); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | } |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | private function includes() { |
| 217 | 217 | |
| 218 | - require_once GMB_PLUGIN_PATH . 'includes/class-gmb-activate.php'; |
|
| 218 | + require_once GMB_PLUGIN_PATH.'includes/class-gmb-activate.php'; |
|
| 219 | 219 | |
| 220 | 220 | /** |
| 221 | 221 | * Get the CMB2 bootstrap! |
@@ -223,31 +223,31 @@ discard block |
||
| 223 | 223 | * @description: Checks to see if CMB2 plugin is installed first the uses included CMB2; we can still use it even it it's not active. This prevents fatal error conflicts with other themes and users of the CMB2 WP.org plugin |
| 224 | 224 | * |
| 225 | 225 | */ |
| 226 | - if ( file_exists( WP_PLUGIN_DIR . '/cmb2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) { |
|
| 227 | - require_once WP_PLUGIN_DIR . '/cmb2/init.php'; |
|
| 228 | - } elseif ( file_exists( GMB_PLUGIN_PATH . '/includes/libraries/metabox/init.php' ) && ! defined( 'CMB2_LOADED' ) ) { |
|
| 229 | - require_once GMB_PLUGIN_PATH . '/includes/libraries/metabox/init.php'; |
|
| 230 | - } elseif ( file_exists( GMB_PLUGIN_PATH . '/includes/libraries/CMB2/init.php' ) && ! defined( 'CMB2_LOADED' ) ) { |
|
| 231 | - require_once GMB_PLUGIN_PATH . '/includes/libraries/CMB2/init.php'; |
|
| 226 | + if (file_exists(WP_PLUGIN_DIR.'/cmb2/init.php') && ! defined('CMB2_LOADED')) { |
|
| 227 | + require_once WP_PLUGIN_DIR.'/cmb2/init.php'; |
|
| 228 | + } elseif (file_exists(GMB_PLUGIN_PATH.'/includes/libraries/metabox/init.php') && ! defined('CMB2_LOADED')) { |
|
| 229 | + require_once GMB_PLUGIN_PATH.'/includes/libraries/metabox/init.php'; |
|
| 230 | + } elseif (file_exists(GMB_PLUGIN_PATH.'/includes/libraries/CMB2/init.php') && ! defined('CMB2_LOADED')) { |
|
| 231 | + require_once GMB_PLUGIN_PATH.'/includes/libraries/CMB2/init.php'; |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - require_once GMB_PLUGIN_PATH . 'includes/class-gmb-scripts.php'; |
|
| 235 | - require_once GMB_PLUGIN_PATH . 'includes/class-gmb-widget.php'; |
|
| 236 | - require_once GMB_PLUGIN_PATH . 'includes/class-gmb-engine.php'; |
|
| 237 | - require_once GMB_PLUGIN_PATH . 'includes/admin/class-gmb-settings.php'; |
|
| 238 | - require_once GMB_PLUGIN_PATH . 'includes/misc-functions.php'; |
|
| 234 | + require_once GMB_PLUGIN_PATH.'includes/class-gmb-scripts.php'; |
|
| 235 | + require_once GMB_PLUGIN_PATH.'includes/class-gmb-widget.php'; |
|
| 236 | + require_once GMB_PLUGIN_PATH.'includes/class-gmb-engine.php'; |
|
| 237 | + require_once GMB_PLUGIN_PATH.'includes/admin/class-gmb-settings.php'; |
|
| 238 | + require_once GMB_PLUGIN_PATH.'includes/misc-functions.php'; |
|
| 239 | 239 | |
| 240 | - if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { |
|
| 240 | + if (is_admin() || (defined('WP_CLI') && WP_CLI)) { |
|
| 241 | 241 | |
| 242 | 242 | //Upgrades |
| 243 | - require_once GMB_PLUGIN_PATH . 'includes/admin/upgrades/upgrade-functions.php'; |
|
| 244 | - require_once GMB_PLUGIN_PATH . 'includes/admin/upgrades/upgrades.php'; |
|
| 243 | + require_once GMB_PLUGIN_PATH.'includes/admin/upgrades/upgrade-functions.php'; |
|
| 244 | + require_once GMB_PLUGIN_PATH.'includes/admin/upgrades/upgrades.php'; |
|
| 245 | 245 | |
| 246 | 246 | //Admin |
| 247 | - require_once GMB_PLUGIN_PATH . 'includes/admin/admin-actions.php'; |
|
| 248 | - require_once GMB_PLUGIN_PATH . 'includes/admin/class-gmb-admin.php'; |
|
| 249 | - require_once GMB_PLUGIN_PATH . 'includes/admin/class-gmb-shortcode-generator.php'; |
|
| 250 | - require_once GMB_PLUGIN_PATH . 'includes/admin/system-info.php'; |
|
| 247 | + require_once GMB_PLUGIN_PATH.'includes/admin/admin-actions.php'; |
|
| 248 | + require_once GMB_PLUGIN_PATH.'includes/admin/class-gmb-admin.php'; |
|
| 249 | + require_once GMB_PLUGIN_PATH.'includes/admin/class-gmb-shortcode-generator.php'; |
|
| 250 | + require_once GMB_PLUGIN_PATH.'includes/admin/system-info.php'; |
|
| 251 | 251 | |
| 252 | 252 | } |
| 253 | 253 | |
@@ -262,26 +262,26 @@ discard block |
||
| 262 | 262 | */ |
| 263 | 263 | public function load_textdomain() { |
| 264 | 264 | // Set filter for Give's languages directory |
| 265 | - $gmb_lang_dir = dirname( plugin_basename( GMB_PLUGIN_FILE ) ) . '/languages/'; |
|
| 266 | - $gmb_lang_dir = apply_filters( 'gmb_languages_directory', $gmb_lang_dir ); |
|
| 265 | + $gmb_lang_dir = dirname(plugin_basename(GMB_PLUGIN_FILE)).'/languages/'; |
|
| 266 | + $gmb_lang_dir = apply_filters('gmb_languages_directory', $gmb_lang_dir); |
|
| 267 | 267 | |
| 268 | 268 | // Traditional WordPress plugin locale filter |
| 269 | - $locale = apply_filters( 'plugin_locale', get_locale(), 'gmb' ); |
|
| 270 | - $mofile = sprintf( '%1$s-%2$s.mo', 'gmb', $locale ); |
|
| 269 | + $locale = apply_filters('plugin_locale', get_locale(), 'gmb'); |
|
| 270 | + $mofile = sprintf('%1$s-%2$s.mo', 'gmb', $locale); |
|
| 271 | 271 | |
| 272 | 272 | // Setup paths to current locale file |
| 273 | - $mofile_local = $gmb_lang_dir . $mofile; |
|
| 274 | - $mofile_global = WP_LANG_DIR . '/gmb/' . $mofile; |
|
| 273 | + $mofile_local = $gmb_lang_dir.$mofile; |
|
| 274 | + $mofile_global = WP_LANG_DIR.'/gmb/'.$mofile; |
|
| 275 | 275 | |
| 276 | - if ( file_exists( $mofile_global ) ) { |
|
| 276 | + if (file_exists($mofile_global)) { |
|
| 277 | 277 | // Look in global /wp-content/languages/gmb folder |
| 278 | - load_textdomain( 'gmb', $mofile_global ); |
|
| 279 | - } elseif ( file_exists( $mofile_local ) ) { |
|
| 278 | + load_textdomain('gmb', $mofile_global); |
|
| 279 | + } elseif (file_exists($mofile_local)) { |
|
| 280 | 280 | // Look in local /wp-content/plugins/gmb/languages/ folder |
| 281 | - load_textdomain( 'gmb', $mofile_local ); |
|
| 281 | + load_textdomain('gmb', $mofile_local); |
|
| 282 | 282 | } else { |
| 283 | 283 | // Load the default language files |
| 284 | - load_plugin_textdomain( 'gmb', false, $gmb_lang_dir ); |
|
| 284 | + load_plugin_textdomain('gmb', false, $gmb_lang_dir); |
|
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | |