Repository navigation
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
=== 4WP Health === Contributors: 4wpdev Tags: health, fitness, google fit, wellness, oauth Requires at least: 6.4 Tested up to: 7.0 Requires PHP: 7.4 Stable tag: 0.4.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Connect Google Health / Fitness data to WordPress — per-user OAuth, dashboard charts, Gutenberg blocks, and REST API. == Description == **4WP Health** lets logged-in users connect personal health data sources. Phase 1: **Google Health** via Google OAuth and the Fitness API (activity, steps, distance, calories, exercise days). A plugin by [4wp.dev](https://4wp.dev/). **4WP** is our project brand; the letters "WP" appear only as part of that brand name, not as a reference to WordPress. This plugin is not affiliated with, endorsed, or sponsored by WordPress. Source code: [github.com/4wpdev/4wp-health](https://github.com/4wpdev/4wp-health) = Key features = * **Google Health OAuth** — per-user connect; tokens stored server-side * **Admin dashboard** — steps, distance, calories, exercise days charts with period controls * **Gutenberg blocks** — metric charts and customer picker for trainers (LMS planned) * **REST API** — settings, sync, metrics, dashboard aggregates * **Provider registry** — pluggable architecture (Apple Health, Strava planned) = Privacy = Health samples are stored in your WordPress database and shown only to the connected user (or admins with explicit capability). No data is sent to 4wp.dev. = Development = Human-readable PHP in `src/`; blocks and dashboard widgets require `npm run build` (output in `build/`). GitHub repository above. Run tests: `composer install && composer test && npm run build` == Blocks == This plugin provides 5 blocks. * **Health Steps** (`forwp/health-steps`) — daily steps vs goal * **Health Distance** (`forwp/health-distance`) — distance bar chart * **Health Calories** (`forwp/health-calories`) — active calories bar chart * **Health Exercise Days** (`forwp/health-exercise-days`) — exercise ring * **Health Customer Picker** (`forwp/health-customer-picker`) — trainer view of a user's metrics == External services == This plugin connects to **Google OAuth** and the **Google Fitness API** when a logged-in user clicks Connect. * **What data is sent:** OAuth authorization request; after consent, server-side API calls to read fitness datasets the user granted. * **When:** Only when an administrator saves OAuth credentials and a user initiates Connect or Sync. * **Terms:** [Google API Terms of Service](https://developers.google.com/terms) * **Privacy:** [Google Privacy Policy](https://policies.google.com/privacy) == Installation == 1. Upload the plugin to `/wp-content/plugins/4wp-health/` or install from the Plugins screen. 2. Activate **4WP Health**. 3. Run `npm install && npm run build` if `build/` is missing (development checkout). 4. Open **4WP Health** in wp-admin → save Google OAuth Client ID and Secret; enable Fitness API in Google Cloud. 5. As user: click **Connect Google Health** and sync. == Frequently Asked Questions == = Does Apple Health work in the browser? = Not yet. Apple Health has no web OAuth; a future release may use an iOS bridge or aggregator. = Who can see health data? = Each user's synced data is tied to their WordPress account. Trainers/admins need appropriate capabilities for customer picker and health data admin screens. == Screenshots == 1. Admin — Google Health settings and OAuth connect. 2. Dashboard — steps, distance, calories, exercise days charts. 3. Block editor — Health Steps block preview. 4. Health data admin — sample browser. == Changelog == = 0.4.0 = * Dashboard charts (steps, distance, calories, exercise days) with period controls. * Gutenberg blocks for metrics and customer picker. * Google Fitness sync service, hourly metrics, goal settings. * REST dashboard and metrics endpoints. * wp-admin dashboard widgets bundle. = 0.1.0 = * Initial scaffold: provider registry, Google Health OAuth, admin UI, REST settings. == Upgrade Notice == = 0.4.0 = Dashboard charts, Gutenberg blocks, Fitness sync, and REST metrics API. = 0.1.0 = First public scaffold.