2025-08-07 15:24:29 -07:00
|
|
|
# Twilio WordPress Plugin
|
2025-08-06 14:34:35 +00:00
|
|
|
|
2025-08-07 15:24:29 -07:00
|
|
|
A comprehensive WordPress plugin for Twilio voice and SMS integration with advanced call center functionality.
|
|
|
|
|
|
|
|
## ⚠️ IMPORTANT: SDK Required
|
|
|
|
|
|
|
|
This plugin **requires** the Twilio PHP SDK v8.7.0 to function. The plugin will not work without it.
|
|
|
|
|
|
|
|
## Quick Installation
|
|
|
|
|
|
|
|
1. **Install the Twilio SDK** (Required):
|
|
|
|
```bash
|
|
|
|
chmod +x install-twilio-sdk.sh
|
|
|
|
./install-twilio-sdk.sh
|
|
|
|
```
|
|
|
|
|
|
|
|
2. **Test the SDK installation**:
|
|
|
|
```bash
|
|
|
|
php test-sdk.php
|
|
|
|
```
|
|
|
|
|
|
|
|
3. **Configure Twilio Credentials** in WordPress admin:
|
|
|
|
- Account SID
|
|
|
|
- Auth Token
|
|
|
|
- Phone Number
|
|
|
|
|
|
|
|
4. **Test the installation** with a sample call.
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
- **PHP 8.0+** (required for Twilio SDK v8.7.0)
|
|
|
|
- **WordPress 5.0+**
|
|
|
|
- **Twilio Account** with active phone number
|
|
|
|
- **curl** and **tar** (for SDK installation)
|
|
|
|
|
|
|
|
## Key Features
|
|
|
|
|
|
|
|
- 📞 **Call Center Operations**: Agent groups, queues, call distribution
|
|
|
|
- 🕒 **Business Hours Management**: Automated routing based on schedules
|
|
|
|
- 📱 **Outbound Calling**: Click-to-call with proper caller ID
|
|
|
|
- 💬 **SMS Integration**: Agent notifications and command system
|
|
|
|
- 🎛️ **Workflow Builder**: Visual call flow creation
|
|
|
|
- 🎤 **Voicemail System**: Recording, transcription, and notifications
|
|
|
|
- 📊 **Real-time Dashboard**: Queue management and statistics
|
|
|
|
|
|
|
|
## Installation Methods
|
|
|
|
|
|
|
|
### Option 1: Installation Script (Recommended)
|
|
|
|
```bash
|
|
|
|
# Run in plugin directory
|
|
|
|
./install-twilio-sdk.sh
|
|
|
|
```
|
|
|
|
|
|
|
|
### Option 2: Composer (For Development)
|
|
|
|
```bash
|
|
|
|
composer install
|
|
|
|
```
|
|
|
|
|
|
|
|
### Option 3: Manual Installation
|
|
|
|
1. Download Twilio SDK v8.7.0 from GitHub
|
|
|
|
2. Extract to `vendor/twilio/sdk/`
|
|
|
|
3. Create autoloader (see install script for reference)
|
|
|
|
|
|
|
|
## Architecture
|
|
|
|
|
|
|
|
The plugin uses:
|
|
|
|
- **Official Twilio PHP SDK v8.7.0** for all API operations
|
|
|
|
- **Native TwiML classes** for response generation
|
|
|
|
- **WordPress hooks and filters** for integration
|
|
|
|
- **Custom database tables** for call management
|
|
|
|
- **REST API endpoints** for webhooks
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
1. Install the SDK using the provided script
|
|
|
|
2. Configure Twilio credentials in WordPress admin
|
|
|
|
3. Set up phone numbers and webhook URLs
|
|
|
|
4. Create agent groups and workflows
|
|
|
|
5. Test with sample calls
|
|
|
|
|
|
|
|
## Troubleshooting
|
|
|
|
|
|
|
|
### "Twilio SDK classes not available" Error
|
|
|
|
|
|
|
|
1. **Run the installation script**:
|
|
|
|
```bash
|
|
|
|
chmod +x install-twilio-sdk.sh
|
|
|
|
./install-twilio-sdk.sh
|
|
|
|
```
|
|
|
|
|
|
|
|
2. **Test SDK installation**:
|
|
|
|
```bash
|
|
|
|
php test-sdk.php
|
|
|
|
```
|
|
|
|
|
|
|
|
3. **Check file permissions**:
|
|
|
|
```bash
|
|
|
|
ls -la vendor/
|
|
|
|
ls -la vendor/twilio/sdk/
|
|
|
|
```
|
|
|
|
|
|
|
|
4. **Verify directory structure**:
|
|
|
|
```
|
|
|
|
vendor/
|
|
|
|
├── autoload.php
|
|
|
|
└── twilio/
|
|
|
|
└── sdk/
|
|
|
|
├── Rest/Client.php
|
|
|
|
├── TwiML/VoiceResponse.php
|
|
|
|
└── ... (other SDK files)
|
|
|
|
```
|
|
|
|
|
|
|
|
### Plugin Shows 500 Error
|
|
|
|
|
|
|
|
- Check WordPress error logs
|
|
|
|
- Enable WP_DEBUG in wp-config.php
|
|
|
|
- Look for TWP Plugin error messages in logs
|
|
|
|
|
|
|
|
### SDK Installation Fails
|
|
|
|
|
|
|
|
- Ensure `curl` and `tar` are installed
|
|
|
|
- Check internet connection
|
|
|
|
- Try manual installation (see Installation Methods)
|
|
|
|
|
|
|
|
## Support
|
|
|
|
|
|
|
|
- Check `CLAUDE.md` for detailed technical documentation
|
|
|
|
- Review `TWILIO_SDK_MIGRATION.md` for migration details
|
|
|
|
- Enable WordPress debug logging for troubleshooting
|
|
|
|
- Use Twilio Console debugger for webhook testing
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
This plugin integrates with Twilio services and requires a Twilio account.
|