Plugin Directory

Changeset 2072655


Ignore:
Timestamp:
04/22/2019 03:30:26 PM (7 years ago)
Author:
andrew.taylor
Message:

Version 1.5.3

Location:
embed-gutenberg-block-google-maps/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • embed-gutenberg-block-google-maps/trunk/embed-gutenberg-block-google-maps.php

    r2054291 r2072655  
    55 * Author: Pantheon, Andrew Taylor
    66 * Author URI: https://pantheon.io/
    7  * Version: 1.5.2
     7 * Version: 1.5.3
    88 * License: MIT
    99 * License URI: https://opensource.org/licenses/MIT
     
    128128    $apiURL = ( $interactive ) ? "https://www.google.com/maps/embed/v1/place?key=${APIkey}&q=${location}&zoom=${zoom}&maptype=${mapType}" : "https://maps.googleapis.com/maps/api/staticmap?center=${location}&zoom=${zoom}&size=${maxWidth}x${maxHeight}&maptype=${mapType}&key=${APIkey}";
    129129
    130     // Look for a cached response code for the map URL.
    131     $httpcode = get_transient( 'pantheon_google_map_block_url_response_code' );
    132 
    133     // Ensure the status code from cache is an integer.
    134     if( false !== $httpcode ) {
    135         $httpcode = intval( $httpcode );
    136     }
    137 
    138     // If the response code is not found in the cache
    139     // Or the current response code is not a 200
    140     if( false === $httpcode || $httpcode !== 200 ) {
    141         // Get a new response code for the map URL
    142         $response = wp_remote_head( $apiURL );
    143         $httpcode = wp_remote_retrieve_response_code( $response );
    144         // Set a transient to cache the response code.
    145         set_transient( 'pantheon_google_map_block_url_response_code', $httpcode, DAY_IN_SECONDS );
    146     }
    147 
    148     // Don't output anything if the response from Google Maps isn't a 200.
    149     if( $httpcode !== 200 ){
    150         return;
    151     }
    152 
    153130    // Set the appropriate CSS class names
    154131    $classNames = ( $interactive ) ? "wp-block-pantheon-google-map interactive ratio$aspectRatio" : "wp-block-pantheon-google-map";
  • embed-gutenberg-block-google-maps/trunk/readme.txt

    r2054291 r2072655  
    77Tested up to: 5.1.1
    88Requires PHP: 5.6
    9 Stable tag: 1.5.2
     9Stable tag: 1.5.3
    1010License: MIT
    1111License URI: https://opensource.org/licenses/MIT
     
    6767
    6868== Changelog ==
     69
     70= 1.5.3 =
     71Remove the server-side check for a valid Google Maps URL as it was failing and preventing the map from rendering in some environments. If an invalid Google Maps API key is provided, an error message from Google Maps will be rendered on the page.
    6972
    7073= 1.5.2 =
Note: See TracChangeset for help on using the changeset viewer.