| 开发者 |
wpsignal
jaredrethman |
|---|---|
| 更新时间 | 2026年10月1日 03:34 |
| PHP版本: | 8.2 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
window.WPS) for themes and plugins to share the connectionwpsignal_token_channels and wpsignal_token_channel_prefixes filters let other plugins add channels and namespace permissions to the JWT without modifying corewpsignal:* DOM events. The relay never sees the payload's plaintext.wordsocket folder to /wp-content/plugins/, or install directly from the WordPress plugin directory.WPSignal is a realtime event delivery service for WordPress. It pushes events from your site to connected browsers the moment they happen, without polling.
Yes. The plugin requires a WPSignal account to relay events. Create a free account at wpsignal.io.
During registration: your site URL and name. During normal operation: event payloads, AES-256-GCM encrypted on every site including plain HTTP ones, with a key derived from your site's WordPress salts that the server never receives, so it never sees their contents. Channel names stay readable because the server routes on them. When real-time collaboration is enabled, Yjs document updates (binary diffs of block editor content) are also relayed. These are not encrypted, so the server could read them; it forwards them by channel and never parses or stores them. All data is delivered in realtime and is not stored on the server. See our Privacy Policy for full details.
Event payloads are encrypted with AES-256-GCM before leaving WordPress. The encryption key is derived from your WordPress salts and site key using HKDF-SHA256, and is never sent to the WPSignal server. This means the relay cannot read your message content. Note: all logged-in users on the same site share the same derived key. Per-user message privacy is out of scope for the current version.
Real-time collaboration was removed from WordPress core before the 7.0 release and currently ships with the Gutenberg plugin as an experiment. Install and activate Gutenberg, then turn on Gutenberg > Experiments > "Enable real-time collaboration". The WordSocket Settings tab shows a "Gutenberg detected" badge when the feature is available, and the sync provider activates automatically once collaboration is enabled. Post types without custom-fields support are excluded by Gutenberg itself.
The built-in client script and the token endpoint (/wp-json/wpsignal/v1/token) are limited to logged-in users by default. To open them to all visitors, return true from the wpsignal_allow_client filter:
add_filter( 'wpsignal_allow_client', '__return_true' );
Tokens minted for visitors carry user ID 0 and are scoped to your site, so keep in mind that anyone can then subscribe to your site's public channels and publish over the WebSocket.
The plugin tells the WPSignal server to archive the site, then deletes the stored credentials (site key, secrets, and the API key if you connected manually). Your usage history stays on the server, and connecting the same site URL again restores the site with fresh secrets. On a manual connection you will need to paste the API key again. If the server cannot be reached, nothing is deleted and you can retry.
The WPSignal dashboard refuses to authorize a site when your plan's site limit is reached (the message names the site to disconnect first), when your account email is not yet verified, or when the account has been deactivated. The Connect tab shows the exact reason returned by the server.
An extension is a separate plugin built on WordSocket (WooCommerce, Live Blog, and Chat are on the way). Its settings appear on the WordSocket settings page under the Extensions tab, which also lists what is available. Developers: register on wpsignal_loaded with WPS::instance()->extensions()->register(), enqueue a settings script on the wordsocket_settings_enqueue action with wpsignal-settings as a dependency, and render window.wordsocket.ExtensionPanel from a plugin registered with wp.plugins.registerPlugin( slug, { scope: 'wordsocket', render } ). An extension with settings of its own adds a tab to this page with window.wordsocket.registerTab( { name, title, render } ) (0.28).
Yes. Reserve a namespace on wpsignal_loaded: WPS::instance()->channels()->reserve( 'orders', 'manage_woocommerce' ) (a capability, or a callable receiving the user ID). The relay then refuses subscribe and publish frames on that namespace from anyone else. Once any namespace is reserved, tokens list channels explicitly instead of allowing every channel of the site, so register each channel you subscribe to through the wpsignal_token_channels filter. Payload encryption is site-wide and is not a privacy boundary between users; the channel gate is.
Each plan has a monthly message quota. When it is reached the server answers publishes with "quota exceeded" and the plugin pauses publishing until the first day of the next month (UTC). The Connect tab on the WordSocket settings page shows this, as well as rejected credentials (disconnect and connect again) and an unreachable server, and clears the warning as soon as the server answers again. There is no admin notice.
The client falls back to SSE for receiving events. window.WPS.subscribe() and window.WPS.unsubscribe() work on SSE connections: channel changes are tracked and applied immediately via a lightweight SSE reconnect (50 ms debounce). Collaborative editing needs WebSocket, because SSE is receive-only: if the editor opens while the client is on SSE, collaboration stays off for that editor until the page is reloaded with WebSocket available. You can also disable the collaboration provider from the WordSocket Settings tab to use Gutenberg's HTTP polling for all editors instead.
window.wordsocket.registerTab()); ShopSocket's settings live therewp.sync global. The provider now takes the editor's Yjs instance from the Y option Gutenberg passes it, and still reads the global on older versionsws:// from the page's scheme instead of the relay's, so the TLS handshake failed (close 1006)wordsocket_nested_plugin_rows filters the rows and an empty array switches it offWPS.uuid() returns a v4 UUID and works on plain HTTP sites too, where browsers do not offer crypto.randomUUIDWPS.visitorId() is a stable per-browser id shared by every tab and extension on the site, for counting people rather than connectionsWPS.onChannel( channel, expected ) tells a handler whether an event arrived on the channel it claims, so events published elsewhere can be ignoredGET /wpsignal/v1/stats reports how many browsers are connected to the site right now and the plan's connection limit (WPS::instance()->publisher()->stats() in PHP), for extension dashboardsreserve( $ns, $read, $write )) or the wpsignal_token_publish_prefixes filter says otherwiseWPS.setPresence() for connection-scoped presence (who is here right now); subscribers receive wps.presence join/leave/sync events, WPS.setPresence( channel, null ) leaves at once, and a member drops the instant its connection closeswindow.wordsocket, wordsocket_settings_enqueue, WPS::instance()->extensions())WPS::instance()->channels()->reserve( $namespace, $capability ) gates a channel at the token level; once any namespace is reserved, tokens list channels explicitly.pot language file added (eventra-for-wpsignal.pot).objectId; the provider now maps this to a shared "collection" channel suffix so all peers join the same channel.ProviderCreatorOptions type updated to accept objectId: string | number | null, matching the Beta 2 provider creator API.wpsignal_token_channels filter: plugins can append channels to the initial auto-subscribe list in the minted JWT.wpsignal_token_channel_prefixes filter: plugins can add channel-prefix permissions to the JWT allowed_channel_prefixes claim, enabling server-enforced access to custom channel namespaces.window.WPS.subscribe() and window.WPS.unsubscribe() now work on SSE connections. Channel changes are tracked in a persistent set and applied immediately via a debounced SSE reconnect, so plugins that call these methods do not need to know the current transport.forceSSE config flag available for testing the SSE transport without browser tooling.wpsignal_encryption_seed filter for plugins and themes to supply custom key material.SubtleCrypto decryption in the browser client: events are dispatched only after successful decryption.publishBinary() and onBinaryMessage() methods on window.WPS for binary WebSocket frames.transport property on window.WPS exposes the current connection type ('ws', 'sse', or null).disconnected status when WebSocket is unavailable, allowing WordPress to show its "not synced" indicator.window.WPS): subscribe, publish, event listeners.WPS::trigger() fluent builder and WPS::publish() facade methods.WPSignal namespace.@wordpress/scripts build pipeline.