Calorie Calculator Pro

Calorie Calculator Pro Documentations

Product setup, settings, embeds, webhooks, and developer hooks — maintained with the plugin so theme changes do not remove this guide.

Overview

Overview

Calorie Calculator Pro estimates daily calorie needs and offers simple guidelines for weight loss or gain. Visitors enter age, gender, height, weight, activity level, and optionally body fat. Results include BMI, basal BMR, TDEE (maintain), optional macronutrient splits, and calorie targets for losing or gaining weight.

What Pro adds

  • PDF download and branded email results (customisable subject and body)
  • Macros and configurable goals
  • One-screen or multi-step form flows
  • Lead capture / calculator logs
  • Mailchimp, ConvertKit, and HubSpot
  • Foods and exercises tables (with CSV import/export)
  • Google reCAPTCHA v3
  • Outbound webhook (Zapier / Make / n8n)
  • Suggested day plan from your food & exercise libraries
  • Labels — override visitor-facing calculator wording without editing language files
  • Tools — copyable system info, plus settings export / import / restore defaults
  • Block editor and Elementor widgets
  • Developer actions, filters, and front-end events
  • Translation-ready (gettext + /languages; regenerate with bin/update-translations.sh)

Default formulas

By default, calculations use the Mifflin–St Jeor equation. You can choose Revised Harris–Benedict under Formula & goals. If the visitor enters body fat percentage, Pro uses the Katch–McArdle equation.

Results are for general wellness education. They are not medical advice.

Installation

Installation

  1. Upload and activate calorie-calculator-pro.zip via Plugins → Add New → Upload.
  2. If the Free plugin is already installed, Pro deactivates Free on activation — Free is not required alongside Pro.
  3. Licensing and updates are handled by Freemius (Account / licence screens in wp-admin). There is no separate “License” settings tab.
  4. Add the calculator with a block, Elementor widget, shortcode, or classic widget.

How to place the calculator

  1. Block editor: insert the Calorie Calculator block (and Foods / Exercises blocks if needed).
  2. Elementor: use the Calorie Calculator widgets.
  3. Embed tab: generate shortcodes from Calorie Calculator → Embed.
  4. Choose units (US, Metric, or both) and a style: Modern, Card, Plain, or Classic.
  5. Optionally enable name/email fields, PDF, email results, GDPR consent, result-delivery modes, and ESP tools.
  6. Site-wide layout, font size, and brand colours live under Look & feel.

Settings map

Settings map

All plugin settings live under Calorie Calculator in wp-admin.

TabPurpose
Getting startedQuick links into the rest of the settings
EmbedShortcode builder and copy helpers
Look & feelDefault layout, form flow, font size, brand colours
Formula & goalsBMR formula, macros, activities, goals, goal display, hide 1 kg / 2 lb line, suggested day plan
BehaviourPrivacy, validation, logging
LabelsOverride visitor-facing calculator wording (form, buttons, results, day planner, messages)
IntegrationsMailing lists (Mailchimp, ConvertKit, HubSpot) and Webhook & security (outbound webhook, reCAPTCHA v3)
EmailResult delivery default, admin notify, result email templates / from address
Foods & exercisesFoods and Exercises CSV import / export
ToolsSystem info report, settings export / import / restore defaults
AboutVersion and licence links

Labels

On Labels, leave a field empty to keep the translated default for the site language. A saved override pins that text for every visitor (it will not switch with locale until you reset it). Consent checkbox and metric validation messages live here; Behaviour still controls the related toggles. Overrides are stored as label_overrides and are included in Tools export/import (and cleared by restore defaults).

Suggested day plan

Under Formula & goals, enable Show a suggested day plan in calculator results when you want the “Suggest day plan” control after a calculation. It is off by default so sites without a populated Foods/Exercises library are not surprised. Shortcodes and blocks can override with show_day_planner="true" or "false".

Shortcodes & embeds

Shortcodes & embeds

Generate shortcodes from Calorie Calculator → Embed, or use the tags below.

This documentation hub renders shortcode examples as text. You do not need double brackets here.

Main calculator

[calorie_calculator]

In PHP/themes:

echo do_shortcode( '[calorie_calculator]' );

Main attributes

AttributeValuesDefault
unitusunit / metricunit / bothboth
templategeneral / bootstrap-general / plain / classic (aliases: old, legacy)Look & feel default, else general
send_to_emailtrue / falsetrue
download_as_pdftrue / falsetrue
show_name_fieldtrue / falsetrue
show_email_fieldtrue / falsetrue
show_firstname_onlytrue / falsefalse
hide_body_fat_fieldtrue / falsefalse
show_gdpr_consenttrue / falsetrue
result_deliveryinstant / email_required / bothSite default
goal_uilines / dropdownSite default
form_flowone_screen / multi_stepSite default (Pro)
show_day_plannertrue / false / inheritSite setting
macro_protein_pctnumber30
macro_carb_pctnumber40
macro_fat_pctnumber30

Example

[calorie_calculator download_as_pdf="false" unit="usunit" result_delivery="email_required" goal_ui="dropdown"]

Foods table

[calorie_calculator_foods_table]

Attributes: template, heading, info.

Exercises table

[calorie_calculator_calorie_burning_table]

Attributes: template, heading, info.

Block & Elementor

The block and Elementor widgets use the same attribute resolution as the shortcode. Prefer those editors when you want a visual UI; use shortcodes for classic content or page builders that paste tags.

Result delivery

Result delivery

Control how calorie numbers are shown after submit. Set a site default under Email → Default result delivery, or override per embed (result_delivery attribute / block control).

ModeBehaviour
instantShow results on screen immediately (default; matches older sites)
email_requiredHide calorie numbers until the visitor submits email, then reveal and send email
bothShow on screen; email remains optional

Tips

  • email_required forces the email field path so visitors can unlock results.
  • Logging, webhooks, and ESP sync still follow Behaviour / Integrations settings.
  • Front-end developers can listen for calcal:result_shown (see Developer hooks).

Suggested day plan

Suggested day plan

After a calculation, Pro can show Suggest day plan — illustrative food and exercise ideas drawn from your published Foods and Exercises libraries.

Enable it

  1. Add and publish foods/exercises (or import CSV from Foods & exercises).
  2. Open Formula & goals.
  3. Tick Show a suggested day plan in calculator results.
  4. Optionally set Exercise burn target (kcal).

Per-embed override:

[calorie_calculator show_day_planner="true"]

Notes

  • Suggestions are illustrative, not a medical meal plan.
  • The feature is disabled by default so empty libraries do not produce a weak first impression.
  • Logged-in visitors can remember preferred foods/exercises when that UI is shown.

Webhooks

Webhooks

Send each successful calculator log to Zapier, Make, n8n, or any HTTPS endpoint.

Setup

  1. Open Calorie Calculator → Integrations → Webhook & security.
  2. Enable Outbound webhook and paste your Catch Hook URL.
  3. Optional: set a shared secret (sent as the X-Calcal-Secret header).
  4. On each successful log create, Pro POSTs JSON. Failures are written to the PHP error log and do not block the visitor.

Payload shape

Typical fields include:

  • event — calorie_calculator.lead
  • site, timestamp
  • log_id, user_id (when logged in)
  • first_name, last_name, email
  • age, gender, height, weight, activity_factor, unit, body_fat
  • tdee, basal_bmr, bmi, bmi_category, macros, formula_used

Customise in PHP

add_filter( 'calcal_webhook_payload', function ( $body, $payload ) {
    $body['source'] = 'calorie-calculator-pro';
    return $body;
}, 10, 2 );

See Developer hooks for calcal_lead_created if you prefer a custom CRM push instead of (or in addition to) the HTTP webhook.

Email integrations

Email integrations

Pro can sync leads to Mailchimp, ConvertKit, and/or HubSpot when a visitor provides an email (and GDPR consent when you require it).

Setup

  1. Open Calorie Calculator → Integrations → Mailing lists.
  2. Enter credentials for the services you use.
  3. Enable Show name and Show email on the calculator embed so details can be collected.

Behaviour notes

  • Failures are logged server-side and never block the visitor flow.
  • Privacy consent is enforced when Behaviour → Require privacy consent is on.
  • Developers can filter the lead payload with calcal_integrations_lead or run custom code on calcal_before_integrations / calcal_after_integrations.

Google reCAPTCHA v3

Configured under Integrations → Webhook & security.

  1. Enable reCAPTCHA v3 and save site key + secret key.
  2. When both keys are saved, reCAPTCHA protects saving results, emailing results, PDF download, and ESP subscription.
  3. The picture captcha on PDF download is hidden in favour of reCAPTCHA.
  4. Requests scoring below 0.5 are rejected.

Developer hooks

Calorie Calculator — developer hooks

Use these WordPress actions/filters and front-end events to extend Calorie Calculator (Pro and Free) from a theme or custom plugin without editing plugin files.

Prefix: calcal_ (PHP) and calcal: (JavaScript).

Calculation (BMR / TDEE) runs in the browser. PHP hooks cannot change the maths mid-calc; use JS events for that moment, or alter markup/email/PDF/leads on the server.

Quick start (PHP)

Place this in a custom plugin or your child theme’s functions.php:

add_action( 'calcal_lead_created', function ( $post_id, $meta, $form_data ) {
    // e.g. push to your CRM, Slack, or custom table.
    error_log( 'CalCal lead #' . (int) $post_id . ' email=' . ( $meta['email'] ?? '' ) );
}, 10, 3 );

add_filter( 'calcal_calculator_html', function ( $html, $atts ) {
    return '<div class="my-brand-wrap">' . $html . '</div>';
}, 10, 2 );

Calculator shortcode / embed

Fired for the [calorie_calculator] shortcode path (and Block / Elementor output that uses the same path).

HookTypeArgumentsNotes
calcal_calculator_attsfilter$atts, $user_atts, $contentAfter defaults / site settings are resolved, before enqueue + render.
calcal_before_calculatoraction$attsBefore template output.
calcal_calculator_htmlfilter$html, $attsAfter template render; return markup.
calcal_after_calculatoraction$atts, $htmlAfter HTML is filtered (shortcode still returns $html).

Pro only — table shortcodes

HookTypeArguments
calcal_foods_table_attsfilter$atts, $user_atts, $content
calcal_foods_table_htmlfilter$html, $atts
calcal_exercises_table_attsfilter$atts, $user_atts, $content
calcal_exercises_table_htmlfilter$html, $atts

Example — force metric units on every embed:

add_filter( 'calcal_calculator_atts', function ( $atts ) {
    $atts['unit'] = 'metric';
    return $atts;
} );

Leads / usage logs

When a visitor submits the calculator and logging is enabled, a private calculator_log post is stored.

HookTypeArgumentsNotes
calcal_lead_metafilter$meta, $form_dataSanitised meta before wp_insert_post. Return an array.
calcal_lead_createdaction$post_id, $meta, $form_dataAfter a successful log insert. Best place for custom CRM sync.

$meta typically includes: first_name, last_name, email, age, gender, height, weight, activity_factor, bmr (TDEE), basal_bmr, bmi, bmi_category, unit, and on Pro also macros, body_fat, formula_used, user_id when logged in.


Webhooks

HookTypeArgumentsNotes
calcal_webhook_payloadfilter$body_data, $payloadFull JSON body (includes event, site, timestamp + lead fields) before wp_remote_post.
add_filter( 'calcal_webhook_payload', function ( $body, $payload ) {
    $body['source'] = 'calorie-calculator';
    return $body;
}, 10, 2 );

Integrations (Pro)

ConvertKit / HubSpot dispatch (after log create, when email is present):

HookTypeArguments
calcal_integrations_leadfilter$lead, $meta, $post_id
calcal_before_integrationsaction$lead, $meta, $post_id
calcal_after_integrationsaction$lead, $meta, $post_id

$lead keys: email, first_name, last_name, consent.


Result email (Pro; Free has subject/body filters only)

HookTypeArgumentsNotes
calcal_email_contextfilter$context, $recipient, $person, $calc, $result_htmlToken map ({user_name}, {result}, …). Pro.
calcal_email_subjectfilter$subject, $context, $plugin
calcal_email_bodyfilter$body, $context, $pluginHTML body before wp_mail.
add_filter( 'calcal_email_subject', function ( $subject ) {
    return 'Your calorie plan from ' . get_bloginfo( 'name' );
} );

PDF download (Pro)

HookTypeArguments
calcal_pdf_filenamefilter$filename, $person_data, $calculator_data
calcal_pdf_person_datafilter$person_data, $calculator_data
calcal_pdf_messagefilter$message, $person_data, $calculator_data
calcal_pdf_generatedaction$file_url, $file_path, $person_data, $calculator_data

Filenames must end in .pdf (unsafe values fall back to a safe default).


Front-end JavaScript events

Events fire on document as both:

  • jQuery: jQuery( document ).on( 'calcal:…', function ( e, detail ) { … } );
  • Native: document.addEventListener( 'calcal:…', function ( e ) { console.log( e.detail ); } );
EventWhendetail (typical)
calcal:result_shownResults HTML displayed (or email-gated placeholder)shown, gated, formData, resultHtml (if shown), form, resultEl
calcal:lead_submittedAJAX log request succeededunit (us \metric), formData, form
calcal:form_clearedClear / resetform

Legacy (still fired): calcalpro_form_cleared (jQuery only; second argument is the jQuery form).

document.addEventListener( 'calcal:result_shown', function ( e ) {
    if ( ! e.detail || ! e.detail.shown ) {
        return;
    }
    // e.g. analytics, GTM dataLayer push
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push( { event: 'calcal_result', unit: e.detail.formData && e.detail.formData.unit } );
} );

Stability

  • Prefer the calcal_* / calcal: names above for new code.
  • Do not rely on Freemius SDK hooks (ccp_fs_loaded, $fs->…) for product features.
  • Hook signatures may gain extra trailing arguments in later versions; always declare the arity you need (add_action( …, 10, 3 )).

Tools & support

For system info and settings backup, see Calorie Calculator → Tools in wp-admin, or the Tools & support section of the documentation hub.

Product documentation: Calorie Calculator Pro documentations

Contact: wp.zubaer.com/contact

Tools & support

Tools & support

If something fails (PDF download, webhook, email, missing PHP extensions, or a licence issue), open Calorie Calculator → Tools.

  1. Review the System info checklist for anything marked Missing or Check.
  2. Click Copy system info (or copy from the plain-text box).
  3. Paste that report into your support email.

The report includes WordPress / PHP / plugin versions, theme, required PHP extensions, uploads writability, webhook host (not the secret), Freemius plan/licence status, and active plugins. It does not include licence keys, API keys, or webhook secrets.

The same Tools tab also has Settings backup (export, import, restore defaults).

Translations

Text domain: zubaer-calorie-calculator. Language files: /languages. For site-specific translations, Loco Translate or Poedit work well against the shipped .pot. Maintainers: run bin/update-translations.sh before each release so the template stays current.

To change visitor wording without a language file, use Calorie Calculator → Labels. Empty fields keep the translated defaults; saved overrides pin custom copy.

Contact