ORegister creates 10 custom tables on activation, all prefixed with {prefix}or_.
{prefix}or_activity
Tracks every XP-earning action per user.
| Column | Type | Notes |
|---|---|---|
| id | bigint | PK, auto-increment |
| user_id | bigint | WP user ID |
| action | varchar(100) | e.g. login, register, post_comment |
| object_id | bigint | Related post/comment ID (optional) |
| xp_earned | int | XP awarded for this action |
| data | longtext | JSON extra data |
| created_at | datetime | Timestamp |
{prefix}or_xp
Denormalized XP totals for leaderboard performance.
| Column | Type | Notes |
|---|---|---|
| user_id | bigint | PK |
| total_xp | bigint | Running total |
| level | int | Current level number |
| updated_at | datetime | Auto-updated |
{prefix}or_badges
Admin-defined achievement badges.
| Column | Type | Notes |
|---|---|---|
| id | int | PK |
| name | varchar(200) | Badge name |
| description | text | |
| icon | varchar(500) | Image URL |
| condition_type | varchar(100) | manual, xp_threshold, login_streak |
| condition_value | varchar(200) | Threshold value |
| xp_reward | int | XP granted on earn |
| active | tinyint(1) | 1 = visible |
{prefix}or_user_badges
Join table: which users have earned which badges.
| Column | Type |
|---|---|
| id | bigint PK |
| user_id | bigint |
| badge_id | int |
| earned_at | datetime |
{prefix}or_sessions
Active login sessions per user with device info.
| Column | Type |
|---|---|
| id | bigint PK |
| user_id | bigint |
| token_hash | varchar(64) sha256 hash |
| device_info | varchar(500) User-Agent |
| ip_address | varchar(45) |
| last_active | datetime auto-updated |
| created_at | datetime |
{prefix}or_login_attempts
Brute force protection: tracks failed attempts by IP + email.
{prefix}or_notifications
In-plugin notification bell entries.
| Column | Type |
|---|---|
| id | bigint |
| user_id | bigint |
| type | varchar(100) e.g. xp_earned, badge_earned, new_follower |
| message | text |
| read_at | datetime NULL |
| data | longtext JSON |
{prefix}or_follows
Follow/unfollow relationships between users.
{prefix}or_messages
Direct user-to-user messages.
{prefix}or_2fa
Per-user 2FA configuration (secret, method, trusted devices).
