# Project plan — caredirect

Evidence date: 2026-10-19.

Source repository: `git@bitbucket.org:overdrive/caredirect.git`.

Inspected revision: `5721fda` (2020-01-09, rachelmogano, "Fix Search Area Where filter") on `master`. That commit is `origin/HEAD`. The only remote branch is `master`. History on `master` is 58 commits.

There was no `silicon_ark/caredirect/` set before this document. The repository root `README.md` is two lines. Theme `README.md` is still the stock Underscores starter. Statements below are recovered from the tree and Git history.

Secrets that appear in `wp-config.php` (database credentials, WordPress salts, AWS key/secret) and hardcoded CLX credentials in `class.Comms.php` are **not** copied into this document. Their presence is a security finding for maintainers.

## Product

CareDirect is a WordPress marketplace for care services, published at `caredirect.co.za` (theme URI and root README). Users sign up as **CareGivers** or **CareSeekers** and CareSeekers can search CareGivers. Provenance: **Documented** (root `README.md`) and **Implemented** (custom theme + `caredirect` plugin).

The custom theme is named **CareDirect**, authored by DBL Graphics, private licence, text domain `cc`. Provenance: **Implemented** (`wp-content/themes/caredirect/style.css`).

The primary custom plugin is **CareDirect w/ Facebook Connect** (header version 1.0.1; runtime `CC_VERSION` 1.0.3), authored by Julian Rachmann. Provenance: **Implemented** (`wp-content/plugins/caredirect/caredirect.php`).

WordPress core in this tree is **4.8.2**. Provenance: **Implemented** (`wp-includes/version.php`).

Database table prefix used in config and many hardcoded queries is `cco_`. Custom CareDirect tables use the additional prefix `cc_` (for example `cco_cc_regions`). Provenance: **Implemented** (`wp-config.php` `$table_prefix`; `CC_PREFIX` in the plugin).

## Branch reality

| Branch | Tip | Date | What it is |
|---|---|---|---|
| `master` (only branch; `origin/HEAD`) | `5721fda` | 2020-01-09 | Full WordPress 4.8.2 tree, CareDirect theme/plugin, vendor plugins, PayGate checkout templates |

Recent history (newest first, evidence from `git log`):

1. `5721fda` — rachelmogano — Fix Search Area Where filter
2. `380802d` — Merged PR #2 (tyrone-regionsearch)
3. `7671707` — Added work region save and updated search criteria
4. `57e7933` — Merged PR #1 (tyrone-regionsearch)
5. `63975e7` — Fixed region search
6. Earlier 2019 work: search page date/time restrictions removed, area dropdown/AJAX, profile details save, pipeline testing, PayGate amount fixes

Authors on history: rachelmogano (`rachel@overdrive.co.za`), Kagiso Malepe (`kagiso@overdrive.co.za`), Tyrone Adams / Tyron3 (`tyrone@overdrive.co.za`).

No commits after 2020-01-09. Provenance: **Implemented** (`git log`).

`bitbucket-pipelines.yml` defines a `master` pipeline that installs `git-ftp` and runs `git ftp status` against env vars `USR_NME`, `USR_PWD`, `SRV_HST`. Active script does **not** call `git ftp push`. Whether production deploy happens outside this pipeline is **Unknown / Requires Confirmation**.

`.gitignore` lists `bitbucket-pipelines.yml`, `.htaccess`, and `wp-config.php`. Those files are nonetheless present in the inspected tree (likely committed before ignore rules, or force-added). Provenance: **Implemented**.

The onboarding scan listed `sonar-project.properties` and `sonarqube_scan.bat` at the repository root. Those files are **not** in `5721fda`. Provenance: **Unknown** — they may have been untracked on the scan host.

## Objectives (inferred from the stack, not from a written plan)

No project plan or product requirements document exists in the repository. The following objectives are **Inferred** from README, theme/plugin behaviour, and integrations:

- Operate a public care marketplace where CareSeekers find and book CareGivers.
- Support caregiver onboarding (personal details, experience, banking, admin approval) and activation gating for public search.
- Accept payment for bookings via PayGate PayWeb3 (ZAR).
- Notify users by email (`wp_mail`) and SMS (CLX / Sinch XMS).
- Optionally allow Facebook Connect registration/login.
- Store media on Amazon S3 (`S3_UPLOADS_*` constants; Human Made S3 Uploads plugin present under a dot-prefixed directory).

## Scope that is in this repository

- WordPress 4.8.2 core (`wp-admin/`, `wp-includes/`, root bootstrap files).
- Custom theme `wp-content/themes/caredirect/` (presentation, PayGate checkout/thank-you templates, booking helpers, cities REST route).
- Custom plugin `wp-content/plugins/caredirect/` (roles, locations, availability, ratings, referrals, OTP, AJAX auth, page templates, REST controllers, Facebook, CLX Comms).
- Vendor plugins under `wp-content/plugins/` (Contact Form 7, Yoast SEO, Revolution Slider, WP All Import Pro, WP Mail SMTP, and others — see `technical-documentation.md`).
- Bitbucket Pipelines + git-ftp status check.
- Ops artefacts: `ccpull.php` (`git pull` via web), `mover/` (Search-Replace-DB), `adminer.php`, `email-signatures/`.

## Scope that is not established

- Whether the live site still runs this revision (last commit 2020-01-09).
- Which plugins/themes are active (`active_plugins` / stylesheet live in the database).
- CMS content: pages, menus, media, published caregiver data.
- Production PayGate merchant credentials (checkout hardcodes sample-style values).
- Whether SMS and Facebook are enabled in production.
- Whether `.S3-Uploads` and `.caredirect-old` are active (dot-prefixed directories).
- Legal entity, ownership, and commercial model beyond what strings in the UI imply.

## Architecture (high level)

```text
Browser
  └─ WordPress 4.8.2
       ├─ Theme: caredirect (UI, PayGate checkout, booking AJAX)
       ├─ Plugin: caredirect (domain logic, tables, REST, SMS/email, Facebook)
       ├─ MySQL (prefix cco_; custom cc_* tables)
       ├─ PayGate PayWeb3 (secure.paygate.co.za)
       ├─ CLX XMS SMS (api.clxcommunications.com)
       ├─ Facebook Graph v2.2 (optional login)
       └─ Amazon S3 (uploads; bucket name caredirect, region eu-central-1)
```

Deploy path suggested by pipeline: Git on Bitbucket → FTP host via git-ftp credentials. Provenance: **Implemented** (pipeline YAML). Actual hosting provider and URL mapping beyond `caredirect.co.za` branding are **Unknown / Requires Confirmation**.

## Major components

| Component | Path | Role |
|---|---|---|
| CareDirect theme | `wp-content/themes/caredirect/` | Front-end theme, checkout, thank-you, caregiver profile booking UI |
| CareDirect plugin | `wp-content/plugins/caredirect/` | Marketplace domain logic |
| CareConnect remnant | `wp-content/plugins/careconnect/` | Incomplete fragment (no main plugin bootstrap found) |
| Archived plugin copy | `wp-content/plugins/.caredirect-old/` | Dot-prefixed old copy of the custom plugin |
| S3 Uploads | `wp-content/plugins/.S3-Uploads/` | Human Made S3 media storage (dot-prefixed) |
| Twenty Seventeen | `wp-content/themes/twentyseventeen/` | Stock theme present alongside CareDirect |

## Dependencies (summary)

- PHP WordPress stack (exact PHP version required: **Unknown** from repo alone; WP 4.8.2 era).
- MySQL/MariaDB with prefix `cco_`.
- External: PayGate, CLX SMS, Facebook app, AWS S3.
- Deploy tooling: Bitbucket Pipelines, git-ftp, optional Search-Replace-DB.

## Milestones (from Git history — completed work, not a forward plan)

| Period | Evidence |
|---|---|
| Early history | Search page area filter; wp-config DB connection; PayGate amount fixes |
| 2019-11 | Search page: remove mandatory date/time; area dropdown; area list AJAX |
| 2019-12 | Pipeline testing; area list AJAX |
| 2020-01 | Work region save; region search fixes; PR merges; last search-area filter fix |

There is no documented roadmap after `5721fda`. Forward milestones are **Unknown / Requires Confirmation**.

## Current project status

| Aspect | Status | Provenance |
|---|---|---|
| Code present in Bitbucket | Yes | Clone of `origin/master` |
| Last code change | 2020-01-09 | `git log` |
| Silicon Ark documentation | Created by this onboarding | This directory |
| Live production health | Unknown | Requires confirmation |
| Active maintenance | No commits for years | Inferred from history; not a product decision |

## Related documents

- `prd.md` — product requirements recovered from implementation
- `features.md` — feature inventory
- `business-rules.md` — rules enforced in code
- `technical-documentation.md` — architecture and integrations
