8 posts
  • Has been part of the Envato Community for over 1 year
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
Dvaeer says

Developing my first Wordpress theme I’d like to include an options panel with the ability to choose any Google font. I went through the process of signing up for a Google API key for this, but am unsure whether there is a cost involved for this. Google seem to suggest they charge for use of their service through an API key, but it’s not clear to me. Would there be anyone who can give me an insight into this?

Many thanks

1770 posts Don't Worry, Be Happy
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Located in United States
  • Made it to the Authors' Hall of Fame
+8 more
FinalDestiny says

Uhm, no, you have quite a big number of requests you can make daily. Also I’d recommend you asking the users to put their own api key instead of using your own for all the users

8 posts
  • Has been part of the Envato Community for over 1 year
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
Dvaeer says

Thank you! So basically: don’t worry, be happy :)

What if I want to keep it simple for my users and not bother them with API keys? I guess that theoretically I could exceed the amount of daily requests, but in practise would that happen?

Thanks again

1770 posts Don't Worry, Be Happy
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Located in United States
  • Made it to the Authors' Hall of Fame
+8 more
FinalDestiny says

If you’ll add a payment method, it may get you money from there. If not, it will probably return an error saying that you exceeded the max. number of requests on that day

8 posts
  • Has been part of the Envato Community for over 1 year
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
Dvaeer says

That makes total sense. Thanks very much for your insight, much appreciated.

1476 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
OriginalEXE says

Why don’t you just pull an array of available fonts and store it locally, and then you can update the list with each theme update.

That way you don’t have to worry about external requests or api keys.

3542 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

^ +1

You should never create an app that uses an API like this and include it in a theme which you distribute to the masses. The application is yours only, you cannot distribute the details to your buyers. (i’m 99% sure that this is a rejection reason)

A static list is the best way to go in this case and you’ll upload it from time to time (i update my lists only once a year – nobody dies if the latest font is not available in your theme).

Here’s a serialized array with the latest fonts (can be used with the Theme Customizer): http://pastebin.com/uVAzxgZP

Here’s how to use the list: http://pastebin.com/cUptxCqF

(the chunks of code are not exact, you need to know what you’re doing:)

8 posts
  • Has been part of the Envato Community for over 1 year
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
Dvaeer says

Why don’t you just pull an array of available fonts and store it locally, and then you can update the list with each theme update. That way you don’t have to worry about external requests or api keys.

^ +1 You should never create an app that uses an API like this and include it in a theme which you distribute to the masses. The application is yours only, you cannot distribute the details to your buyers. (i’m 99% sure that this is a rejection reason)

Thank you very much for your thoughts on this. I’d like to consider your option, but I’m committed to using the Redux options framework, which requires a Google API key to add google fonts to their typography module.

Many themes I’ve come across incorporate the Redux options framework with a Google API key, for example the freely available Shoestrap theme.

Ruben, you seem to suggest this is not good practise, but do you feel I should really steer away from this approach?

By the way, thank you very much for your detailed answer with practical example, great stuff!

Thanks again

3542 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

Ruben, you seem to suggest this is not good practise, but do you feel I should really steer away from this approach?

Maybe i don’t understand how this works, but if you implement it in a theme, wouldn’t this theme be then sold to many? And if it’s a best seller wouldn’t 3000 people all use your API? That’s my question – it’s your API, not theirs, and again, i bet that you’re not allowed to use approaches like this in commercial themes on TF. You can ask staff, but it’s a bad practice to give your API keys to thousands of people.

Or maybe i don’t really understand what you’re doing..

535 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Located in Slovakia
+3 more
LubosVolovar says

Check this link

by
by
by
by
by
by