WPSignal: Realtime WordPress WebSocket Events

3 min read Original article ↗

Realtime WordPress events. Zero polling.

WPSignal serves as a WebSocket relay for your WordPress site. In combination with the WordSocket plugin, you can trigger events for any WordPress action hook. Dispatch events from your PHP code to all browsers connected to your site.

Download:

WP CLI:

wp plugin install wordsocket --activate

Composer:

composer require wpackagist-plugin/wordsocket

1. Connect

Click "Connect to WPSignal" in the settings page:
WP Admin > WordSocket > Connect.

WPSignal Disconnected

2. Authorize

Click "Connect to WPSignal" in the settings page: your site registers automatically and credentials are saved.

WPSignal Authorize

3. Verify

Your site is connected to WPSignal and ready to receive events.

WPSignal Authorize
  • WebSocket-first

    Persistent WebSocket connections with Server-Sent Events as automatic fallback. Keepalive pings every 20 seconds.

    WP SITE PUBLISH RELAY WPSignal CLIENT CLIENT CLIENT

  • HMAC-signed publishes

    Every event is signed with SHA-256 HMAC. Timestamp replay protection and per-site rate limiting built in.

    PAYLOAD TIMESTAMP replay guard · SITE_SECRET HMAC SHA-256 a3f7 9c1e b82d SIG

  • Fluent trigger API

    Attach events to any WordPress action hook with a builder API: channel, payload, condition and more, all in one call.

    WP·HOOK CONDITION .when() DATA·BUILDER TRIGGER .register() events post. updated PUBLISH

  • Blind relay encryption

    When using WordSocket, all events are AES-256-GCM encrypted before leaving WordPress. WPSignal only ever sees ciphertext.

    PLAINTEXT RAND·IV 12 bytes ENCRYPT·KEY AES·256 GCM dGhp c2lz dGVz CIPHER

  • Multi-site support

    Each WordPress site gets its own site_key and publish secret. Tenant isolation is enforced at the channel level.

    SITE·A SITE·B SITE·C RELAY WPSignal site:a events site:b events site:c events

  • Explorer

    Built-in admin page showing connection status, live event log, publish form, and token inspector for instant debugging.

    WP·ADMIN CONNECTED EXPLORER post.updated 14ms order.paid 6ms user.login 11ms comment.new 2ms PUBLISH events post.updated LIVE 1 client · 1 ch TOKEN site_id channels exp EVENTS post.updated order.paid user.login

Realtime collaborative editing
without HTTP polling

WordPress 7.0 ships a collaborative block editor built on Yjs.

WordPress will ship real-time collaborative editing in a future version release.

The default transport is HTTP polling. WordSocket registers as a WebSocket-based Yjs sync provider, replacing polling with a persistent low-latency connection using the same relay your events already run on. No extra configuration required.

See the docs

PEER·A STEP·1 UPDATE YJS RELAY WPSignal STEP·2 UPDATE PEER·B

Readable, developer focused API

on any WordPress action hook using the fluent builder API. Add a condition, custom channel, or transform the payload: all optional.

Listen for events

The browser client auto-connects and dispatches native CustomEvents, listen with plain JavaScript or integrate with any frontend framework.

See the full guide

add_action('wpsignal_loaded', function () {
  WPS::trigger('order.status_changed')
    ->on('woocommerce_order_status_changed', 10, 3)
    ->channel('events')
    ->data(
      fn ($order_id, $old_status, $new_status) => [
        'order_id' => $order_id,
        'old_status' => $old_status,
        'new_status' => $new_status,
        'total' => $order->get_total(),
      ])
    ->register();
});
document.addEventListener('wpsignal:order.status_changed', (e) => {
  const { 
    order_id, 
    new_status, 
    total 
  } = e.detail.data;
  triggerFlashNotification(order_id, new_status, total);
});
  1. WPSignal as a Tier 3 WebSocket sync provider for WordPress collaborative editing, powered by Yjs.

  2. WordSocket is live on the WordPress.org plugin directory. Install it directly from WP Admin or via WP-CLI.

  3. WPSignal currently supports blind-relay encryption, WPSignal only ever sees ciphertext. Soon E2E encryption will be supported.

  4. A separate WordPress plugin providing 1-on-1 direct messaging for logged-in users, powered by WPSignal's bidirectional WebSocket relay.

  5. One primary WordPress site dispatches events; connected child sites consume them. Cross-site event routing without duplication.

  6. Allow multiple single user connections to be multiplexed through a single shared worker.

Ready to go realtime?

Free during beta. No credit card required. Sign up, connect your site, and push your first event in minutes.