diff --git a/classes/import-export.php b/classes/import-export.php index b0818e6..7380073 100644 --- a/classes/import-export.php +++ b/classes/import-export.php @@ -524,10 +524,8 @@ public function do_csv_preview() { global $simple_map, $blog_id; $options = $simple_map->get_options(); - /* if ( !isset( $options['api_key'] ) ) $options['api_key'] = ''; - */ extract( $options ); @@ -697,10 +695,8 @@ public function print_page() { global $simple_map; $options = $simple_map->get_options(); - /* if ( !isset( $options['api_key'] ) ) $options['api_key'] = ''; - */ extract( $options ); @@ -810,9 +806,9 @@ public function print_page() { value="'; _e( 'Import CSV File', 'SimpleMap' ); echo '"/>'; - /* if ( '' == $options['api_key'] ) : ?> + if ( '' == $options['api_key'] ) : ?> API key if you need your locaitons geocoded.", 'SimpleMap' ), admin_url( "admin.php?page=simplemap" ) ); ?> - diff --git a/classes/locations.php b/classes/locations.php index 4e56e51..47e3882 100644 --- a/classes/locations.php +++ b/classes/locations.php @@ -633,7 +633,7 @@ function save_post_meta( $post ) { $options = $simple_map->get_options(); $post_object = get_post( $post ); - //$api_key = ( isset( $options['api_key'] ) && !empty( $options['api_key'] ) ) ? $options['api_key'] : ''; + $api_key = ( isset( $options['api_key'] ) && !empty( $options['api_key'] ) ) ? $options['api_key'] : ''; // Grab old data. $location_address = get_post_meta( $post, 'location_address', true ) ?: ' '; diff --git a/classes/options-general.php b/classes/options-general.php index a13823c..33c9305 100644 --- a/classes/options-general.php +++ b/classes/options-general.php @@ -68,7 +68,7 @@ function update_options() { $new_options = $options; // Validate POST Options - //$new_options['api_key'] = ( ! empty( $_POST['api_key'] ) ) ? $_POST['api_key'] : ''; + $new_options['api_key'] = ( ! empty( $_POST['api_key'] ) ) ? $_POST['api_key'] : ''; $new_options['map_width'] = ( ! empty( $_POST['map_width'] ) ) ? $_POST['map_width'] : $options['map_width']; $new_options['map_height'] = ( ! empty( $_POST['map_height'] ) ) ? $_POST['map_height'] : $options['map_height']; $new_options['default_lat'] = ( ! empty( $_POST['default_lat'] ) ) ? $_POST['default_lat'] : $options['default_lat']; @@ -401,16 +401,14 @@ function print_page() {
- - */ ?> - ID, array( 'jquery' ) ); - // Google API v3 does not need a key. + // Google API v3 now requires an API key. $url_params = array( - 'sensor' => 'false', + 'key' => $options['api_key'], 'v' => '3', 'language' => $options['default_language'], 'region' => $options['default_country'], @@ -671,10 +671,10 @@ function enqueue_backend_scripts_styles() { wp_enqueue_script( 'simplemap-general-options-js', get_home_url() . '/?simplemap-general-options-js', array( 'jquery' ) ); } - // Google API v3 does not need a key. + // Google API v3 not requires and API key. $url_params = array( 'v' => '3', - 'sensor' => 'false', + 'key' => $options['api_key'], 'language' => $options['default_language'], 'region' => $options['default_country'], ); @@ -792,13 +792,11 @@ function load_simplemap( lat, lng, aspid, ascid, asma, shortcode_zoom_level, map zoom_level = shortcode_zoom_level; autoload = shortcode_autoload; jQuery( "#simplemap" ).html( "

General Settings before your maps will work.', 'SimpleMap' ), admin_url( 'admin.php?page=simplemap' ) ); ?>

" ); @@ -1800,7 +1798,7 @@ function get_options() { 'adsense_pub_id' => '', 'adsense_channel_id' => '', 'adsense_max_ads' => 2, - // 'api_key' => '', + 'api_key' => '', 'auto_locate' => '', 'taxonomies' => array( 'sm-category' => $this->get_taxonomy_settings( 'sm-category' ), @@ -2317,10 +2315,8 @@ function show_toolbar( $title = '' ) {

- get_api_link() . '">', ''); ?> + get_api_link() . '" target="_blank">', ''); ?>

' . __( 'You must enter an API key for your domain.', 'SimpleMap' ).' ' . __( 'Enter a key on the General Options page.', 'SimpleMap' ) . '

'; - */ } /** @@ -2343,6 +2339,10 @@ function get_search_radii() { * @return string */ function get_api_link() { + + // The old URLs seem to be outdated. Not sure about the international ones. + return 'https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key'; + $lo = str_replace( '_', '-', get_locale() ); $l = substr( $lo, 0, 2 ); switch ( $l ) { diff --git a/readme.txt b/readme.txt index 02236f3..348bd5d 100644 --- a/readme.txt +++ b/readme.txt @@ -4,8 +4,8 @@ Contributors: hallsofmontezuma, fullthrottledevelopment Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mrtorbert%40gmail%2ecom&item_name=SimpleMap&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8 Tags: map, maps, store locator, database, locations, stores, Google maps, locator Requires at least: 2.8 -Tested up to: 4.5 -Stable tag: 2.4.9 +Tested up to: 4.5.3 +Stable tag: 2.4.10 SimpleMap is an easy-to-use international store locator plugin that uses Google Maps to display information directly on your WordPress site. @@ -53,6 +53,7 @@ With SimpleMap, you can easily put a store locator on your WordPress site in sec You must have: +* A free Google Maps API key * WordPress 2.8 or later * PHP 5 (or PHP 4 with the SimpleXML extension loaded), DOMDocument class @@ -82,6 +83,10 @@ Please open a ticket on [the SimpleMap project's repo on Github](https://github. == Changelog == += 2.4.10 = + +* Important Update! Google now requires a (free) API key. Update, get an API key, and enter it into your settings. + = 2.4.9 = This release has a lot on under the hood performance improvements, code optimizations, lots of small bugfixes, etc, including: diff --git a/simplemap.php b/simplemap.php index dccc748..9e720b9 100644 --- a/simplemap.php +++ b/simplemap.php @@ -1,7 +1,7 @@