• Resolved AMX

    (@lightscapes)


    Every several page loads I get an error message: “Oops! Something went wrong.
    This page didn’t load Google Maps correctly. See the JavaScript console for technical details.”

    So, I checked the console and it reads:

    “You have exceeded your daily request quota for this API. We recommend enabling billing to get a higher quota: ” But I am sure I am not getting 25,000 loads daily. No way.

    The console also shows an API Key and it is not mine and definitely not the one I entered in options. My API key works with maps in Avada Theme.

    The one that the console shows:

    “js?libraries=places%2Cgeometry&v=3.exp&key=……………X3t7z-9IOOjis&ver=13f264a8833d…:2 You have exceeded your daily request quota for this API. We recommend enabling billing to get a higher quota”

    this API key is also found in the plugin’s wd-google-maps/google-maps-setup.php file, so it seems my API key is not saved where it should be saved, even though it looks like saved in plugin’s options.

    It seems I am using your default API key, sometimes the map will load, sometimes the quota will be exceeded.

    Please help, otherwise I like the plugins functionality but if it doesn’t work I will have to install an alternative.

    • This topic was modified 8 years, 2 months ago by AMX.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Sona

    (@support-web-dorado)

    @lightscapes,

    You might be using maps both with theme and the plugin causing the mentioned issue. Could you please contact using the form?

    The issue is within the function gmwd_get_option

    if($page == "markers_gmwd" || $page == "circles_gmwd" || $page == "maps_gmwd" || $page == "polygons_gmwd" || $page == "polylines_gmwd" || $page == "rectangles_gmwd" || $page == "markercategories_gmwd" || $page == "themes_gmwd" || $page == "options_gmwd" || $page == "uninstal_gmwd"){

    This is preventing the plugin from pulling the API KEY properly on the frontend. The API KEY becomes “false” causing the plugin to load from 4 random Google API keys that are over quota limits.

    • This reply was modified 8 years, 2 months ago by mshihinski. Reason: typos
    Sona

    (@support-web-dorado)

    @mshihinski,

    Those 4 keys are all default keys coming with the plugin. The user should generate his/her own key for the website and use it instead. The stated function allows randomly using one of the existing keys before providing your own, not to keep them. Thanks.

    @support-web-dorado

    If you review your plugin’s code that I referenced previously, you will see that even if a user has a saved API key, it is not used. The code above prevents the API key from being pulled out of the database. A value of false is always pulled from the gmwd_get_option function in your plugin. This causes the plugin to always use the random API keys instead of the saved API key in the database. The issue is new.

    • This reply was modified 8 years, 2 months ago by mshihinski.
    • This reply was modified 8 years, 2 months ago by mshihinski.
    Thread Starter AMX

    (@lightscapes)

    I deleted the API key from the map in Avada theme and deactivated other map plugins. It didn’t help.

    I installed another map plugin and it seems to work without issues for now.
    I liked your plugin and its interface, but I can’t spend much time troubleshooting maps.

    I am not a developer, but I don’t understand the point of having those provided API keys in the plugin code. Every webmaster should get their own API key from Google. Other solutions cannot work and will not work after the quota is exceeded, so why even bother with those default keys? Webmaster’s own key must be saved and then pulled, and that is all.

    @support-web-dorado

    More information is provided for this issue below:

    Until the framework/functions.php file is fixed, this plugin will not work.

    Original code:

    
    function gmwd_get_option($option_name){
        global $wpdb;
    	$page = isset($_GET["page"]) ? $_GET["page"] : "";
    	
    	if($page == "markers_gmwd" || $page == "circles_gmwd" || $page == "maps_gmwd"  || $page == "polygons_gmwd" || $page == "polylines_gmwd" || $page == "rectangles_gmwd" || $page == "markercategories_gmwd" || $page == "themes_gmwd" || $page == "options_gmwd" || $page == "uninstal_gmwd"){
    		$query = "SELECT * FROM ". $wpdb->prefix . "gmwd_options ";
    		$rows = $wpdb->get_results($query);	
    
    		$options = new stdClass();
    		foreach ($rows as $row) {
    			$name = $row->name;
    			$value = $row->value !== "" ? $row->value : $row->default_value;
    			$options->$name = $value;
    		}
    		
    		return $options->$option_name;
    	}
    	return false;
    }

    Updated code:

    function gmwd_get_option($option_name){
        global $wpdb;
    
        $query = "SELECT * FROM ". $wpdb->prefix . "gmwd_options ";
        $rows = $wpdb->get_results($query);	
    
        $options = new stdClass();
        foreach ($rows as $row) {
            $name = $row->name;
            $value = $row->value !== "" ? $row->value : $row->default_value;
            $options->$name = $value;
        }
    
        return $options->$option_name;
    }

    I have applied this patch to my websites using this plugin and the the maps now work without displaying the over quota error message in the JavaScript console. By limiting the gmwd_get_option function to only return results for the admin sections of the plugin, you are preventing the frontend display from pulling the user saved API key.

    @mshihinski Thank you very much for the fix.. It seems that their support is sleeping while thousand of people using their plugin struggle to find out why this is not working… If I didn’t need their plugin so much, i would have already uninstalled it.. But I will leave the proper feedback ??
    Thanks again!

    Sona

    (@support-web-dorado)

    Dear users,

    The issue is present only with the last update, we have prepared and will today release an update which fixes the issue. Thanks for your understanding.

    Yes but it took you soooo long to recognize the problem and respond to it that is not acceptable.. At least it will be solved!

    @mernion

    You’re welcome.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘API Key not saved’ is closed to new replies.