Worknoon Chat
Wordpress Work Noon Chat Bot
by David Adedotun · github.com/dotnation/worknoon-chat-wordpress
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/dotnation/worknoon-chat-wordpress/archive/refs/heads/master.zipWorknoon Chat WordPress Plugin
WordPress integration for the Worknoon Full-Stack WordPress assessment. The plugin adds a chat session custom post type, a shortcode-powered floating chat widget, and REST endpoints that can integrate with the Node/Express chat backend.
Features
- Custom post type:
chat_session - Shortcode:
[worknoon_chat] - Floating chat widget
- Settings page for backend API URL
- REST endpoint for creating local chat sessions
- REST proxy endpoint for creating backend conversations
- Product/order context support through shortcode attributes
Installation
- Copy this folder into:
wp-content/plugins/worknoon-chat-wordpress
-
Activate Worknoon Chat in the WordPress admin plugin screen.
-
Go to:
Settings > Worknoon Chat
- Set the backend URL:
http://localhost:5050
or your deployed backend URL.
Usage
Add the shortcode to any page, post, product page, or template:
[worknoon_chat]
With product context:
[worknoon_chat context="product" product_id="sku-classic-chair-001" product_name="Classic Office Chair"]
The widget appears as a floating chat button in the lower-right corner.
REST API
Create Local Chat Session
POST /wp-json/worknoon-chat/v1/session
Requires a logged-in WordPress user and a valid WordPress REST nonce.
Example body:
{
"message": "I have a question about this product.",
"productId": "sku-classic-chair-001",
"productName": "Classic Office Chair"
}
Proxy Backend Conversation
POST /wp-json/worknoon-chat/v1/proxy/conversations
Requires:
X-Worknoon-Token: BACKEND_JWT_TOKEN
This forwards the JSON body to:
{BACKEND_API_URL}/api/conversations
Integration Notes
- The plugin stores WordPress-side session records in
chat_session. - The shortcode widget demonstrates the WordPress integration surface without requiring a bundled React build.
- The Node backend remains the source of truth for real-time Socket.IO messaging.
- WooCommerce order and product sync can be extended by passing product/order context into the shortcode.
Assessment Mapping
- Custom Post Type:
chat_session - Shortcode:
[worknoon_chat] - REST API:
worknoon-chat/v1/sessionandworknoon-chat/v1/proxy/conversations - Bonus-ready context: product ID/name shortcode attributes