WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Receiving API error

[Resolved] Receiving API error

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Jason Judge

    @judgej

    The fallback list should be up-to-date right now, so you won’t be missing any fonts.

    I won’t be able to loo at this until next week (start of August) and will look at it then. In the meantime, could you give me some further details about your instance: PHP version, web server, operating system. If you are happy to send me a copy of your API key to try (by private mail), I can look at it from that end.

    Same error message for me, using Woothemes one-pager theme. Theme lists as including 290 fonts from the 652 available Google webfonts. The one I wanted to add was Alfa Slab One. Trying to use the Simple API Access Key I generated. Interested if you resolved the issue above? Thanks.

    Plugin Author Jason Judge

    @judgej

    If your Google API key is not working, then the plugin should fall back to the built-in list, and that does include “Alfa Slab One” (standard weight and style only). Is that working for you?

    It looks like two separate issues here: some API keys not working, and the fallback list not working when Google cannot be contacted. So just to be sure, are you having both of these issues? If you don’t put a Google API key in at all, do you not find “Alfa Slab One” available in the drop-down lists of fonts in the Woothemes theme?

    If you put the following into a post or page, do you see the font or not:

    [typography font="Alfa Slab One" size="24" size_format="px"]Test font[/typography]

    You can test your Google API key by putting it into a URL, like this:

    https://www.googleapis.com/webfonts/v1/webfonts?key=your-api-key-here

    You will either get an error, or a big list of font data.

    Plugin Author Jason Judge

    @judgej

    Found a bug in getFallbackFonts():

    if ( ! empty($font_date)) { ...

    Should have read font_data. A classic typo.

    Plugin Author Jason Judge

    @judgej

    v1.2.2 should now fix the font fallback issue.

    The Google API key can be tested with the URL given above. If the URL works, but the plugin still does not, then I would need further details of the specific setup that is failing.

    Let me know how this update goes.

    I received this error when trying to update:

    Call to a member function getFallbackFonts() on a non-object in /services2/webpages/d/i/discoverthepast.com/public/wp-content/plugins/google-fonts-for-woo-framework/google-webfonts-for-woo-framework.php on line 47

    Plugin Author Jason Judge

    @judgej

    I’ve not been able to reproduce that error myself, but have put in some safety measures to at least avoid the error if the object does not exist. I’ll release that shortly.

    Plugin Author Jason Judge

    @judgej

    Version 1.2.3 is released. It is programmed a little more defensively around the plugin activation code. I could not reproduce the error you saw, even with all debug options turned on, but fingers crossed, this should work.

    Thank you for your hard work Jason, all 652 Google fonts now appearing for me. I’m getting the “Cannot access Google Webfonts. Check your API key. Using fallback font list instead.” message when I check the Plugin settings.

    Plugin Author Jason Judge

    @judgej

    Cool – so you are purposely not using a valid API key, and the fallback is working as expected? Can this ticket be closed, or is there still an issue with the API key you are using (i.e. it should be working and *not* using the fallback?)

    I can’t get a new server key to work. Any idea why that might be?

    {
    “error”: {
    “errors”: [
    {
    “domain”: “usageLimits”,
    “reason”: “accessNotConfigured”,
    “message”: “Access Not Configured”
    }
    ],
    “code”: 403,
    “message”: “Access Not Configured”
    }
    }

    Plugin Author Jason Judge

    @judgej

    Once you have the API key, you need to separately tell Google that you want to use it for fonts. If you don’t, then it won’t be enabled for fetching fonts.

    There is a grep step-by-step guide here:

    Get a Google Developer API Key How to access the Web Fonts API

    The “accessNotConfigured” error leads me to believe that last step has not been done yet.

    I actually had enabled the Web Fonts API, but it seems to have taken a little while to kick in. Works now. Thanks!

    Plugin Author Jason Judge

    @judgej

    I’ll close this ticket, a I think we have covered the original issues.

    In the next release, I’ll add a “check your key” link on the settings page so you can see what is wrong with the API key if it does not work. The main problem with automating that is that there is no documentation (that I can find) on the format of the error data that Google returns, and I would rather not make any assumptions about it at this stage.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Resolved] Receiving API error’ is closed to new replies.