Skip to content

Commit c84f201

Browse files
committed
version 2.0.2 released
1 parent e80dfe0 commit c84f201

21 files changed

+329
-1759
lines changed

assets/css/cbxgooglemap-admin.css

Lines changed: 2 additions & 1464 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/cbxgooglemap-block.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/cbxgooglemap-elementor.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/cbxgooglemap-public.css

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/cbxgooglemap-setting.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cbxgooglemap.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Plugin Name: CBX Map for Google Map & OpenStreetMap
1717
* Plugin URI: https://codeboxr.com/product/cbx-google-map-for-wordpress/
1818
* Description: Easy responsive embed of google map and openstreet map
19-
* Version: 2.0.1
19+
* Version: 2.0.2
2020
* Author: Codeboxr
2121
* Author URI: https://codeboxr.com
2222
* License: GPL-2.0+
@@ -33,7 +33,7 @@
3333
}
3434

3535
defined( 'CBXGOOGLEMAP_PLUGIN_NAME' ) or define( 'CBXGOOGLEMAP_PLUGIN_NAME', 'cbxgooglemap' );
36-
defined( 'CBXGOOGLEMAP_PLUGIN_VERSION' ) or define( 'CBXGOOGLEMAP_PLUGIN_VERSION', '2.0.1' );
36+
defined( 'CBXGOOGLEMAP_PLUGIN_VERSION' ) or define( 'CBXGOOGLEMAP_PLUGIN_VERSION', '2.0.2' );
3737
defined( 'CBXGOOGLEMAP_BASE_NAME' ) or define( 'CBXGOOGLEMAP_BASE_NAME', plugin_basename( __FILE__ ) );
3838
defined( 'CBXGOOGLEMAP_ROOT_PATH' ) or define( 'CBXGOOGLEMAP_ROOT_PATH', plugin_dir_path( __FILE__ ) );
3939
defined( 'CBXGOOGLEMAP_ROOT_URL' ) or define( 'CBXGOOGLEMAP_ROOT_URL', plugin_dir_url( __FILE__ ) );
@@ -82,14 +82,14 @@ function cbxgooglemap_compatible_php_version( $version = '' ) {
8282
return true;
8383
}//end method cbxgooglemap_compatible_php_version
8484

85-
register_activation_hook( __FILE__, 'activate_cbxgooglemap' );
86-
register_deactivation_hook( __FILE__, 'deactivate_cbxgooglemap' );
85+
register_activation_hook( __FILE__, 'cbxgooglemap_activate' );
86+
register_deactivation_hook( __FILE__, 'cbxgooglemap_deactivate' );
8787

8888
/**
8989
* The code that runs during plugin activation.
9090
* This action is documented in includes/class-cbxgooglemap-activator.php
9191
*/
92-
function activate_cbxgooglemap() {
92+
function cbxgooglemap_activate() {
9393
$wp_version = CBXGOOGLEMAP_WP_MIN_VERSION;
9494
$php_version = CBXGOOGLEMAP_PHP_MIN_VERSION;
9595

@@ -114,13 +114,13 @@ function activate_cbxgooglemap() {
114114
cbxgooglemap_core();
115115
CBXGooglemapHelper::activate();
116116
}
117-
}//end method activate_cbxgooglemap
117+
}//end method cbxgooglemap_activate
118118

119119
/**
120120
* The code that runs during plugin deactivation.
121121
* This action is documented in includes/class-cbxgooglemap-deactivator.php
122122
*/
123-
function deactivate_cbxgooglemap() {
123+
function cbxgooglemap_deactivate() {
124124
CBXGooglemapHelper::deactivate();
125125
}
126126

@@ -133,7 +133,7 @@ function cbxgooglemap_core() { // phpcs:ignore WordPress.NamingConventions.Valid
133133
global $cbxgooglemap_core;
134134

135135
if ( ! isset( $cbxgooglemap_core ) ) {
136-
$cbxgooglemap_core = run_cbxgooglemap();
136+
$cbxgooglemap_core = cbxgooglemap_run();
137137
}
138138

139139
return $cbxgooglemap_core;
@@ -148,8 +148,8 @@ function cbxgooglemap_core() { // phpcs:ignore WordPress.NamingConventions.Valid
148148
*
149149
* @since 1.0.0
150150
*/
151-
function run_cbxgooglemap() {
151+
function cbxgooglemap_run() {
152152
return CBXGoogleMap::instance();
153-
}//end method run_cbxgooglemap
153+
}//end method cbxgooglemap_run
154154

155-
$GLOBALS['cbxgooglemap_core'] = run_cbxgooglemap();
155+
$GLOBALS['cbxgooglemap_core'] = cbxgooglemap_run();

includes/CBXGoogleMap.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private function include_files() {
101101
* Ensures only one instance of cbxgooglemap is loaded or can be loaded.
102102
*
103103
* @return self Main instance.
104-
* @see run_cbxgooglemap()
104+
* @see cbxgooglemap_run()
105105
* @since 1.1.12
106106
* @static
107107
*/
@@ -116,10 +116,6 @@ public static function instance() {
116116
private function define_common_hooks() {
117117
$misc = new CBXGoogleMapMisc();
118118

119-
//add_action( 'plugins_loaded', [ $misc, 'load_plugin_textdomain' ] );
120-
121-
122-
123119
//upgrade process
124120
//add_action('admin_init', [$misc, 'admin_init_upgrader_process']);
125121
//add_action( 'upgrader_process_complete', [ $misc, 'plugin_upgrader_process_complete' ], 10, 2 );

includes/CBXGoogleMapAdmin.php

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -487,20 +487,28 @@ public function metabox_save($post_id, $post, $update)
487487
if (isset($_POST[$meta_prefix.$id])) {
488488

489489
if (isset($_POST[$meta_prefix.$id])) {
490-
$updated_value = wp_unslash($_POST[$meta_prefix.$id]);
490+
$updated_value = wp_unslash($_POST[$meta_prefix.$id]);//phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
491+
$updated_value = is_array($updated_value) ? cbxgooglemap_decode_entities_array($updated_value) : html_entity_decode($updated_value);
491492

492-
if ($field_type == 'text') {
493-
$updated_value = sanitize_text_field($updated_value);
494-
} elseif ($field_type == 'textarea') {
495-
$updated_value = sanitize_textarea_field($updated_value);
496-
} else {
497-
if ($sanitize_callback !== null && is_callable($sanitize_callback)) {
498-
$updated_value = call_user_func($sanitize_callback, $updated_value);
499-
}
500-
else{
501-
$updated_value = sanitize_text_field($updated_value);
502-
}
493+
$sanitized = false;
494+
495+
if ($sanitize_callback !== null && is_callable($sanitize_callback)) {
496+
$sanitized = true;
497+
$updated_value = call_user_func($sanitize_callback, $updated_value);
503498
}
499+
elseif ($field_type == 'text') {
500+
$sanitized = true;
501+
$updated_value = sanitize_text_field($updated_value);
502+
} elseif ($field_type == 'textarea') {
503+
$sanitized = true;
504+
$updated_value = sanitize_textarea_field( $updated_value );
505+
}
506+
507+
if(!$sanitized) {
508+
$updated_value = wp_kses_post($updated_value);//general sanitization
509+
}
510+
511+
$updated_value = apply_filters('cbxgooglemap_meta_sanitize_admin', $updated_value, $id, $field, $fields);
504512

505513
$is_sortable = isset($field['sortable']) ? $field['sortable'] : false;
506514

includes/CBXGoogleMapMisc.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ public function __construct() {
2424

2525
}//end constructor
2626

27-
/**
28-
* Load the plugin text domain for translation.
29-
*
30-
* @since 1.0.0
31-
*/
32-
public function load_plugin_textdomain() {
33-
//load_plugin_textdomain('cbxgooglemap',false,CBXGOOGLEMAP_ROOT_PATH . 'languages/');
34-
}//end method load_plugin_textdomain
3527

3628
/**
3729
* Show a notice to anyone who has just installed the plugin for the first time
@@ -117,6 +109,7 @@ public function pro_addon_compatibility_campaign() {
117109
}
118110

119111
//if the pro addon is active or installed
112+
//phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
120113
if ( defined( 'CBXGOOGLEMAPPRO_PLUGIN_NAME' ) || in_array( 'cbxgooglemappro/cbxgooglemappro.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
121114
//plugin is activated
122115

@@ -207,7 +200,7 @@ public function custom_plugin_row_meta( $links_array, $plugin_file_name, $plugin
207200
$links_array[] = '<a style="color:#39A96B; font-weight: bold;" href="https://wordpress.org/plugins/cbxgooglemap/#reviews" target="_blank">' . esc_attr__( 'Reviews', 'cbxgooglemap' ) . '</a>';
208201
$links_array[] = '<a target="_blank" style="color:#f44336 !important; font-weight: bold;" href="https://codeboxr.com/doc/cbxmap-doc/" aria-label="' . esc_attr__( 'Documentation', 'cbxgooglemap' ) . '">' . esc_html__( 'Documentation', 'cbxgooglemap' ) . '</a>';
209202

210-
203+
//phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
211204
if ( in_array( 'cbxgooglemappro/cbxgooglemappro.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || defined( 'CBXGOOGLEMAPPRO_PLUGIN_NAME' ) ) {
212205
$links_array[] = '<a style="color:#39A96B; font-weight: bold;" href="https://codeboxr.com/contact-us/" target="_blank">' . esc_attr__( 'Pro Support', 'cbxgooglemap' ) . '</a>';
213206
} else {
@@ -236,7 +229,7 @@ public function custom_message_after_plugin_row_proaddon( $plugin_file, $plugin_
236229
}
237230

238231
$pro_addon_version = CBXGooglemapHelper::get_any_plugin_version( 'cbxgooglemappro/cbxgooglemappro.php' );
239-
$pro_latest_version = '2.0.0';
232+
$pro_latest_version = '2.0.2';
240233

241234
if ( $pro_addon_version != '' && version_compare( $pro_addon_version, $pro_latest_version, '<' ) ) {
242235
// Custom message to display

includes/CBXGoogleMapPublic.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ public function cbxgooglemap_shortcode( $atts ) {
255255
'data-post-id' => $id
256256
];
257257

258+
258259
$output_html = '';
259260

260261
if ( $id > 0 ) {
@@ -296,6 +297,8 @@ public function cbxgooglemap_shortcode( $atts ) {
296297

297298
}
298299
else {
300+
$atts = cbxgooglemap_decode_entities_array($atts);
301+
299302
//show map from shortcode params only
300303
$lat = isset( $atts['lat'] ) ? floatval( $atts['lat'] ) : '';
301304
$lng = isset( $atts['lat'] ) ? floatval( $atts['lng'] ) : '';
@@ -321,8 +324,6 @@ public function cbxgooglemap_shortcode( $atts ) {
321324
$showinfo = isset( $atts['showinfo'] ) ? absint( $atts['showinfo'] ) : $showinfo_default;
322325
$infow_open = isset( $atts['infow_open'] ) ? absint( $atts['infow_open'] ) : $infow_open_default;
323326
$scrollwheel = isset( $atts['scrollwheel'] ) ? absint( $atts['scrollwheel'] ) : $scrollwheel_default;
324-
325-
326327
}
327328

328329
if ( $heading == '' && $website == '' ) {
@@ -342,7 +343,7 @@ public function cbxgooglemap_shortcode( $atts ) {
342343

343344
$data_custom_attrs_html = ' ';
344345
foreach ( $data_custom_attrs as $custom_attr_key => $custom_attr_value ) {
345-
$data_custom_attrs_html .= ' ' . $custom_attr_key . '="' . esc_attr( $custom_attr_value ) . '" ';
346+
$data_custom_attrs_html .= ' ' . $custom_attr_key . '="' . esc_attr( html_entity_decode($custom_attr_value) ) . '" ';
346347
}
347348

348349
$output_html .= '<div class="cbxgooglemap_wrapper ' . esc_attr( $extra_class ) . '">';

0 commit comments

Comments
 (0)