Skip to main content

Live Chat & Customer Support

Overview​

Live Chat handles customer support conversations inside WordPress rather than through a third-party chat service. Visitors open a chat from a storefront widget; staff answer it from the plugin's admin screen. Messages are delivered by polling, not by a websocket, so no external realtime service is involved and nothing about a conversation leaves the site.

It is a premium module. Enable it from Empora → Modules once your license includes livechat; enabling it creates its three tables and writes the default settings.

Availability​

ItemValue
Module keylivechat
TierPremium
Entitlement keylivechat
Admin tablivechat, under Operations
Enabled optionaiowc_module_enabled_livechat (off until enabled)
REST namespaceaiowc/v1

What it does​

Taken from the module class and its services:

  • Visitor-initiated chat sessions, optionally capturing a name and email address before the first message.
  • An agent roster held in its own table, with per-agent display name, maximum concurrent chats and an online/offline status.
  • Session assignment: an agent claims a pending session, and can transfer it to another agent.
  • Message polling from both sides, with a configurable poll interval.
  • An offline form that captures a message when no agent is available.
  • File attachments on a session, with a configurable size limit.
  • A post-chat rating and feedback field captured when the visitor ends the session.
  • Session and message retention with scheduled cleanup.
  • Deletion of a user's chat data when their WordPress account is deleted (delete_user → ChatService::deleteUserData()).

Settings​

Settings are individual options, each prefixed aiowc_lc_, registered in the aiowc_livechat group. Defaults come from LiveChatModule::getDefaultSettings() and are written on activation only when the option does not already exist.

Option (aiowc_lc_ + key)DefaultMeaning
enable_widgettrueWhether the storefront chat widget renders at all
widget_positionbottom-rightCorner the widget is anchored to
widget_color#7f54b3Accent colour of the widget
welcome_message"Hello! How can we help you today?"First message shown when the widget opens
enable_offline_formtrueWhether visitors can leave a message when no agent is online
offline_message"We are currently offline. Please leave a message."Text shown above the offline form
offline_emailemptyAddress that receives offline submissions
auto_popup_delay0Seconds before the widget opens by itself; 0 disables it
require_emailfalseWhether a visitor must supply an email address to start a chat
enable_file_uploadtrueWhether attachments are accepted on a session
max_file_size5Attachment size limit in megabytes
poll_interval3000Milliseconds between message polls
session_retention_days90Age at which closed sessions become eligible for cleanup
inactive_timeout_minutes30Idle time after which a session is closed by the timeout job

Enablement is separate from these settings: like every module, Live Chat reads aiowc_module_enabled_livechat, which defaults to false.

Admin screen​

Admin tab livechat. The screen carries four tabs — a live console for pending and accepted sessions, History, Agents and Settings — and calls the endpoints below.

Database schema​

Created by Schema/DatabaseSchema.php at schema version 1.0.0, which the module records in its own version option. Three tables, each carrying the WordPress table prefix:

TableHolds
{prefix}aiowc_chat_sessionsOne row per conversation, keyed by a public session key
{prefix}aiowc_chat_messagesIndividual messages, with sender type, attachment fields and read state
{prefix}aiowc_chat_agentsThe agent roster, keyed by WordPress user ID

REST endpoints​

Namespace aiowc/v1. Taken from the plugin's REST contract file. All of these return a bare response body rather than the shared envelope, so a client reading them should expect the payload alone.

Visitor endpoints​

MethodPathPurposeRequired args
GET/livechat/availabilityReport whether any agent is online—
POST/livechat/sessionsStart a chat session—
GET/livechat/sessions/{session_key}Read one sessionsession_key
POST/livechat/sessions/{session_key}/messagesSend a visitor messagesession_key, message
GET/livechat/sessions/{session_key}/pollFetch messages newer than last_message_idsession_key
POST/livechat/sessions/{session_key}/uploadAttach a file to a sessionsession_key
POST/livechat/sessions/{session_key}/endEnd a session, with optional rating and feedbacksession_key
POST/livechat/offlineSubmit the offline formname, email, message

Read endpoints here use a rate-limited public permission check; write endpoints use a public write check.

Agent endpoints​

Permission check: agent.

MethodPathPurposeRequired args
GET/livechat/agent/pendingList sessions waiting to be claimed—
GET/livechat/agent/sessionsList the calling agent's sessions—
POST/livechat/agent/sessions/{id}/acceptClaim a pending sessionid
POST/livechat/agent/sessions/{id}/messagesSend an agent messageid, message
POST/livechat/agent/sessions/{id}/transferHand a session to another agentid, agent_id
POST/livechat/agent/statusSet the calling agent's availabilitystatus
GET/livechat/agents/onlineList agents currently online—

Administrative endpoints​

Permission check: admin.

MethodPathPurposeRequired args
GET/livechat/agentsList all agents—
POST/livechat/agentsAdd an agentuser_id
PUT/livechat/agents/{user_id}Update an agentuser_id
DELETE/livechat/agents/{user_id}Remove an agentuser_id
GET/livechat/historyPaginated session history—
GET/livechat/statisticsSession statistics over a date range—
GET/livechat/settingsRead module settings—
POST/livechat/settingsUpdate module settings—

WordPress and WooCommerce integration​

  • wp_footer — renders the chat widget on the storefront.
  • wp_enqueue_scripts — loads the widget's assets.
  • delete_user — deletes that user's chat data.
  • admin_init — registers the aiowc_lc_* settings.

The module does not hook any WooCommerce order, product, cart or email action. It registers no shortcode and no block.

Background jobs​

Both jobs run through Action Scheduler in the aiowc-livechat group.

HookSchedulePurpose
aiowc_livechat_cleanupDaily, first run at 03:00Delete sessions past the retention window
aiowc_livechat_timeout_checkEvery 5 minutesClose sessions idle beyond the timeout setting

Both emit aiowc_track_event observability events on completion (livechat_cleanup_completed, livechat_sessions_timed_out).

Entitlement limits​

The entitlement is a gate, not a quota. ModuleRegistry::initializeModules() calls registerHooks() only for modules that are both enabled and permitted by the licence, so without the livechat entitlement the module contributes nothing at runtime. No per-seat, per-session or per-message limit is implemented in the module's code.