1. Requirements & Installation

Requirements

  • WordPress 5.8 or higher
  • PHP 7.4 or higher
  • Gym Builder plugin (required)
  • GB Stripe Payments plugin (optional for paid bookings)

Installation Steps

  1. Upload the plugin folder to:
    /wp-content/plugins/gb-personal-session/
  2. Activate Gym Builder plugin first
  3. Activate GB Personal Session
  4. Navigate to:
    Gym Builder → Personal Sessions

Uninstallation

Deleting the plugin will:

  • Remove all plugin database tables
  • Delete plugin settings and stored options
  • Clear scheduled cron jobs

2. Plugin Setup

After activation, access:

Gym Builder → Personal Sessions

Admin Tabs

  • Sessions — Manage session types
  • Bookings — View and manage bookings
  • Settings — Configure plugin behavior

Initial Setup Checklist

  • Configure success & cancel pages
  • Set advance booking limit
  • Enable/disable email notifications
  • Enable guest booking (optional)
  • Enable online sessions (optional)
  • Save settings

3. Managing Sessions

A session represents a bookable service.

Create a Session

  1. Go to Sessions
  2. Click Add Session
  3. Configure:
    • Title
    • Trainer
    • Class (optional)
    • Duration
    • Description
    • Pricing (free/paid)
    • Session mode (offline/online/both)
  4. Save

Session Modes

  • Offline — In-person only
  • Online — Virtual only
  • Both — User selects during booking

Status

  • Active → visible to users
  • Inactive → hidden

4. Managing Time Slots

Each session must have available time slots.

Add Slots

  1. Open session → Manage Slots
  2. Select date from calendar
  3. Add time slots
  4. Save

Bulk Scheduling

  • Select weekdays
  • Define date range
  • Add slots
  • Generate automatically

Slot States

  • Available
  • Booked
  • Held (temporary during payment)

5. Booking Flow (Frontend)

Booking is handled via a 5-step wizard.

Steps

  1. Select Trainer & Session
  2. Choose Date & Time
  3. Enter User Info
  4. Review Booking
  5. Confirm

Booking Types

Free Session

  • Instantly confirmed

Paid Session

  • Slot held for 10 minutes
  • Redirect to Stripe Checkout

6. Managing Bookings (Admin)

Booking Status

  • Pending
  • Confirmed
  • Completed
  • Canceled
  • No Show

Admin Actions

  • Update status
  • Send reminders
  • Process refunds
  • View payment logs
  • Create manual bookings

7. Email Notifications

Email Events

  • Booking confirmation
  • Cancellation
  • Completion
  • Reminder (24h before)

Features

  • HTML email templates
  • Automatic reminders via cron
  • Manual reminder option

8. Stripe Payments

Workflow

  1. Customer selects paid session
  2. Slot held (10 min)
  3. Stripe Checkout starts
  4. Webhook confirms payment
  5. Booking becomes permanent

Refunds

  • Configurable percentage
  • Processed via Stripe
  • Logged for tracking

9. Online Sessions

Features

  • Enable virtual training
  • Google Meet integration
  • Online/offline toggle per session

10. Google Calendar Sync (Full Setup)

Google Calendar integration allows automatic event creation, attendee invitations, and optional Google Meet links.


Step 1: Create Google Cloud Project

  1. Visit: https://console.cloud.google.com/
  2. Create a new project
  3. Select the project

Step 2: Enable APIs

Enable:

  • Google Calendar API
  • Google People API

Step 3: Configure OAuth Consent

  • Choose External
  • Add app name and email
  • Add scopes:
https://www.googleapis.com/auth/calendar.events
https://www.googleapis.com/auth/userinfo.email
  • Add your email as test user

Step 4: Create Credentials

  1. Go to Credentials
  2. Create OAuth Client ID
  3. Select Web Application

Add Redirect URI:

https://yourdomain.com/wp-admin/admin.php?page=gb-personal-sessions&gbps_gcal_auth=1

Step 5: Add Credentials to Plugin

  • Go to plugin settings
  • Paste Client ID & Secret
  • Save

Step 6: Connect Google Account

  • Click Connect Google Account
  • Login & allow permissions
  • Confirm connection success

Step 7: Enable Sync

  • Enable Google Calendar Sync
  • Optional: Enable Google Meet
  • Save

Step 8: Test Integration

  • Book a session
  • Check calendar event created
  • Cancel booking → event removed

Notes

  • Only confirmed bookings create events
  • Sync failures do not break booking
  • Tokens auto-refresh

11. Trainer Reviews

Workflow

  1. Booking completed
  2. User receives review request
  3. User submits rating

Options

  • Auto-approve or admin approval
  • Star rating system
  • Average rating display

12. Dashboard Tabs

Student Dashboard

  • View bookings
  • Cancel bookings
  • Leave reviews

Trainer Dashboard

  • View sessions
  • Mark session complete

13. Shortcodes

[gb_personal_session]
[gb_personal_session trainer_id="123"]
[gb_personal_session class_id="456"]

14. Settings Reference

Stored in:

gb_personal_session_settings

15. Hooks & Filters

Actions

  • gbps/booking_confirmed
  • gbps/booking_completed
  • gbps/booking_canceled

Filters

  • gbps/refund_percentage

16. Troubleshooting

Common Issues

Stripe not working

  • Check API keys and webhook

Emails not sending

  • Configure SMTP

Slots not showing

  • Ensure session is active

Google Calendar not syncing

  • Verify OAuth connection
  • Enable sync

Database Structure

Tables

  • gbps_sessions
  • gbps_available_slots
  • gbps_bookings
  • gbps_payment_logs
  • gbps_reviews

Cron Jobs

  • gbps_daily_cron → Reminder emails
  • gbps_release_expired_holds → Release held slots