• Resolved Dfa327

    (@dfa327)


    Hello,

    I found a bug and a solution for your plugin. On some browsers you’ll get an error like this:

    The Google Maps API server rejected your request. The “sensor”
    parameter specified in the request must be set to either “true” or
    “false”.

    The problem is wordpress maps your amperand signs as #038. Google can’t understand the request and pops the error. I have the following fix in geo-my-wp.php where I just add a filter. Fix is in bold. Please consider adding it for future releases ?? :

    //if( is_multisite() ) $wppl_site_options = get_site_option('wppl_site_options');
    
    <strong>add_filter('clean_url', 'so_handle_038', 99, 3);
    function so_handle_038($url, $original_url, $_context) {
        if (strstr($url, "googleapis.com") !== false) {
            $url = str_replace("&", "&", $url); // or $url = $original_url
        }
    
        return $url;
    }</strong>
    
    // REGISTER STYLESHEET AND JAVASCRIPTS IN THE FRONT END//
    function gmw_register_cssjs_front_end() {

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    https://www.ads-software.com/plugins/geo-my-wp/

Viewing 1 replies (of 1 total)
  • Plugin Author Eyal Fitoussi

    (@ninjew)

    Thank you so much for that ??
    I remember two users that reported the error a while ago but they also got it fixed by doing something in their theme. I never got into this error so i never new what caused the issue.
    I will definitely add it to the update i am currently working on.

    Thank you
    Eyal

Viewing 1 replies (of 1 total)
  • The topic ‘Google Maps Server Rejected your request (Proposed fix)’ is closed to new replies.