• Resolved Adam Patterson

    (@adampatterson)


    This is a fresh install of the plugin on the most recent version of WordPress.

    I entered my browser key after updating the website restrictions and waiting a while, I hit test and get the following errors in the console.

    “You are using this API without a key.” and “Geocoding Service: You must use an API key to authenticate each request to Google Maps Platform APIs.”

    When I look in the source code, I don’t see the key anywhere.

    Any ideas?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    It could be there’s another script stripping away script parameters ( some security plugins do this ). If you for a second disable all other plugins does it then still not show up?

    Are you comfortable with code?

    Thread Starter Adam Patterson

    (@adampatterson)

    Think it could be ad blocker?

    I will try turning everything else off.

    And sure.

    Thread Starter Adam Patterson

    (@adampatterson)

    So interestingly enough it’s an issue with my theme.

    Do you have an easy list of the filters and hooks that you used?

    It’s only the browser key, server key works fine.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Try to add this code to the functions.php inside your active theme folder, and see if that fixes it.

    Replace ‘your browser key’ with your actual key.

    
    add_filter( 'wpsl_gmap_api_params', 'custom_gmap_api_params' );
    
    function custom_gmap_api_params( $api_params ) {
    
        $api_params = $api_params .'&key=your browser key';
    
        return $api_params;
    }
    
    Thread Starter Adam Patterson

    (@adampatterson)

    I tried that with no luck, I also dumped api_params and it was already there.

    I will dig through my theme and see where the conflict might be.

    My theme is OOP so it shouldn’t be a naming conflict.

    Thread Starter Adam Patterson

    (@adampatterson)

    Alright, I had a function that removed version strings from files because I use Webpack versioning.

    It was clearing the API key off of the plugin.

    Everything works now ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Geocoding Service: You must use an API key’ is closed to new replies.