| 开发者 | kgcoder |
|---|---|
| 更新时间 | 2026年6月20日 22:13 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
/json-comments/?post=ID, supporting pagination and ordering. A minimal comment submission form is available at /sw-comment-form/?post=ID and supports replies. This allows compatible reader apps to display and post comments without loading the full WordPress comment system.
Proxy endpoint
When displaying connected documents, the Reader UI fetches pages from other sites through a server-side proxy at /sw-proxy/. This proxy is safe to use: before making any request to an external URL, the plugin verifies that the URL is explicitly listed as a connection of the current post. Arbitrary external URLs cannot be fetched through the proxy.
Static document files
You can also place standalone .hdoc, .cdoc, and .condoc files directly in a static-documents folder in your WordPress site root. They are served inline (not as downloads) at URLs like https://yoursite.com/static/filename.hdoc, which lets compatible apps intercept and render them.
Analytics
Standard WordPress analytics tools work normally on Embedded HDOC and Reader UI pages. When the Visible Connections extension is active and replaces the page UI, existing analytics scripts continue to run: page view events are already sent before the extension takes over, and session-level tracking continues uninterrupted.
For analytics code that needs to run after the Reader UI is fully initialized, the plugin dispatches a swpReaderReady event on document. You can listen for it in any custom script:
document.addEventListener('swpReaderReady', function(e) {
// e.detail.url is the current document URL
gtag('event', 'reader_view', { page_location: e.detail.url });
});
The event is fired at most once per page load regardless of whether the reader was initialized by the plugin or the extension.
Compatible apps
static-documents in the root of your WordPress installation (the same folder that contains wp-config.php). Place .hdoc, .cdoc, or .condoc files inside it. They will be accessible at https://yoursite.com/static/filename.hdoc.No. When a post is set to Reader UI mode, the plugin serves the full reader interface as a regular web page. Any visitor can use it. Visitors who do have the Visible Connections extension installed will also benefit from it on Embedded HDOC pages.
No. In Embedded HDOC (forced) mode (the default) your site looks identical to regular visitors. Only compatible apps detect and use the hidden metadata. Reader UI mode replaces your theme for those posts, which is intentional — it is meant for content you want to present in the reader layout for all visitors.
Yes. The proxy at /sw-proxy/ only fetches URLs that are explicitly listed as connections of the post being viewed. If a URL is not in the current post's connection list, the request is rejected. The allowed URLs are cached and invalidated whenever you update the post.
Yes. Standard WordPress analytics tools work on all pages. On Reader UI pages they load via the normal WordPress head hooks. On Embedded HDOC pages visited through the Visible Connections extension, analytics scripts initialize before the extension takes over the UI and continue tracking the session afterward. For analytics that need to run after the reader finishes rendering, listen for the swpReaderReady event on document.
In regular Embedded HDOC mode, compatible apps render the HDOC view only when the document is opened as a connected document on the right side of the reader. In Embedded HDOC (forced) mode, the HDOC view is always used, even when the page is the main document shown on the left side.
Yes. You can set a global default in Settings and override it per post or page in the editor sidebar.
swpReaderReady DOM event, dispatched after the reader finishes initializing. Useful for analytics and other post-render integrations.