Version Description
- Improves the plugin performance and the maps generation.
Download this release
Release Info
Developer | codepeople |
Plugin | Google Maps CP |
Version | 1.0.23 |
Comparing to | |
See all releases |
Code changes from version 1.0.22 to 1.0.23
- codepeople-post-map.php +1 -1
- include/functions.php +14 -3
- readme.txt +5 -1
codepeople-post-map.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Google Maps CP
|
4 |
Text Domain: codepeople-post-map
|
5 |
-
Version: 1.0.
|
6 |
Author: CodePeople
|
7 |
Author URI: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
|
8 |
Plugin URI: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
|
2 |
/*
|
3 |
Plugin Name: Google Maps CP
|
4 |
Text Domain: codepeople-post-map
|
5 |
+
Version: 1.0.23
|
6 |
Author: CodePeople
|
7 |
Author URI: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
|
8 |
Plugin URI: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
|
include/functions.php
CHANGED
@@ -82,6 +82,13 @@ class CPM {
|
|
82 |
);
|
83 |
} // End __construct
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
//---------- CREATE MAP ----------
|
86 |
|
87 |
/**
|
@@ -103,13 +110,16 @@ class CPM {
|
|
103 |
}
|
104 |
|
105 |
// authentication passed, save data
|
106 |
-
$default_icon = ( !empty( $_POST['default_icon'] ) ) ? $_POST['default_icon'] : $this->get_configuration_option('default_icon');
|
107 |
|
108 |
delete_post_meta($post_id,'cpm_point');
|
109 |
delete_post_meta($post_id,'cpm_map');
|
110 |
|
111 |
$new_cpm_point = ( isset( $_POST['cpm_point'] ) ) ? $_POST['cpm_point'] : array();
|
|
|
112 |
$new_cpm_map = ( isset( $_POST['cpm_map'] ) ) ? $_POST['cpm_map'] : array();
|
|
|
|
|
113 |
$new_cpm_point['icon'] = str_replace( CPM_PLUGIN_URL, '', $default_icon );
|
114 |
|
115 |
// Set the map's config
|
@@ -847,7 +857,7 @@ class CPM {
|
|
847 |
{
|
848 |
if( !wp_script_is( 'jquery' ) )
|
849 |
{
|
850 |
-
print "<script src='".(
|
851 |
}
|
852 |
|
853 |
print "<link rel='stylesheet' id='cpm_style-css' href='".CPM_PLUGIN_URL.'/styles/cpm-styles.css'."' type='text/css' media='all' />";
|
@@ -887,7 +897,8 @@ class CPM {
|
|
887 |
// Check if post exists and save the configuraton options
|
888 |
if (isset($_POST['cpm_map_noncename']) && wp_verify_nonce($_POST['cpm_map_noncename'],__FILE__)){
|
889 |
$options = $_POST['cpm_map'];
|
890 |
-
|
|
|
891 |
$options['windowhtml'] = $this->get_configuration_option('windowhtml');
|
892 |
update_option('cpm_config', $options);
|
893 |
update_option('cpm_load_resources_in_footer', (isset($_POST['cpm_load_resources_in_footer'])) ? true : false);
|
82 |
);
|
83 |
} // End __construct
|
84 |
|
85 |
+
function sanitize_html( $v )
|
86 |
+
{
|
87 |
+
$allowed_tags = wp_kses_allowed_html( 'post' );
|
88 |
+
$v = wp_kses($v, $allowed_tags);
|
89 |
+
return $v;
|
90 |
+
} // End sanitize
|
91 |
+
|
92 |
//---------- CREATE MAP ----------
|
93 |
|
94 |
/**
|
110 |
}
|
111 |
|
112 |
// authentication passed, save data
|
113 |
+
$default_icon = ( !empty( $_POST['default_icon'] ) ) ? sanitize_text_field($_POST['default_icon']) : $this->get_configuration_option('default_icon');
|
114 |
|
115 |
delete_post_meta($post_id,'cpm_point');
|
116 |
delete_post_meta($post_id,'cpm_map');
|
117 |
|
118 |
$new_cpm_point = ( isset( $_POST['cpm_point'] ) ) ? $_POST['cpm_point'] : array();
|
119 |
+
$new_cpm_map = array_map(array($this, 'sanitize_html'), $new_cpm_point);
|
120 |
$new_cpm_map = ( isset( $_POST['cpm_map'] ) ) ? $_POST['cpm_map'] : array();
|
121 |
+
$new_cpm_map = array_map('sanitize_text_field', $new_cpm_map);
|
122 |
+
|
123 |
$new_cpm_point['icon'] = str_replace( CPM_PLUGIN_URL, '', $default_icon );
|
124 |
|
125 |
// Set the map's config
|
857 |
{
|
858 |
if( !wp_script_is( 'jquery' ) )
|
859 |
{
|
860 |
+
print "<script src='".(is_ssl() ? "https" : "http")."://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'></script>";
|
861 |
}
|
862 |
|
863 |
print "<link rel='stylesheet' id='cpm_style-css' href='".CPM_PLUGIN_URL.'/styles/cpm-styles.css'."' type='text/css' media='all' />";
|
897 |
// Check if post exists and save the configuraton options
|
898 |
if (isset($_POST['cpm_map_noncename']) && wp_verify_nonce($_POST['cpm_map_noncename'],__FILE__)){
|
899 |
$options = $_POST['cpm_map'];
|
900 |
+
$options = array_map('sanitize_text_field', $options);
|
901 |
+
$options['drag_map'] = ( isset( $options[ 'drag_map' ] ) ) ? true : false;
|
902 |
$options['windowhtml'] = $this->get_configuration_option('windowhtml');
|
903 |
update_option('cpm_config', $options);
|
904 |
update_option('cpm_load_resources_in_footer', (isset($_POST['cpm_load_resources_in_footer'])) ? true : false);
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: codepeople
|
|
3 |
Donate link: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
|
4 |
Tags:google maps,maps,marker,gmap,places,shortcode,map,categories,post map,point,location,address,images,geocoder,google,shape,list,grouping,cluster,infowindow,route,pin,streetview,post,posts,pages,widget,image,exif tag,plugin,sidebar,stylize,admin
|
5 |
Requires at least: 3.0.5
|
6 |
-
Tested up to: 5.
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -517,6 +517,10 @@ Now the most important part create the shape's area. To create the shape's area
|
|
517 |
|
518 |
== Changelog ==
|
519 |
|
|
|
|
|
|
|
|
|
520 |
= 1.0.22 =
|
521 |
|
522 |
* Modifies the blocks for the Gutenberg editor, preparing the plugin for WordPress 5.1
|
3 |
Donate link: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
|
4 |
Tags:google maps,maps,marker,gmap,places,shortcode,map,categories,post map,point,location,address,images,geocoder,google,shape,list,grouping,cluster,infowindow,route,pin,streetview,post,posts,pages,widget,image,exif tag,plugin,sidebar,stylize,admin
|
5 |
Requires at least: 3.0.5
|
6 |
+
Tested up to: 5.2
|
7 |
Stable tag: trunk
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
517 |
|
518 |
== Changelog ==
|
519 |
|
520 |
+
= 1.0.23 =
|
521 |
+
|
522 |
+
* Improves the plugin performance and the maps generation.
|
523 |
+
|
524 |
= 1.0.22 =
|
525 |
|
526 |
* Modifies the blocks for the Gutenberg editor, preparing the plugin for WordPress 5.1
|