File Structure
oforum/
├── oforum.php Main plugin entry point
├── admin/
│ ├── class-of-admin.php Admin panel controller
│ └── views/
│ ├── view-dashboard.php Dashboard tab
│ ├── view-rooms.php Room management
│ ├── view-threads.php Thread management
│ ├── view-moderation.php Moderation queue, IP bans, log
│ ├── view-analytics.php Analytics charts and tables
│ └── view-settings.php Plugin settings
├── includes/
│ ├── class-of-cpt.php CPT registration + DB table creation
│ ├── class-of-taxonomy.php Generic taxonomies (of_category, of_tag)
│ ├── class-of-rooms.php Room CRUD and query helpers
│ ├── class-of-query.php Thread and reply queries
│ ├── class-of-permissions.php Permission levels, IP ban checks
│ ├── class-of-trust.php Trust level recalculation
│ ├── class-of-moderation.php Report queue, shadow ban, audit log
│ ├── class-of-notify.php Subscriptions, notifications, email
│ ├── class-of-reactions.php Emoji reaction toggle and counts
│ ├── class-of-search.php Full-text search with filters
│ ├── class-of-seo.php Breadcrumbs, schema, sitemap
│ ├── class-of-shortcode.php Shortcode handlers
│ └── class-of-rest.php REST API routes
├── templates/
│ ├── forum-index.php Forum index page
│ ├── room-page.php Individual room page
│ ├── thread-page.php Individual thread page
│ ├── profile-page.php User profile page
│ └── partials/
│ ├── thread-card.php Thread card (used in room listing)
│ ├── reply-block.php Single reply block
│ ├── new-thread-form.php New thread submission form
│ ├── new-reply-form.php Reply submission form
│ └── report-modal.php Content report modal
└── assets/
├── css/
│ ├── of-admin-v2.css Admin panel styles
│ └── of-front.css Frontend styles
└── js/
├── of-admin-v2.js Admin panel interactions
└── of-front.js Frontend interactions (vanilla JS, no jQuery)
Data Model
Rooms, threads, and replies are stored as WordPress custom post types:
| CPT | post_type | Visibility | Notes |
|---|---|---|---|
| Forum Room | of_room | Private | Settings stored in post_meta |
| Forum Thread | of_thread | Public | SEO-friendly URL: /forum/thread/[slug] |
| Forum Reply | of_reply | Private | Managed entirely via plugin |
Thread-to-room relationship: stored as post_meta key of_thread_room_id (not taxonomy) for performance.
Reply-to-thread relationship: stored as post_meta key of_reply_thread_id.
Reply hierarchy (for quoting): of_reply_parent_id.
