View Categories

How to calculate nutritional values automatically?

YouTube video

The Automatic Nutrition Calculator feature in the WP Delicious Pro plugin allows bloggers to automatically calculate and display nutritional facts based on the ingredients used in their recipes. This guide will help you understand how to configure and use this feature.

Accessing the Nutrition Calculator Settings #

  1. Log in to your WordPress Dashboard.
  2. Navigate to the WP Delicious Plugin Settings:
    • From the Dashboard, go to WP Delicious in the left-hand menu.
    • Click on Settings under WP Delicious.
    • Select the Recipe Settings > Nutrition tab to access the Auto Nutrition Calculator Settings.

How to get an API Key for the Edamam Nutrition Calculator #

After enabling the feature, you need to sign up and achieve the Application ID and Application Key for the Nutrition Analysis API. To get the API keys, click here.

You can select the package as per your requirement and sign up to get the API keys.

After subscribing to the appropriate package, click on the Signup AP button located in the top right corner.

Click on the button, and a popup form will appear, enter the details and click on the Submit button.

Once signed up, go to your account dashboard, under the Applications tab you will find the Nutrition Analysis API. Click on the View button to see the Application ID and Application Key.

Now go back to your website dashboard and enter the Application ID and Application Key in the respective field and save the changes.

How to get an API Key for the Spoonacular Nutrition Calculator #

If you have chosen the Spoonacular Nutrition Analysis API, you need to sign up and achieve the Application Key for the Nutrition Analysis API.

You can select the package as per your requirement and click on Get Started.

You will be directed to a signup form. Add necessary details and create an account.

Once signed up, go to your account dashboard, under the Profile & API key, you will find the Spoonacular API. Click on the View button to see the Application Key.

Now go back to your website dashboard and enter the Application Key in the respective field and save the changes.

Using the Nutrition Calculator in Recipes #

After configuring the feature in the plugin settings, you will see the button Automatically Calculate Nutrition Values in the editor Recipe Settings under the Nutrition tab.

Click on the Auto Calculate Nutrition Values button. This will open a popup that will show all the ingredients used in the recipe, click on the Calculate Nutrition button to calculate the nutritional values from the ingredients.

Finally, click on the Apply Calculated Values button to apply these values to your recipe post.

Save the changes and publish your recipe post, the nutrition

Auto Ingredients Translation Settings #

Overview #

The Automatic Nutrition Calculator feature allows users to calculate the nutritional values of a recipe based on the ingredients listed in the recipe post. Previously, this feature only worked when the ingredients were written in English.

Now, with the integration of the Google Translate API, ingredients written in other languages are automatically translated into English before calculating the nutritional values. This ensures accurate nutritional calculations for all recipes, regardless of the language used.

Enabling the Automatic Nutrition Calculator #

To use this feature, follow these steps:

  1. Navigate to Plugin Settings:
    • Go to Dashboard > WP Delicious > SettingsClick on the Recipe Settings tabLocate the Nutrition section
  1. Enable the Automatic Nutrition Calculator:
    • Find the toggle labeled Automatic Nutrition Calculator and switch it ON

Configuring Google Translate API Key #

Once the Automatic Nutrition Calculator is enabled, an option to add a Google Translate API Key will appear.

Steps to Add the API Key: #

  1. Obtain a Google Translate API Key:
    • Visit Google Cloud Console
    • Create a new project or select an existing one
    • Enable the Google Translate API
    • Generate an API key and copy it
  2. Enter the API Key in Plugin Settings:
    • In the Nutrition section, find the field labeled Google Translate API KeyPaste the copied API key into the field
  3. Save Changes:
    • Click the Save Changes button to apply the settings

How It Works #

  • When a recipe is created or updated in any language other than the English language.
  • The ingredients can be checked and translated accordingly into the English language.
  • The translated ingredient list is then used to calculate the nutritional values.
  • The calculated nutritional information is displayed on the recipe post.

Summary #

The Automatic Nutrition Calculator with Ingredient Translation enhances recipe nutrition calculation by allowing multi-language ingredient support through Google Translate API integration. Once set up, users can seamlessly calculate nutritional values regardless of the language used in their recipes.