HARP
This is the repository for an anonynous reporting website for a wordpress project (HIT Anonymous Reporting Portal) that was developed used PHP. The repo particularly is for a plugin that was the main feature for the website . It is a plugin for reporting faults anonymous or incidents that are happening at the the institute
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/imaginaryryan/harp/archive/refs/heads/main.zipUniversity Fault Reporter — WordPress Plugin
Version: 1.0.0
Requires WordPress: 5.8+
Requires PHP: 8.0+
Tested up to: WordPress 6.5
Overview
A complete anonymous fault and crime reporting system for universities. Users can submit reports with optional evidence uploads, receive a unique tracking code, and check report status at any time. Administrators manage reports from a full WordPress dashboard.
Features
| Feature | Details |
|---|---|
| Anonymous submission | Toggle to submit with or without identity |
| Report categories | Sexual Harassment, Bullying, Theft, Vandalism, Drug/Substance Abuse, Other |
| Urgency levels | Emergency, High, Medium, Low |
| Campus locations | 10 predefined + Other |
| Evidence upload | Images (JPG, PNG, GIF) and videos (MP4, MOV), max 10 MB |
| Unique tracking code | Auto-generated SR-YYYY-XXXXXX format |
| Success notification | On-screen confirmation with copyable code |
| Email to admin | Styled HTML email on every new submission |
| Status tracking | Pending → In Progress → Resolved → Closed |
| Admin comments | Add public updates visible on tracking page |
| Reporter email notification | Non-anonymous reporters emailed on status change |
| Admin dashboard | Stats, table, filters, search, single report view |
| Settings page | Configure admin email, from name/email, max file size |
Installation
Step 1 — Upload the plugin
Option A — via WordPress Admin (recommended)
- Log in to your WordPress admin panel
- Go to Plugins → Add New
- Click Upload Plugin
- Choose
university-fault-reporter.zipand click Install Now - Click Activate Plugin
Option B — via FTP
- Extract
university-fault-reporter.zip - Upload the
university-fault-reporter/folder to/wp-content/plugins/ - Go to Plugins in wp-admin and click Activate
Step 2 — What happens on activation
The plugin automatically:
- Creates two database tables:
wp_HARP_reportsandwp_HARP_comments - Creates two WordPress pages:
- Submit Anonymous Report → slug:
HARP-submit-report - Track Your Report → slug:
HARP-track-report
- Submit Anonymous Report → slug:
Step 3 — Add pages to your navigation menu (optional)
- Go to Appearance → Menus
- Find Submit Anonymous Report and Track Your Report under Pages
- Add them to your desired menu
Step 4 — Configure settings
- Go to Fault Reports → Settings in your WordPress admin sidebar
- Set the Admin Notification Email (where new reports are sent)
- Optionally customise the From Name and From Email for outgoing emails
- Click Save Settings
🔧 Using Shortcodes Manually
If you want to embed the forms on existing pages, use these shortcodes:
[HARP_report_form] — Displays the full report submission form
[HARP_track_report] — Displays the report tracking page
Simply paste either shortcode into any page or post content area.
Testing in Development
Prerequisites
- Local WordPress environment (e.g. LocalWP, DevKinsta, XAMPP, MAMP)
- PHP 8.0+, WordPress 5.8+
Test 1 — Submit a Report
- Navigate to
/HARP-submit-report/on your site - Fill in:
- Category: Theft
- Urgency: High
- Location: Library
- Description: "Test submission — a laptop was reported missing."
- Upload a test image as evidence (optional)
- Leave the Submit Anonymously toggle ON
- Click Submit Report
- You should see a green success screen with a tracking code like
SR-2026-ABCD12 - Copy the tracking code
Test 2 — Track a Report
- Navigate to
/HARP-track-report/ - Paste your tracking code into the input field
- Click Track Status
- You should see your report details, current status (Pending), and the progress stepper
Test 3 — Admin Dashboard
- Log in to
/wp-admin/ - Click Fault Reports in the left sidebar
- You should see the report you submitted in the table
- Click View next to it
- Change the status to In Progress and add an admin note
- Click Update Status
- Refresh the tracking page — status should now show In Progress
Test 4 — Admin Comments
- On the single report admin page
- Scroll to Admin Comments / Updates
- Type a comment: "We are investigating this incident."
- Click Post Comment
- Refresh the tracking page — comment should appear under "Updates from Response Team"
Test 5 — Non-Anonymous Submission + Email
- Submit a new report with the Submit Anonymously toggle OFF
- Enter your name and a valid email address
- Submit the report
- In admin, update the status of this report
- The reporter's email address should receive a status update notification
Test 6 — Evidence Upload
- Submit a report and attach a JPG or MP4 file
- In the admin single report view, scroll to Evidence
- The image/video should render inline with a download button
Test 7 — Delete Report
- In the admin reports table, click Delete next to any report
- Confirm the prompt
- The row should disappear and evidence file should be removed from uploads
File Structure
university-fault-reporter/
├── university-fault-reporter.php ← Main plugin file (entry point)
├── uninstall.php ← Cleanup on plugin deletion
├── includes/
│ ├── class-HARP-db.php ← Database operations (CRUD)
│ ├── class-HARP-mailer.php ← HTML email notifications
│ ├── class-HARP-ajax.php ← AJAX endpoints (submit, track, admin)
│ ├── class-HARP-shortcodes.php ← [HARP_report_form] and [HARP_track_report]
│ ├── class-HARP-admin.php ← WordPress admin dashboard UI
│ └── class-HARP-settings.php ← Admin settings page
├── assets/
│ ├── css/
│ │ ├── HARP-frontend.css ← Front-end form and tracking page styles
│ │ └── HARP-admin.css ← Admin dashboard styles
│ └── js/
│ ├── HARP-frontend.js ← Form submission, tracking, file upload
│ └── HARP-admin.js ← Admin AJAX (status update, comments, delete)
└── README.md ← This file
Security
- All AJAX actions are protected with WordPress nonces
- All user input is sanitised before database insertion (
sanitize_text_field,sanitize_textarea_field,sanitize_email,intval) - All output is escaped before rendering (
esc_html,esc_attr,esc_url,esc_textarea) - Evidence uploads are MIME-type validated (not just extension)
- Admin-only actions verify
administratorcapability - Evidence files stored in a private subfolder (
/wp-content/uploads/HARP-evidence/)
Troubleshooting
| Issue | Solution |
|---|---|
| Pages not created on activation | Go to Settings → Permalinks and click Save to flush rewrite rules |
| Emails not being received | Install WP Mail SMTP and configure your mail provider |
| File upload fails | Check upload_max_filesize and post_max_size in your PHP configuration — set both to at least 12M |
| Tracking code not found | Ensure the code is typed exactly as shown (format: SR-2026-XXXXXX). It's case-insensitive. |
| Admin menu not visible | Ensure you are logged in as an Administrator role |
Uninstalling
- Deactivate the plugin from Plugins
- Click Delete
This will permanently remove all database tables and plugin options. All report data will be lost. Back up your database first if you want to preserve records.
Customisation
Adding new categories: Edit the $categories array in includes/class-HARP-shortcodes.php → render_report_form().
Adding new locations: Edit the $locations array in the same function.
Changing the colour scheme: Edit the CSS custom properties (:root block) in assets/css/HARP-frontend.css.
University Fault Reporter v1.0.0 — Built for WordPress.org