Currently the plugin fetches the SpaceAPI endpoint via ssi_get_status() and caches the result with a transient. The status badge only updates when a page is loaded; it never refreshes while the visitor stays on the page.
Proposed improvement
Register a WordPress REST API route (e.g., /wp-json/wp-spaceapi-consumer/status) that returns the current open/closed state. This route should call ssi_get_status() to retrieve the status and update the transient.
Enqueue a small JavaScript file with the block/shortcode that polls the new REST endpoint every 5 seconds and updates the badge’s text and CSS class accordingly. This will make the indicator live‑refreshing without requiring a page reload.
While the client‑side refresh is active, the server should re-fetch the remote SpaceAPI endpoint every 5 seconds so that the transient always contains fresh data.
Provide a filter or setting to allow administrators to adjust the polling interval if 5 seconds is too aggressive.
This feature would allow visitors to see real‑time changes in the space’s status and would provide a simple REST endpoint for other services to query.
Currently the plugin fetches the SpaceAPI endpoint via `ssi_get_status()` and caches the result with a transient. The status badge only updates when a page is loaded; it never refreshes while the visitor stays on the page.
### Proposed improvement
* Register a WordPress REST API route (e.g., `/wp-json/wp-spaceapi-consumer/status`) that returns the current open/closed state. This route should call `ssi_get_status()` to retrieve the status and update the transient.
* Enqueue a small JavaScript file with the block/shortcode that polls the new REST endpoint every **5 seconds** and updates the badge’s text and CSS class accordingly. This will make the indicator live‑refreshing without requiring a page reload.
* While the client‑side refresh is active, the server should re-fetch the remote SpaceAPI endpoint every **5 seconds** so that the transient always contains fresh data.
* Provide a filter or setting to allow administrators to adjust the polling interval if 5 seconds is too aggressive.
This feature would allow visitors to see real‑time changes in the space’s status and would provide a simple REST endpoint for other services to query.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Currently the plugin fetches the SpaceAPI endpoint via
ssi_get_status()and caches the result with a transient. The status badge only updates when a page is loaded; it never refreshes while the visitor stays on the page.Proposed improvement
/wp-json/wp-spaceapi-consumer/status) that returns the current open/closed state. This route should callssi_get_status()to retrieve the status and update the transient.This feature would allow visitors to see real‑time changes in the space’s status and would provide a simple REST endpoint for other services to query.