WordPress.org

Ready to get started?Download WordPress

Forums

Google Webfonts For Woo Framework
[resolved] Receiving API error (15 posts)

  1. jordanbower
    Member
    Posted 1 year ago #

    Hi, I've installed this plugin version 1.2.1 and have double and triple and quadruple checked my API code. However, I am receiving the error: "Cannot access Google Webfonts. Check your API key. Using fallback font list instead."

    I have used this plugin on several sites without a problem. What could have gone wrong?

    The site URL is http://www.discoverthepast.com

    Best wishes,
    Jordan.

    http://wordpress.org/plugins/google-fonts-for-woo-framework/

  2. Jason Judge
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. neil_melbourne
    Member
    Posted 1 year ago #

    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.

  4. Jason Judge
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  5. Jason Judge
    Member
    Plugin Author

    Posted 1 year ago #

    Found a bug in getFallbackFonts():

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

    Should have read font_data. A classic typo.

  6. Jason Judge
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  7. jordanbower
    Member
    Posted 1 year ago #

    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

  8. Jason Judge
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  9. Jason Judge
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  10. neil_melbourne
    Member
    Posted 1 year ago #

    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.

  11. Jason Judge
    Member
    Plugin Author

    Posted 1 year ago #

    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?)

  12. Dan Knauss
    Member
    Posted 1 year ago #

    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"
    }
    }

  13. Jason Judge
    Member
    Plugin Author

    Posted 1 year ago #

    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:

    http://code.garyjones.co.uk/google-developer-api-key

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

  14. Dan Knauss
    Member
    Posted 1 year ago #

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

  15. Jason Judge
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.