Google Fit · WordPress

4WP Health

Connect Google Health and Fitness to WordPress — per-user OAuth, admin dashboard charts, Gutenberg metric blocks, and a REST API for wellness data on your site.

Google OAuth

Fitness API

Dashboard Charts

Gutenberg Blocks

REST API

Version 0.4.0 · WordPress 6.4+ · PHP 7.4+ · GPL v2+ · Open source on GitHub

4WP Health bridges personal fitness data and WordPress — each logged-in user connects their own Google account; samples stay in your database and are never sent to 4wp.dev.

Wellness metrics in WordPress, on your terms

Phase 1 focuses on Google Health via OAuth and the Fitness API — steps, distance, active calories, and exercise days. A pluggable provider registry leaves room for Apple Health, Strava, and LMS/trainer workflows later.

What you get

Per-user Google OAuth

Each member connects Google Health individually. Tokens are stored server-side; sync runs only after explicit consent.

Admin dashboard

Charts for steps, distance, calories, and exercise days with period controls — plus wp-admin dashboard widgets.

Five Gutenberg blocks

Embed metric charts on the front end and use a customer picker block for trainer-style views (LMS integration planned).

REST API

Settings, sync, metrics, and dashboard aggregates exposed for headless dashboards or custom admin tooling.

Provider registry

Pluggable architecture — Google Health ships first; Apple Health and Strava are on the roadmap.

Privacy by design

Health samples live in your WordPress database. Visible to the connected user — or admins with explicit capabilities — not to 4wp.dev.

Gutenberg blocks

  • Health Steps — daily steps vs goal
  • Health Distance — distance bar chart
  • Health Calories — active calories bar chart
  • Health Exercise Days — exercise ring
  • Health Customer Picker — trainer view of a user’s metrics

Getting started

  1. Install and activate 4WP Health.
  2. Run npm install && npm run build if the build/ folder is missing (dev checkout).
  3. Open 4WP Health in wp-admin → save Google OAuth Client ID and Secret; enable the Fitness API in Google Cloud.
  4. As a user: click Connect Google Health and sync your data.

Development: human-readable PHP in src/; blocks and dashboard widgets compile to build/. Tests: composer test.

External services & privacy

When a user clicks Connect, the plugin talks to Google OAuth and the Google Fitness API — only for datasets the user granted. See Google API Terms and the Google Privacy Policy.

4WP is our project brand; this plugin is not affiliated with or endorsed by WordPress. Health data is never transmitted to 4wp.dev servers.

FAQ

Common questions about Google Fit integration in WordPress

What is 4WP Health?

A WordPress plugin that lets logged-in users connect Google Health / Fitness data — with admin charts, Gutenberg metric blocks, REST endpoints, and a provider registry for future sources.

Does Apple Health work in the browser?

Not yet. Apple Health has no web OAuth flow. A future release may add an iOS bridge or third-party aggregator through the provider registry.

Who can see synced health data?

Data belongs to the WordPress user who connected Google Health. Trainers and administrators need explicit capabilities to use the customer picker and health admin screens.

Is my health data sent to 4wp.dev?

No. Samples are stored in your WordPress database on your server. The plugin does not phone home to 4wp.dev.

What Google APIs are used?

Google OAuth for authorization and the Google Fitness API for activity datasets — steps, distance, calories, and exercise sessions — only after the user consents and an admin saves valid OAuth credentials.

Where can I get the source code?

Clone or download from GitHub. Part of the 4WP Bundle ecosystem.

Connect Google Fit to your WordPress site

Explore the repository, configure OAuth, and embed health metric blocks — privacy-first, on your infrastructure.