CSV Storage
Overview
Form submissions are stored as CSV files on the server, providing simple, queryable, and portable storage without database overhead.
Directory Structure
/opshell-contact-submissions/
├── index.php (directory listing protection)
├── messages.csv (successful submissions)
└── failed-verifications.csv (failed Reoon verifications)
The directory is created at dirname(ABSPATH, 2) . "/opshell-contact-submissions", outside the web root for security.
messages.csv Schema
| Column | Description |
|---|---|
| timestamp | current_time("mysql") |
| ip | $_SERVER["REMOTE_ADDR"] (sanitized) |
| name | Sanitized text field |
| Sanitized email | |
| subject | Sanitized text field |
| message | Sanitized textarea |
failed-verifications.csv Schema
Additional columns beyond the common row:
| Column | Description |
|---|---|
| verification_status | Reoon response status |
| is_safe_to_send | JSON-encoded boolean |
| verification_mode | "power" |
| overall_score | String score |
| error | Error message |
Access Control
- Directory is outside web root (not accessible via HTTP)
index.phpprevents directory listing if directory were accessible- File operations use
flock(LOCK_EX)for concurrent write safety - New file creation checks parent directory existence
CSV Functions
| Function | Purpose |
|---|---|
opshell_contact_submissions_dir() | Create/get submissions directory |
opshell_append_contact_csv() | Thread-safe CSV row append |
opshell_save_contact_submission_csv() | Save successful submission |
opshell_save_failed_contact_verification_csv() | Save failed verification |