WP

Threadwp

📦 Installation

Follow this step-by-step guide to install and configure Threadwp on your WordPress site.

Prerequisites

System Requirements

Required Software
WordPress 5.6+    ✓ with PHP 7.4+
Node.js 16+      ✓ with npm or bun
MySQL/MariaDB    ✓ database
Web server       ✓ (Apache/Nginx) with WebSocket support

Recommended Setup

ServerVPS or dedicated hosting
MemoryMinimum 1GB RAM
SSLRequired for WebSocket
DomainWebSocket subdomain recommended

Installation Steps

1
WordPress Plugin Setup

Install and configure the WordPress plugin

# Clone the repository
git clone https://github.com/Ri2rathod/threadwp.git
cd threadwp

# Install plugin in WordPress
cp -r wp-plugin/ /path/to/wordpress/wp-content/plugins/threadwp/

# Install PHP dependencies
cd /path/to/wordpress/wp-content/plugins/threadwp/
composer install

2
Frontend Build

Build the React frontend application

# Navigate to plugin directory
cd wp-plugin/

# Install dependencies
npm install
# or
bun install

# Build for production
npm run build
# or
bun run build

# For development
npm run dev
# or
bun run dev

3
Socket.IO Server Setup

Configure and start the WebSocket server

# Navigate to server directory
cd socket-server/

# Install dependencies
npm install
# or
bun install

# Configure environment
cp .env.example .env
# Edit .env with your settings

# Start server
npm start
# or
bun start

# For development with auto-reload
npm run dev
# or
bun run dev

4
WordPress Configuration

Set up database and API configuration

# Run database migrations
wp threadwp migrate:run --path=/path/to/wordpress

# Configure API settings in WordPress admin:
# Go to Settings > WPLC API
# - Enable API access
# - Generate API key
# - Configure user permissions

5
Environment Configuration

Create and configure the environment file

# WordPress Integration
WP_BASE_URL=https://yoursite.com
WP_API_NAMESPACE=threadwp-chat/v1
WP_API_KEY=your_generated_api_key_here
WP_API_TIMEOUT=10000

# Server Configuration
PORT=3001
NODE_ENV=production

# CORS Configuration
CORS_ORIGIN=https://yoursite.com
CORS_METHODS=GET,POST

# Socket.IO Configuration
SOCKET_PING_TIMEOUT=60000
SOCKET_PING_INTERVAL=25000

Important Notes

🚀 Quick Start

For a quick test installation on a local development environment:

# Quick local setup
git clone https://github.com/Ri2rathod/threadwp.git
cd threadwp

# Install all dependencies
npm run install:all

# Start development servers
npm run dev:all

# Access your WordPress site with chat enabled
Buy Me A Coffee
Buy Me A Coffee