# Call Agent AI for WordPress

![Call Agent AI Plugin](https://callagentai.com/assets/banner.png)

Add AI-powered voice and chat capabilities to your WordPress website with CallAgentAI.

## Features

- 🎤 **Real-time Voice Calls** - Let visitors talk to your AI assistant
- 💬 **Text Chat** - Familiar chat interface for conversations
- 🤖 **Custom AI Assistants** - Configure personality and responses
- 📱 **Mobile Responsive** - Works on all devices
- 🎨 **Customizable** - Choose widget position and styling
- 📊 **Analytics** - Track conversations in your dashboard
- ⚡ **Easy Setup** - Install and configure in minutes

## Installation

### From WordPress Plugin Directory (Coming Soon)

1. Go to Plugins > Add New
2. Search for "Call Agent AI"
3. Click Install and Activate

### Manual Installation

1. Download the plugin from this repository
2. Upload to `/wp-content/plugins/ai-call-agent/`
3. Activate through the WordPress Plugins menu

## Configuration

### Step 1: Get Your Credentials

1. Sign up at [admin.callagentai.com](https://admin.callagentai.com)
2. Create an AI assistant
3. Generate an API token (Settings > API Tokens)
4. Copy your Assistant ID from assistant settings

### Step 2: Configure Plugin

1. Go to **Settings > Call Agent AI** in WordPress
2. Enter your **API Token**
3. Enter your **Assistant ID**
4. Choose widget **Position** (bottom-right, bottom-left, etc.)
5. Check **Enable Widget**
6. Click **Save Settings**

That's it! Your AI assistant is now live on your site.

## Usage

### Automatic Widget

The widget automatically appears on all pages once enabled in settings.

### Shortcode

Add the widget to specific pages:

```
[callagai_widget]
```

With custom parameters:

```
[callagai_widget api_token="xxx" assistant_id="xxx" position="bottom-right"]
```

For the Voice Button widget:

```
[callagai_voice_button]
```

With custom options:

```
[callagai_voice_button button_text="Talk to Us" button_color="#2c3e50" position="inline"]
```

### WordPress Widget

1. Go to **Appearance > Widgets**
2. Drag **Call Agent AI** to your widget area
3. Configure (or use global settings)
4. Save

## Widget Features

### Voice Call Mode

- Real-time audio communication
- Speech-to-text transcription
- AI-powered responses
- Text-to-speech playback
- Visual speaking indicators
- Low latency WebRTC connection

### Chat Mode

- Instant text messaging
- AI-powered responses
- Conversation history
- Typing indicators
- Mobile-friendly interface

## Customization

### Widget Positions

- `bottom-right` (default)
- `bottom-left`
- `top-right`
- `top-left`

### Custom Styling

Add custom CSS to your theme:

```css
/* Customize widget button */
.ai-call-widget-button {
    background: your-gradient !important;
}

/* Customize modal */
.ai-call-widget-modal {
    width: 400px !important;
}
```

## Requirements

- WordPress 5.0 or higher
- PHP 7.4 or higher
- HTTPS enabled (required for microphone access)
- CallAgentAI account

## Browser Support

- Chrome 60+
- Firefox 55+
- Safari 11+
- Edge 79+
- Opera 47+
- Mobile browsers (iOS Safari 11+, Chrome Android 60+)

## API Reference

The widget uses the CallAgentAI API:

### WebSocket Connection

```
wss://admin.callagentai.com/web-media-stream
```

### REST API

```
https://admin.callagentai.com/api/widget/config
https://admin.callagentai.com/api/widget/start-session
```

## Troubleshooting

### Widget Not Appearing

1. Check if plugin is activated
2. Verify API token and Assistant ID
3. Ensure "Enable Widget" is checked
4. Clear browser cache

### Microphone Not Working

1. Ensure site is on HTTPS
2. Check browser permissions
3. Allow microphone access when prompted
4. Try a different browser

### Connection Issues

1. Check internet connection
2. Verify firewall settings
3. Check browser console for errors
4. Contact support if issues persist

## Development

### Local Development

```bash
# Clone repository
git clone https://github.com/callagentai/wordpress-plugin.git

# Symlink to WordPress plugins directory
ln -s $(pwd)/ai-call-agent /path/to/wordpress/wp-content/plugins/

# Activate in WordPress admin
```

### File Structure

```
ai-call-agent/
├── ai-call-agent.php          # Main plugin file
├── includes/
│   ├── class-settings.php     # Admin settings page
│   ├── class-shortcode.php    # Shortcode handler
│   └── class-widget.php       # WordPress widget
├── assets/
│   ├── js/
│   │   └── ai-call-widget.js  # Widget JavaScript
│   └── css/
│       └── ai-call-widget.css # Widget styles
├── readme.txt                 # WordPress.org readme
└── README.md                  # This file
```

## Support

- **Documentation**: [https://callagentai.gitbook.io/docs/](https://callagentai.gitbook.io/docs/)
- **Email**: accounts@callagentai.com
- **Dashboard**: [https://admin.callagentai.com](https://admin.callagentai.com)

## Privacy & Security

- All communication is encrypted (HTTPS/WSS)
- Audio/text transmitted to CallAgentAI servers
- Conversations stored for analytics
- GDPR compliant
- See [Privacy Policy](https://callagentai.com/data-privacy-policies)

## License

This plugin is licensed under the GPL v2 or later.

However, the Call Agent AI platform, API, and associated web services are proprietary and require an active account. The plugin functions as a connector between your WordPress site and the Call Agent AI service.

```
This plugin is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This plugin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
```

## Changelog

### 1.0.0 (2025-01-10)

- Initial release
- Voice call functionality
- Text chat functionality
- Shortcode support
- WordPress widget support
- Customizable positioning
- Mobile responsive design

## Credits

Developed by [Call Agent AI](https://callagentai.com)