Completed
Pull Request — master (#208)
by Devin
20:05
created
google-maps-builder.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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' );
38
+if ( ! defined('GMB_VERSION')) {
39
+	define('GMB_VERSION', '2.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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
includes/class-gmb-scripts.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @param $hook
30 30
 	 */
31
-	public function admin_hooks( $hook ) {
31
+	public function admin_hooks($hook) {
32 32
 		global $post;
33
-		$js_dir = GMB_PLUGIN_URL . 'assets/js/admin/';
33
+		$js_dir = GMB_PLUGIN_URL.'assets/js/admin/';
34 34
 		$suffix = $this->paths->suffix();
35 35
 
36
-		if ( ( $hook == 'post-new.php' || $hook == 'post.php' ) && 'google_maps' === $post->post_type ) {
36
+		if (($hook == 'post-new.php' || $hook == 'post.php') && 'google_maps' === $post->post_type) {
37 37
 
38 38
 			//free only
39 39
 
Please login to merge, or discard this patch.
includes/class-gmb-engine.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @return string
39 39
 	 */
40
-	public function google_maps_shortcode( $atts ) {
40
+	public function google_maps_shortcode($atts) {
41 41
 
42 42
 		$atts = shortcode_atts(
43 43
 			array(
@@ -48,26 +48,26 @@  discard block
 block discarded – undo
48 48
 		);
49 49
 
50 50
 		//gather data for this shortcode
51
-		$post     = get_post( $atts['id'] );
52
-		$all_meta = get_post_custom( $atts['id'] );
51
+		$post     = get_post($atts['id']);
52
+		$all_meta = get_post_custom($atts['id']);
53 53
 
54
-		$visual_info = maybe_unserialize( $all_meta['gmb_width_height'][0] );
55
-		$lat_lng     = maybe_unserialize( $all_meta['gmb_lat_lng'][0] );
54
+		$visual_info = maybe_unserialize($all_meta['gmb_width_height'][0]);
55
+		$lat_lng     = maybe_unserialize($all_meta['gmb_lat_lng'][0]);
56 56
 
57 57
 		//Put markers into an array for JS usage
58 58
 		$map_marker_array   = array();
59
-		$markers_repeatable = isset( $all_meta['gmb_markers_group'][0] ) ? maybe_unserialize( $all_meta['gmb_markers_group'][0] ) : '';
59
+		$markers_repeatable = isset($all_meta['gmb_markers_group'][0]) ? maybe_unserialize($all_meta['gmb_markers_group'][0]) : '';
60 60
 
61
-		if ( is_array( $markers_repeatable ) ) {
62
-			foreach ( $markers_repeatable as $marker ) {
63
-				array_push( $map_marker_array, $marker );
61
+		if (is_array($markers_repeatable)) {
62
+			foreach ($markers_repeatable as $marker) {
63
+				array_push($map_marker_array, $marker);
64 64
 			}
65 65
 		}
66 66
 
67 67
 		//Send data for AJAX usage
68 68
 		//Add params to AJAX for Shortcode Usage
69 69
 		//@see: http://benjaminrojas.net/using-wp_localize_script-dynamically/
70
-		$localized_data = apply_filters( 'gmb_localized_data', array(
70
+		$localized_data = apply_filters('gmb_localized_data', array(
71 71
 			$post->ID => array(
72 72
 				'id'               => $atts['id'],
73 73
 				'map_params'       => array(
@@ -76,41 +76,41 @@  discard block
 block discarded – undo
76 76
 					'height'         => $visual_info['height'],
77 77
 					'latitude'       => $lat_lng['latitude'],
78 78
 					'longitude'      => $lat_lng['longitude'],
79
-					'zoom'           => ! empty( $all_meta['gmb_zoom'][0] ) ? $all_meta['gmb_zoom'][0] : '15',
80
-					'default_marker' => apply_filters( 'gmb_default_marker', GMB_PLUGIN_URL . 'assets/img/spotlight-poi.png' ),
79
+					'zoom'           => ! empty($all_meta['gmb_zoom'][0]) ? $all_meta['gmb_zoom'][0] : '15',
80
+					'default_marker' => apply_filters('gmb_default_marker', GMB_PLUGIN_URL.'assets/img/spotlight-poi.png'),
81 81
 				),
82 82
 				'map_controls'     => array(
83
-					'zoom_control'      => ! empty( $all_meta['gmb_zoom_control'][0] ) ? strtoupper( $all_meta['gmb_zoom_control'][0] ) : 'STANDARD',
84
-					'pan_control'       => ! empty( $all_meta['gmb_pan'][0] ) ? $all_meta['gmb_pan'][0] : 'none',
85
-					'map_type_control'  => ! empty( $all_meta['gmb_map_type_control'][0] ) ? $all_meta['gmb_map_type_control'][0] : 'none',
86
-					'draggable'         => ! empty( $all_meta['gmb_draggable'][0] ) ? $all_meta['gmb_draggable'][0] : 'none',
87
-					'double_click_zoom' => ! empty( $all_meta['gmb_double_click'][0] ) ? $all_meta['gmb_double_click'][0] : 'none',
88
-					'wheel_zoom'        => ! empty( $all_meta['gmb_wheel_zoom'][0] ) ? $all_meta['gmb_wheel_zoom'][0] : 'none',
89
-					'street_view'       => ! empty( $all_meta['gmb_street_view'][0] ) ? $all_meta['gmb_street_view'][0] : 'none',
83
+					'zoom_control'      => ! empty($all_meta['gmb_zoom_control'][0]) ? strtoupper($all_meta['gmb_zoom_control'][0]) : 'STANDARD',
84
+					'pan_control'       => ! empty($all_meta['gmb_pan'][0]) ? $all_meta['gmb_pan'][0] : 'none',
85
+					'map_type_control'  => ! empty($all_meta['gmb_map_type_control'][0]) ? $all_meta['gmb_map_type_control'][0] : 'none',
86
+					'draggable'         => ! empty($all_meta['gmb_draggable'][0]) ? $all_meta['gmb_draggable'][0] : 'none',
87
+					'double_click_zoom' => ! empty($all_meta['gmb_double_click'][0]) ? $all_meta['gmb_double_click'][0] : 'none',
88
+					'wheel_zoom'        => ! empty($all_meta['gmb_wheel_zoom'][0]) ? $all_meta['gmb_wheel_zoom'][0] : 'none',
89
+					'street_view'       => ! empty($all_meta['gmb_street_view'][0]) ? $all_meta['gmb_street_view'][0] : 'none',
90 90
 				),
91 91
 				'map_theme'        => array(
92
-					'map_type'       => ! empty( $all_meta['gmb_type'][0] ) ? $all_meta['gmb_type'][0] : 'RoadMap',
93
-					'map_theme_json' => ! empty( $all_meta['gmb_theme_json'][0] ) ? $all_meta['gmb_theme_json'][0] : 'none',
92
+					'map_type'       => ! empty($all_meta['gmb_type'][0]) ? $all_meta['gmb_type'][0] : 'RoadMap',
93
+					'map_theme_json' => ! empty($all_meta['gmb_theme_json'][0]) ? $all_meta['gmb_theme_json'][0] : 'none',
94 94
 
95 95
 				),
96 96
 				'map_markers'      => $map_marker_array,
97 97
 				'plugin_url'       => GMB_PLUGIN_URL,
98 98
 				'places_api'       => array(
99
-					'show_places'   => ! empty( $all_meta['gmb_show_places'][0] ) ? $all_meta['gmb_show_places'][0] : 'no',
100
-					'search_radius' => ! empty( $all_meta['gmb_search_radius'][0] ) ? $all_meta['gmb_search_radius'][0] : '3000',
101
-					'search_places' => ! empty( $all_meta['gmb_places_search_multicheckbox'][0] ) ? maybe_unserialize( $all_meta['gmb_places_search_multicheckbox'][0] ) : '',
99
+					'show_places'   => ! empty($all_meta['gmb_show_places'][0]) ? $all_meta['gmb_show_places'][0] : 'no',
100
+					'search_radius' => ! empty($all_meta['gmb_search_radius'][0]) ? $all_meta['gmb_search_radius'][0] : '3000',
101
+					'search_places' => ! empty($all_meta['gmb_places_search_multicheckbox'][0]) ? maybe_unserialize($all_meta['gmb_places_search_multicheckbox'][0]) : '',
102 102
 				),
103
-				'map_markers_icon' => ! empty( $all_meta['gmb_map_marker'] ) ? $all_meta['gmb_map_marker'][0] : 'none',
103
+				'map_markers_icon' => ! empty($all_meta['gmb_map_marker']) ? $all_meta['gmb_map_marker'][0] : 'none',
104 104
 			)
105
-		) );
105
+		));
106 106
 
107
-		$this->array_push_localized_script( $localized_data );
107
+		$this->array_push_localized_script($localized_data);
108 108
 
109 109
 		ob_start();
110 110
 
111
-		include $this->get_google_maps_template( 'public.php' );
111
+		include $this->get_google_maps_template('public.php');
112 112
 
113
-		return apply_filters( 'gmb_shortcode_output', ob_get_clean() );
113
+		return apply_filters('gmb_shortcode_output', ob_get_clean());
114 114
 
115 115
 	}
116 116
 
Please login to merge, or discard this patch.
includes/admin/class-gmb-settings.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 		parent::__construct();
21
-		$this->page_name = __( 'Google Maps Builder Settings', $this->plugin_slug );
21
+		$this->page_name = __('Google Maps Builder Settings', $this->plugin_slug);
22 22
 
23 23
 		$this->plugin_slug = Google_Maps_Builder()->get_plugin_slug();
24
-		add_action( 'cmb2_render_lat_lng_default', array( $this, 'cmb2_render_lat_lng_default' ), 10, 2 );
24
+		add_action('cmb2_render_lat_lng_default', array($this, 'cmb2_render_lat_lng_default'), 10, 2);
25 25
 
26 26
 		//upsell markup
27
-		add_action( 'gmb_settings_page_after_logo', array( $this, 'settings_upsell' ) );
28
-		add_action( 'gmb_social_media_after_logo', array( $this, 'settings_social_media_upsell' ) );
27
+		add_action('gmb_settings_page_after_logo', array($this, 'settings_upsell'));
28
+		add_action('gmb_social_media_after_logo', array($this, 'settings_social_media_upsell'));
29 29
 	}
30 30
 
31 31
 
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
 	 *
37 37
 	 * @return mixed
38 38
 	 */
39
-	function add_plugin_page_links( $links, $file ) {
39
+	function add_plugin_page_links($links, $file) {
40 40
 
41
-		if ( $file == GMB_PLUGIN_BASE ) {
41
+		if ($file == GMB_PLUGIN_BASE) {
42 42
 
43 43
 			// Add Widget Page link to our plugin
44
-			$settings_link = '<a href="edit.php?post_type=google_maps&page=' . self::$key . '" title="' . __( 'Visit the Google Maps Builder plugin settings page', $this->plugin_slug ) . '">' . __( 'Settings', $this->plugin_slug ) . '</a>';
45
-			array_unshift( $links, $settings_link );
44
+			$settings_link = '<a href="edit.php?post_type=google_maps&page='.self::$key.'" title="'.__('Visit the Google Maps Builder plugin settings page', $this->plugin_slug).'">'.__('Settings', $this->plugin_slug).'</a>';
45
+			array_unshift($links, $settings_link);
46 46
 		}
47 47
 
48 48
 		return $links;
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
 	 *
59 59
 	 * @return array
60 60
 	 */
61
-	function add_plugin_meta_links( $meta, $file ) {
61
+	function add_plugin_meta_links($meta, $file) {
62 62
 
63
-		if ( $file == GMB_PLUGIN_BASE ) {
64
-			$meta[] = "<a href='http://wordpress.org/support/view/plugin-reviews/google-maps-builder' target='_blank' title='" . __( 'Rate Google Maps Builder on WordPress.org', $this->plugin_slug ) . "'>" . __( 'Rate Plugin', $this->plugin_slug ) . "</a>";
65
-			$meta[] = "<a href='https://wordimpress.com/documentation/maps-builder-pro/' target='_blank' title='" . __( 'View the plugin documentation', $this->plugin_slug ) . "'>" . __( 'Documentation', $this->plugin_slug ) . "</a>";
66
-			$meta[] = '<a href="http://wordpress.org/support/plugin/google-maps-builder/" target="_blank" title="' . __( 'Get plugin support via the WordPress community', $this->plugin_slug ) . '">' . __( 'Support', $this->plugin_slug ) . '</a>';
63
+		if ($file == GMB_PLUGIN_BASE) {
64
+			$meta[] = "<a href='http://wordpress.org/support/view/plugin-reviews/google-maps-builder' target='_blank' title='".__('Rate Google Maps Builder on WordPress.org', $this->plugin_slug)."'>".__('Rate Plugin', $this->plugin_slug)."</a>";
65
+			$meta[] = "<a href='https://wordimpress.com/documentation/maps-builder-pro/' target='_blank' title='".__('View the plugin documentation', $this->plugin_slug)."'>".__('Documentation', $this->plugin_slug)."</a>";
66
+			$meta[] = '<a href="http://wordpress.org/support/plugin/google-maps-builder/" target="_blank" title="'.__('Get plugin support via the WordPress community', $this->plugin_slug).'">'.__('Support', $this->plugin_slug).'</a>';
67 67
 			$meta[] = '<a href="
68
-https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=LISTING&utm_campaign=MBF%20LISTING" title="' . __( 'Upgrade to Maps Builder Pro', $this->plugin_slug ) . '" target="_blank">' . __( 'Upgrade to Pro', $this->plugin_slug ) . ' &raquo;</a>';
68
+https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=LISTING&utm_campaign=MBF%20LISTING" title="' . __('Upgrade to Maps Builder Pro', $this->plugin_slug).'" target="_blank">'.__('Upgrade to Pro', $this->plugin_slug).' &raquo;</a>';
69 69
 		}
70 70
 
71 71
 		return $meta;
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 */
81 81
 	public function settings_upsell() { ?>
82 82
 		<a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=SETTINGS&utm_campaign=MBF%20Settings" target="_blank" class="button button-primary gmb-orange-btn gmb-settings-header-btn">
83
-			<?php _e( 'Upgrade to Pro', $this->plugin_slug ); ?>
83
+			<?php _e('Upgrade to Pro', $this->plugin_slug); ?>
84 84
 		</a>
85 85
 		<?php
86 86
 	}
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		?>
97 97
 		<div class="go-pro">
98 98
 			<a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&amp;utm_medium=BANNER&amp;utm_content=SETTINGS&amp;utm_campaign=MBF%20Settings" target="_blank" class="button button-primary button-small gmb-orange-btn gmb-settings-header-btn">
99
-				<?php esc_html_e( 'Upgrade to Pro', 'google-maps-builder' ); ?>
99
+				<?php esc_html_e('Upgrade to Pro', 'google-maps-builder'); ?>
100 100
 			</a>
101 101
 		</div>
102 102
 		<?php
@@ -112,11 +112,11 @@  discard block
 block discarded – undo
112 112
 	protected function settings_page_data() {
113 113
 		//place holder
114 114
 		$data = array(
115
-			'welcome'     => sprintf( '%1s Maps Builder %s', __( 'Welcome to', 'maps-builder-pro' ), Google_Maps_Builder()->meta['Version'] ),
115
+			'welcome'     => sprintf('%1s Maps Builder %s', __('Welcome to', 'maps-builder-pro'), Google_Maps_Builder()->meta['Version']),
116 116
 			'sub_heading' => $this->sub_heading()
117 117
 		);
118 118
 
119
-		return $this->view_data( $data, true );
119
+		return $this->view_data($data, true);
120 120
 	}
121 121
 
122 122
 	/**
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 	 * @return string
128 128
 	 */
129 129
 	protected function sub_heading() {
130
-		$out = __( 'Thanks for using Maps Builder', 'google-maps-pro' );
131
-		$out .= sprintf( __( 'To get started, read over the %1$sdocumentation%2$s, take a gander at the settings, and build yourself some maps! If you enjoy this plugin please consider telling a friend, rating it %3$s5-stars%2$s, or purchasing the %4$sPro%2$s edition.', $this->plugin_slug ), '<a href="https://wordimpress.com/documentation/maps-builder-pro/" target="_blank">', '</a>', '<a href="https://wordpress.org/support/view/plugin-reviews/google-maps-builder?filter=5#postform" target="_blank">', '<a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&amp;utm_medium=BANNER&amp;utm_content=SETTINGS&amp;utm_campaign=MBF%20Settings" target="_blank">' );
130
+		$out = __('Thanks for using Maps Builder', 'google-maps-pro');
131
+		$out .= sprintf(__('To get started, read over the %1$sdocumentation%2$s, take a gander at the settings, and build yourself some maps! If you enjoy this plugin please consider telling a friend, rating it %3$s5-stars%2$s, or purchasing the %4$sPro%2$s edition.', $this->plugin_slug), '<a href="https://wordimpress.com/documentation/maps-builder-pro/" target="_blank">', '</a>', '<a href="https://wordpress.org/support/view/plugin-reviews/google-maps-builder?filter=5#postform" target="_blank">', '<a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&amp;utm_medium=BANNER&amp;utm_content=SETTINGS&amp;utm_campaign=MBF%20Settings" target="_blank">');
132 132
 
133 133
 		return $out;
134 134
 
Please login to merge, or discard this patch.
includes/admin/class-gmb-admin.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -35,18 +35,18 @@  discard block
 block discarded – undo
35 35
 
36 36
 		parent::__construct();
37 37
 
38
-		add_action( 'cmb2_render_google_maps_preview', array( $this, 'cmb2_render_google_maps_preview' ), 10, 2 );
38
+		add_action('cmb2_render_google_maps_preview', array($this, 'cmb2_render_google_maps_preview'), 10, 2);
39 39
 		// Load admin style sheet and JavaScript.
40
-		add_action( 'wp_ajax_hide_welcome', array( $this, 'hide_welcome_callback' ) );
40
+		add_action('wp_ajax_hide_welcome', array($this, 'hide_welcome_callback'));
41 41
 
42 42
 		//Add links/information to plugin row meta
43
-		add_filter( 'cmb2_get_metabox_form_format', array( $this, 'gmb_modify_cmb2_form_output' ), 10, 3 );
43
+		add_filter('cmb2_get_metabox_form_format', array($this, 'gmb_modify_cmb2_form_output'), 10, 3);
44 44
 
45 45
 		//Widget upsell
46
-		add_action( 'gmb_after_widget_form', array( $this, 'widget_upsell' ) );
46
+		add_action('gmb_after_widget_form', array($this, 'widget_upsell'));
47 47
 
48 48
 		//Useful class for free-only styling
49
-		add_filter( 'admin_body_class', array( $this, 'admin_body_classes' ) );
49
+		add_filter('admin_body_class', array($this, 'admin_body_classes'));
50 50
 
51 51
 	}
52 52
 
@@ -55,32 +55,32 @@  discard block
 block discarded – undo
55 55
 	 *
56 56
 	 * @since  1.0.0
57 57
 	 */
58
-	function cmb2_render_google_maps_preview( $field, $meta ) {
58
+	function cmb2_render_google_maps_preview($field, $meta) {
59 59
 
60 60
 		/* @var $post */
61 61
 		global $post;
62 62
 
63
-		$meta            = wp_parse_args( $meta, array() );
64
-		$wh_value        = get_post_meta( $post->ID, 'gmb_width_height', true );
65
-		$lat_lng         = get_post_meta( $post->ID, 'gmb_lat_lng', true );
63
+		$meta            = wp_parse_args($meta, array());
64
+		$wh_value        = get_post_meta($post->ID, 'gmb_width_height', true);
65
+		$lat_lng         = get_post_meta($post->ID, 'gmb_lat_lng', true);
66 66
 		$default_options = $this->get_default_map_options();
67 67
 
68
-		$output = '<div class="places-loading wpgp-loading">' . __( 'Loading Places', $this->plugin_slug ) . '</div><div id="google-map-wrap">';
68
+		$output = '<div class="places-loading wpgp-loading">'.__('Loading Places', $this->plugin_slug).'</div><div id="google-map-wrap">';
69 69
 		$output .= '<div id="map" style="height:600px; width:100%;"></div>';
70 70
 
71
-		$output .= '<div class="map-modal-upsell"><p class="upsell-intro">' . __( 'Want more?', $this->plugin_slug ) . '</p><a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=MODAL&utm_campaign=MBF%20Modal" class="button button-small upsell-button" target="_blank">' . __( 'Go Pro!', $this->plugin_slug ) . '</a></div>';
71
+		$output .= '<div class="map-modal-upsell"><p class="upsell-intro">'.__('Want more?', $this->plugin_slug).'</p><a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=MODAL&utm_campaign=MBF%20Modal" class="button button-small upsell-button" target="_blank">'.__('Go Pro!', $this->plugin_slug).'</a></div>';
72 72
 
73 73
 		//Toolbar
74 74
 		$output .= '<div id="map-toolbar">';
75
-		$output .= '<button class="add-location button button-small gmb-magnific-inline" data-target="cmb2-id-gmb-geocoder" data-auto-focus="true"><span class="dashicons dashicons-pressthis"></span>' . __( 'Add Location', $this->plugin_slug ) . '</button>';
76
-		$output .= '<button class="drop-marker button button-small"><span class="dashicons dashicons-location"></span>' . __( 'Drop a Marker', $this->plugin_slug ) . '</button>';
77
-		$output .= '<button class="goto-location button button-small gmb-magnific-inline" data-target="map-autocomplete-wrap" data-auto-focus="true"><span class="dashicons dashicons-admin-site"></span>' . __( 'Goto Location', $this->plugin_slug ) . '</button>';
78
-		$output .= '<button class="edit-title button  button-small gmb-magnific-inline" data-target="map-title-wrap" data-auto-focus="true"><span class="dashicons dashicons-edit"></span>' . __( 'Edit Map Title', $this->plugin_slug ) . '</button>';
75
+		$output .= '<button class="add-location button button-small gmb-magnific-inline" data-target="cmb2-id-gmb-geocoder" data-auto-focus="true"><span class="dashicons dashicons-pressthis"></span>'.__('Add Location', $this->plugin_slug).'</button>';
76
+		$output .= '<button class="drop-marker button button-small"><span class="dashicons dashicons-location"></span>'.__('Drop a Marker', $this->plugin_slug).'</button>';
77
+		$output .= '<button class="goto-location button button-small gmb-magnific-inline" data-target="map-autocomplete-wrap" data-auto-focus="true"><span class="dashicons dashicons-admin-site"></span>'.__('Goto Location', $this->plugin_slug).'</button>';
78
+		$output .= '<button class="edit-title button  button-small gmb-magnific-inline" data-target="map-title-wrap" data-auto-focus="true"><span class="dashicons dashicons-edit"></span>'.__('Edit Map Title', $this->plugin_slug).'</button>';
79 79
 
80 80
 		$output .= '<div class="live-lat-lng-wrap clearfix">';
81
-		$output .= '<button disabled class="update-lat-lng button button-small">' . __( 'Set Lat/Lng', $this->plugin_slug ) . '</button>';
82
-		$output .= '<div class="live-latitude-wrap"><span class="live-latitude-label">' . __( 'Lat:', $this->plugin_slug ) . '</span><span class="live-latitude">' . ( isset( $lat_lng['latitude'] ) ? $lat_lng['latitude'] : '' ) . '</span></div>';
83
-		$output .= '<div class="live-longitude-wrap"><span class="live-longitude-label">' . __( 'Lng:', $this->plugin_slug ) . '</span><span class="live-longitude">' . ( isset( $lat_lng['longitude'] ) ? $lat_lng['longitude'] : '' ) . '</span></div>';
81
+		$output .= '<button disabled class="update-lat-lng button button-small">'.__('Set Lat/Lng', $this->plugin_slug).'</button>';
82
+		$output .= '<div class="live-latitude-wrap"><span class="live-latitude-label">'.__('Lat:', $this->plugin_slug).'</span><span class="live-latitude">'.(isset($lat_lng['latitude']) ? $lat_lng['latitude'] : '').'</span></div>';
83
+		$output .= '<div class="live-longitude-wrap"><span class="live-longitude-label">'.__('Lng:', $this->plugin_slug).'</span><span class="live-longitude">'.(isset($lat_lng['longitude']) ? $lat_lng['longitude'] : '').'</span></div>';
84 84
 		$output .= '</div>'; //End .live-lat-lng-wrap
85 85
 		$output .= '</div>'; //End #map-toolbar
86 86
 		$output .= '</div>'; //End #map
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
 		$output .= '<div class="inner-modal-wrap">';
92 92
 		$output .= '<div class="inner-modal-container">';
93 93
 		$output .= '<div class="inner-modal clearfix">';
94
-		$output .= '<label for="post_title" class="map-title">' . __( 'Map Title', $this->plugin_slug ) . '</label>';
95
-		$output .= '<p class="cmb2-metabox-description">' . __( 'Give your Map a descriptive title', $this->plugin_slug ) . '</p>';
96
-		$output .= '<button type="button" class="gmb-modal-close">&times;</button><input type="text" name="model_post_title" size="30" value="' . get_the_title() . '" id="modal_title" spellcheck="true" autocomplete="off" placeholder="' . __( 'Enter map title', $this->plugin_slug ) . '">';
94
+		$output .= '<label for="post_title" class="map-title">'.__('Map Title', $this->plugin_slug).'</label>';
95
+		$output .= '<p class="cmb2-metabox-description">'.__('Give your Map a descriptive title', $this->plugin_slug).'</p>';
96
+		$output .= '<button type="button" class="gmb-modal-close">&times;</button><input type="text" name="model_post_title" size="30" value="'.get_the_title().'" id="modal_title" spellcheck="true" autocomplete="off" placeholder="'.__('Enter map title', $this->plugin_slug).'">';
97 97
 		$output .= '</div>';
98 98
 		$output .= '</div>';
99 99
 		$output .= '</div>';
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 		$output .= '<div class="inner-modal-wrap">';
104 104
 		$output .= '<div class="inner-modal-container">';
105 105
 		$output .= '<div class="inner-modal clearfix">';
106
-		$output .= '<label for="map-location-autocomplete" class="map-title">' . __( 'Enter a Location', $this->plugin_slug ) . '</label>';
107
-		$output .= '<p class="cmb2-metabox-description">' . __( 'Type your point of interest below and the map will be re-centered over that location', $this->plugin_slug ) . '</p>';
106
+		$output .= '<label for="map-location-autocomplete" class="map-title">'.__('Enter a Location', $this->plugin_slug).'</label>';
107
+		$output .= '<p class="cmb2-metabox-description">'.__('Type your point of interest below and the map will be re-centered over that location', $this->plugin_slug).'</p>';
108 108
 		$output .= '<button type="button" class="gmb-modal-close">&times;</button>';
109 109
 		$output .= '<input type="text" name="" size="30" id="map-location-autocomplete">';
110 110
 		$output .= '</div>';
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
 		$output .= '<div class="warning-message wpgp-message"></div>';
116 116
 
117 117
 		//Markers Modal
118
-		gmb_include_view( 'admin/views/markers.php', false, $this->view_data() );
118
+		gmb_include_view('admin/views/markers.php', false, $this->view_data());
119 119
 
120
-		echo apply_filters( 'google_maps_preview', $output );
120
+		echo apply_filters('google_maps_preview', $output);
121 121
 
122 122
 	}
123 123
 
@@ -134,12 +134,12 @@  discard block
 block discarded – undo
134 134
 	 *
135 135
 	 * @return string
136 136
 	 */
137
-	function gmb_modify_cmb2_form_output( $form_format, $object_id, $cmb ) {
137
+	function gmb_modify_cmb2_form_output($form_format, $object_id, $cmb) {
138 138
 
139 139
 		//only modify the give settings form
140
-		if ( 'gmb_settings' == $object_id && 'plugin_options' == $cmb->cmb_id ) {
140
+		if ('gmb_settings' == $object_id && 'plugin_options' == $cmb->cmb_id) {
141 141
 
142
-			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="gmb-submit-wrap"><input type="submit" name="submit-cmb" value="' . __( 'Save Settings', 'give' ) . '" class="button-primary"></div></form>';
142
+			return '<form class="cmb-form" method="post" id="%1$s" enctype="multipart/form-data" encoding="multipart/form-data"><input type="hidden" name="object_id" value="%2$s">%3$s<div class="gmb-submit-wrap"><input type="submit" name="submit-cmb" value="'.__('Save Settings', 'give').'" class="button-primary"></div></form>';
143 143
 		}
144 144
 
145 145
 		return $form_format;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		<div class="gmb-widget-upgrade clear">
160 160
 			<span class="powered-by"></span>
161 161
 			<a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=WIDGET&utm_campaign=MBF%20Widgets" target="_blank" class="button button-small">
162
-				<?php _e( 'Upgrade to Pro', $this->plugin_slug ); ?>
162
+				<?php _e('Upgrade to Pro', $this->plugin_slug); ?>
163 163
 				<span class="new-window"></span>
164 164
 			</a>
165 165
 		</div>
@@ -175,11 +175,11 @@  discard block
 block discarded – undo
175 175
 	 *
176 176
 	 * @return String          Altered body classes.
177 177
 	 */
178
-	function admin_body_classes( $classes ) {
178
+	function admin_body_classes($classes) {
179 179
 
180 180
 		global $post;
181 181
 
182
-		if ( isset( $post->post_type ) && $post->post_type == 'google_maps' ) {
182
+		if (isset($post->post_type) && $post->post_type == 'google_maps') {
183 183
 			$classes .= 'maps-builder-free';
184 184
 		}
185 185
 
Please login to merge, or discard this patch.
includes/admin/class-gmb-shortcode-generator.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
 	 */
15 15
 	public function __construct() {
16 16
 		parent::__construct();
17
-		add_action( 'gmb_after_shortcode_form', array( $this, 'form_upsell') );
18
-		add_action( 'gmb_shortcode_iframe_style', array( $this, 'upsell_css' ) );
17
+		add_action('gmb_after_shortcode_form', array($this, 'form_upsell'));
18
+		add_action('gmb_shortcode_iframe_style', array($this, 'upsell_css'));
19 19
 	}
20 20
 
21 21
 	
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @return string
31 31
 	 */
32
-	public static function select( $args = array() ) {
32
+	public static function select($args = array()) {
33 33
 
34 34
 		$defaults = array(
35 35
 			'options'          => array(),
@@ -40,59 +40,59 @@  discard block
 block discarded – undo
40 40
 			'chosen'           => false,
41 41
 			'placeholder'      => null,
42 42
 			'multiple'         => false,
43
-			'show_option_all'  => _x( 'All', 'all dropdown items', 'google-maps-builder' ),
44
-			'show_option_none' => _x( 'None', 'no dropdown items', 'google-maps-builder' )
43
+			'show_option_all'  => _x('All', 'all dropdown items', 'google-maps-builder'),
44
+			'show_option_none' => _x('None', 'no dropdown items', 'google-maps-builder')
45 45
 		);
46 46
 
47
-		$args = wp_parse_args( $args, $defaults );
47
+		$args = wp_parse_args($args, $defaults);
48 48
 
49
-		if ( $args['multiple'] ) {
49
+		if ($args['multiple']) {
50 50
 			$multiple = ' MULTIPLE';
51 51
 		} else {
52 52
 			$multiple = '';
53 53
 		}
54 54
 
55
-		if ( $args['chosen'] ) {
55
+		if ($args['chosen']) {
56 56
 			$args['class'] .= 'gmb-select-chosen';
57 57
 		}
58 58
 
59
-		if ( $args['placeholder'] ) {
59
+		if ($args['placeholder']) {
60 60
 			$placeholder = $args['placeholder'];
61 61
 		} else {
62 62
 			$placeholder = '';
63 63
 		}
64 64
 
65
-		$output = '<select name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( sanitize_key( str_replace( '-', '_', $args['id'] ) ) ) . '" class="gmb-select ' . esc_attr( $args['class'] ) . '"' . $multiple . ' data-placeholder="' . $placeholder . '">';
65
+		$output = '<select name="'.esc_attr($args['name']).'" id="'.esc_attr(sanitize_key(str_replace('-', '_', $args['id']))).'" class="gmb-select '.esc_attr($args['class']).'"'.$multiple.' data-placeholder="'.$placeholder.'">';
66 66
 
67
-		if ( $args['show_option_all'] ) {
68
-			if ( $args['multiple'] ) {
69
-				$selected = selected( true, in_array( 0, $args['selected'] ), false );
67
+		if ($args['show_option_all']) {
68
+			if ($args['multiple']) {
69
+				$selected = selected(true, in_array(0, $args['selected']), false);
70 70
 			} else {
71
-				$selected = selected( $args['selected'], 0, false );
71
+				$selected = selected($args['selected'], 0, false);
72 72
 			}
73
-			$output .= '<option value="all"' . $selected . '>' . esc_html( $args['show_option_all'] ) . '</option>';
73
+			$output .= '<option value="all"'.$selected.'>'.esc_html($args['show_option_all']).'</option>';
74 74
 		}
75 75
 
76
-		if ( ! empty( $args['options'] ) ) {
76
+		if ( ! empty($args['options'])) {
77 77
 
78
-			if ( $args['show_option_none'] ) {
79
-				if ( $args['multiple'] ) {
80
-					$selected = selected( true, in_array( - 1, $args['selected'] ), false );
78
+			if ($args['show_option_none']) {
79
+				if ($args['multiple']) {
80
+					$selected = selected(true, in_array( - 1, $args['selected'] ), false);
81 81
 				} else {
82
-					$selected = selected( $args['selected'], - 1, false );
82
+					$selected = selected($args['selected'], - 1, false);
83 83
 				}
84
-				$output .= '<option value="-1"' . $selected . '>' . esc_html( $args['show_option_none'] ) . '</option>';
84
+				$output .= '<option value="-1"'.$selected.'>'.esc_html($args['show_option_none']).'</option>';
85 85
 			}
86 86
 
87
-			foreach ( $args['options'] as $key => $option ) {
87
+			foreach ($args['options'] as $key => $option) {
88 88
 
89
-				if ( $args['multiple'] && is_array( $args['selected'] ) ) {
90
-					$selected = selected( true, in_array( $key, $args['selected'] ), false );
89
+				if ($args['multiple'] && is_array($args['selected'])) {
90
+					$selected = selected(true, in_array($key, $args['selected']), false);
91 91
 				} else {
92
-					$selected = selected( $args['selected'], $key, false );
92
+					$selected = selected($args['selected'], $key, false);
93 93
 				}
94 94
 
95
-				$output .= '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option ) . '</option>';
95
+				$output .= '<option value="'.esc_attr($key).'"'.$selected.'>'.esc_html($option).'</option>';
96 96
 			}
97 97
 		}
98 98
 
@@ -108,9 +108,9 @@  discard block
 block discarded – undo
108 108
 	 *
109 109
 	 * @uses "gmb_after_shortcode_form"
110 110
 	 */
111
-	public function form_upsell(){?>
111
+	public function form_upsell() {?>
112 112
 		<a href="https://wordimpress.com/plugins/maps-builder-pro?utm_source=MBF&utm_medium=BANNER&utm_content=SHORTCODE&utm_campaign=MBF%20Shortcode" class="button button-small shortcode-upsell" target="_blank">
113
-			<?php _e( 'Go Pro', 'google-maps-builder' ); ?>
113
+			<?php _e('Go Pro', 'google-maps-builder'); ?>
114 114
 			<span class="dashicons dashicons-external"></span>
115 115
 		</a>
116 116
 	<?php
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	 *
125 125
 	 * @uses "gmb_shortcode_iframe_style" action
126 126
 	 */
127
-	public function upsell_css(){ ?>
127
+	public function upsell_css() { ?>
128 128
 		.shortcode-upsell {
129 129
 			position: absolute;
130 130
 			bottom: 10px;
Please login to merge, or discard this patch.