Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/ankushshingari/fitness-journey-tracker/archive/refs/heads/main.zipA comprehensive WordPress plugin for tracking fitness journeys with dynamic form configuration, advanced user management, and real-time progress visualization.
Overview
Fitness Journey Tracker is a fully-featured WordPress plugin that enables users to track their weight loss/gain journey through a mobile-first interface. The plugin features a dynamic form system, session-based authentication, query parameter prefilling, and a powerful admin dashboard with inline editing capabilities.
Features
Core Features
- Dynamic Form System - Fully configurable forms via
form-config.phpwith support for multiple field types - Query Parameter Prefill - Auto-populate registration forms from URL parameters with read-only enforcement
- Session Management - Secure token-based user sessions without WordPress authentication
- Mobile-First Registration - Simple phone number-based user verification and registration
- Entry Tracking - Record weight entries with timestamps and custom metadata
- Progress Visualization - Interactive charts showing weight progression with target weight indicators
Admin Dashboard
- User Management - View, edit, restrict, and delete users
- Pagination - Efficient server-side pagination (20 users per page)
- Global Search - Search across all users by name, mobile, or email
- Inline Editing - Edit user profiles and entries directly in the dashboard
- Current Weight Display - Real-time display of latest weight from entries
- Bulk Operations - Filter by status, restrict/unrestrict users
- Analytics - Visual progress charts with historical data
Advanced Capabilities
- Dynamic Field Support - Add unlimited custom fields without code changes
- Data Persistence - All dynamic fields automatically saved to database
- Readonly Prefill - Query parameter fields are locked but submit correctly
- Field Type Support - Text, email, tel, number, textarea, select, radio, checkbox, range, date, URL
- Validation System - Client and server-side validation for all field types
- Safe Updates - Core fields protected from accidental deletion
Installation
-
Upload Plugin
- Download the
fitness-journey-trackerfolder - Upload to
/wp-content/plugins/directory - OR upload ZIP via WordPress admin: Plugins → Add New → Upload Plugin
- Download the
-
Activate
- Go to WordPress Admin → Plugins
- Find "Fitness Journey Tracker"
- Click "Activate"
-
Add Shortcode
- Create or edit a page
- Add the shortcode:
[fitness_tracker] - Publish the page
-
Access Admin Dashboard
- Navigate to WordPress Admin → Fitness Tracker
Usage
Frontend User Flow
-
Initial Registration
- User visits page with
[fitness_tracker]shortcode - Enters mobile number
- If new user → proceeds to health profile form
- If existing user → dashboard loads automatically
- User visits page with
-
Health Profile Form
- Full Name (required)
- Email (optional)
- Current Weight (required)
- Target Weight (required)
- Goal selection
- Additional dynamic fields from
form-config.php
-
User Dashboard
- View current weight
- View target weight
- Submit new weight entries
- View progress chart
- Track journey timeline
Query Parameter Prefill System
Users can be directed to the registration page with pre-filled data:
https://yoursite.com/fitness-tracker/?mobile_number=9876543210&full_name=John%20Doe&email=john@example.com
Behavior:
- Fields matching query parameters are auto-filled
- Pre-filled fields are displayed as read-only (grayed out)
- Values still submit correctly (using
readonlyfor text inputs, hidden inputs for select/radio/checkbox) - Works with ANY field defined in
form-config.php
Supported Parameters:
mobile_number- Pre-fills and locks mobile inputfull_name- Pre-fills name fieldemail- Pre-fills email field- Any custom field from your form configuration
Use Cases:
- Lead generation campaigns
- Referral tracking
- Pre-registration flows
- Partner integrations
Entry Submission
After registration, users can submit weight entries:
- Enter current weight
- Submit entry
- View updated progress chart
- Track historical entries in timeline
Admin Guide
Accessing Admin Dashboard
Navigate to: WordPress Admin → Fitness Tracker
User Management
View Users
- All users displayed in paginated table (20 per page)
- Columns: Mobile, Name, Email, Goal, Current Weight, Target Weight, Entries, Status
Search Users
- Enter search term in search box
- Click "Search" or press Enter
- Searches across: Name, Mobile Number, Email
- Search works globally (not limited to current page)
Filter Users
- All Users - Show everyone
- Active - Active, non-restricted users
- Restricted - Users who have been restricted
- Completed - Users who completed registration
Pagination
- Navigate using Previous/Next buttons
- Jump to specific page numbers
- Shows current range and total count
Editing User Data
Inline Profile Editing:
- Click user's mobile number or name
- Modal opens with editable fields
- Modify any field
- Click "Save Changes"
- Data updates immediately
Inline Entry Editing:
- View user details
- Click "Edit" next to any entry
- Modify weight or metadata
- Click "Save"
- Chart updates automatically
Restricting Users
Restrict a User:
- Click "Restrict" button next to user
- Confirm action
- User is immediately logged out
- User cannot access their dashboard
Unrestrict a User:
- Click "Unrestrict" button
- User regains access
Delete User
- Click "Delete" button
- Confirm action (irreversible)
- User and all entries are permanently removed
Progress Visualization
User Detail View:
- Line chart showing weight over time
- Red dashed line indicating target weight
- Hover over points for exact values
- Responsive design
Form Configuration
Location
/includes/form-config.php
Structure
return [
'health_form' => [
'sections' => [
'basic_info' => [
'title' => 'Section Title',
'fields' => [
'field_name' => [
'type' => 'text',
'label' => 'Field Label',
'required' => true,
'placeholder' => 'Enter value'
]
]
]
]
]
];
Adding a New Field
- Open
form-config.php - Add field definition to appropriate section:
'custom_field' => [
'type' => 'text',
'label' => 'Custom Field',
'required' => false,
'placeholder' => 'Enter custom value'
]
- Field automatically appears in frontend form
- Data automatically saved to database
- Field appears in admin edit modal
Supported Field Types
| Type | Description | Config Options |
|---|---|---|
text |
Single-line text input | max_length |
email |
Email input with validation | max_length |
tel |
Phone number input | max_length |
number |
Numeric input | min, max, step |
textarea |
Multi-line text | max_length |
select |
Dropdown menu | options (array) |
radio |
Radio buttons | options (array) |
checkbox |
Checkboxes | options (array) |
range |
Slider input | min, max, default |
date |
Date picker | - |
url |
URL input | max_length |
Field Configuration Options
type(required) - Field typelabel(required) - Display labelrequired(boolean) - Whether field is mandatoryplaceholder(string) - Placeholder textoptions(array) - For select/radio/checkboxmax_length(int) - Maximum character lengthmin,max(number) - For number/range fieldsstep(number) - Increment for number fieldsdefault(mixed) - Default value
Data Handling
Database Tables
Users Table (wp_fjt_user)
mobile_number(primary key)full_nameemailuser_profile(JSON) - Stores all dynamic fieldsgoaltarget_weightcurrent_stepform_completedstatusis_restrictedtime_createdlast_updated
Entries Table (wp_fjt_entries)
id(auto-increment)mobile_number(foreign key)weightentry_meta(JSON) - Stores dynamic entry metadataentry_typecreated_at
Dynamic Field Storage
User Profile Fields:
- Core fields:
full_name,email,weight,goal,target_weight - Dynamic fields: Stored in
user_profileJSON column - Example:
{ "height": "175", "age": "28", "activity_level": "Moderate", "dietary_preference": "Vegetarian" }
Entry Metadata:
- Core:
weight,created_at - Dynamic fields: Stored in
entry_metaJSON column
Data Safety
- Mobile number cannot be changed (primary identifier)
- Weight entries are append-only
- Core fields protected from deletion
- Dynamic fields merge with existing data (no overwrites)
- All inputs sanitized and validated
- Query parameters sanitized before use
Technical Notes
Architecture
- Dynamic Form System - Configuration-driven, no hardcoded fields
- Session-Based Auth - No WordPress user accounts needed
- Server-Side Pagination - Efficient DB queries with LIMIT/OFFSET
- AJAX-Powered - Smooth user experience without page reloads
- JSON Storage - Flexible schema for unlimited custom fields
Performance Optimizations
- Pagination limits queries to 20 records
- Search uses database LIKE queries (not JS filtering)
- Latest weight fetched via optimized query (not full entry load)
- Charts use Chart.js library (client-side rendering)
- Session tokens stored in cookies (minimal server overhead)
Compatibility
- WordPress: 5.0+
- PHP: 7.4+
- MySQL: 5.6+
- Browsers: Modern browsers (Chrome, Firefox, Safari, Edge)
Security
- AJAX nonce verification on all requests
- SQL injection protection via
$wpdb->prepare() - XSS prevention via
esc_html(),esc_attr() - Admin capabilities check (
manage_options) - Input sanitization on all user data
Hooks & Filters
The plugin includes WordPress hooks for extensibility:
- Database table creation on activation
- AJAX endpoints registered via
wp_ajax_* - Admin menu registered via
admin_menuhook - Scripts/styles enqueued properly
Support & Development
Version: 4.0.11
Author: AnkushShingari
License: GPL v2 or later
For issues, feature requests, or contributions, please contact the plugin administrator.