Community (E4)
A full community layer that does not require BuddyPress. Eight component classes load under includes/community/:
OMembership_Spaces- containers for topicsOMembership_Topics- threaded posts inside a spaceOMembership_Replies- nested replies, parent-pointer threadingOMembership_Reactions- emoji reactions on topics or repliesOMembership_DMs- direct messages, 1:1 and groupOMembership_Directory- public member directoryOMembership_Moderation- report -> review -> action pipelineOMembership_Badges- badge awards (XP forwarding lives in E6)
Spaces
wp_omem_spaces
type ENUM('discussion','course','private')
name, slug UNIQUE
plan_ids LONGTEXT (JSON array) -- which plans can read/post
course_id BIGINT NULL -- bound to a specific course
status ENUM('active','archived')OMembership_Spaces::for_user( $user_id ) intersects the member's active plans with each space's plan_ids; spaces with an empty plan_ids array are public to all members.
Topics and replies
Indexes optimise the hot paths: topics ordered by (space_id, last_activity_at) so the discussion list is cheap, replies by (topic_id, created_at) for chronological threads.
Direct messages
wp_omem_dm_conversations -- id, type ENUM('direct','group'), participants JSON, title, last_message_at
wp_omem_dms -- id, conversation_id, sender_id, body, attachments, read_byDelivery defaults to polling (settings.community.realtime_mode = 'polling'). The WebSocket adapter is wired but the cipher swap for encrypted bodies is deferred. The omem/dm/encrypt filter is the integration point.
Rate limits live in settings:
rate_limit_post_per_hour(default 30)rate_limit_dm_per_hour(default 60)
Reactions
UNIQUE KEY uniq_reaction(target_type, target_id, user_id, emoji) - one of each emoji per user per target.
Moderation
OMembership_Moderation::report() files a report; the moderator queue is paginated. resolve() accepts actions:
remove- hide the topic/replywarn- flag the author (no state change)mute/suspend/ban- escalation tiers
Keyword auto-flagging hangs off omem/moderation/auto_flag for plugins to extend.
Capabilities
omem_manage_community- adminomem_moderate_community- moderator-only access to the queueomem_manage_badges- badge CRUD

