# GHL Contacts Manager

A WordPress plugin that provides seamless integration with GoHighLevel CRM for comprehensive contact and opportunity management.

## Description

GHL Contacts Manager is a powerful WordPress plugin that enables you to manage your GoHighLevel contacts, opportunities, and business pipelines directly from your WordPress admin panel. The plugin features a modern, responsive interface with drag-and-drop functionality for managing sales pipelines.

## Features

- **Contact Management**: View, create, and manage all your GoHighLevel contacts
- **Opportunity Pipeline**: Visual Kanban board for managing sales opportunities
- **Drag & Drop Interface**: Move opportunities between pipeline stages with ease
- **Task Management**: Create and assign tasks to contacts and team members
- **Appointment Scheduling**: Schedule appointments with integrated calendar support
- **Real-time Sync**: Automatic synchronization with your GoHighLevel account
- **Professional UI**: Modern, responsive interface designed for business use

## Requirements

- WordPress 5.0 or higher
- PHP 7.4 or higher
- GoHighLevel account with API access
- Valid GoHighLevel API key and Location ID

## Installation

1. Upload the plugin files to the `/wp-content/plugins/ghl-contacts-manager` directory
2. Activate the plugin through the 'Plugins' screen in WordPress
3. Go to GHL Contacts Manager settings
4. Enter your GoHighLevel API key and Location ID
5. Start managing your contacts and opportunities!

## Configuration

### API Setup

1. Log in to your GoHighLevel account
2. Navigate to Settings > API Keys
3. Generate a new API key
4. Note your Location ID from the account settings
5. Enter both values in the plugin settings

### Permissions

The plugin requires the following WordPress capabilities:
- `manage_options` - For accessing settings and main functionality

## Usage

### Managing Contacts

1. Navigate to "GHL Contacts" in the WordPress admin menu
2. View all your GoHighLevel contacts in a paginated table
3. Click on any contact name to view detailed information
4. Use the "Add Contact" button to create new contacts
5. Search and filter contacts using the provided tools

### Managing Opportunities

1. Navigate to "GHL Opportunities" in the WordPress admin menu
2. Select a pipeline from the dropdown menu
3. View opportunities organized by pipeline stages
4. Drag and drop opportunities between stages to update their status
5. View stage statistics and opportunity values

### Creating Tasks

1. Click the "Add Task" button from any contact or opportunity view
2. Fill in the task details including title, description, and due date
3. Assign the task to a contact and team member
4. Submit to create the task in GoHighLevel

## Development

### File Structure

```
ghl-contacts-manager/
├── ghl-contacts-manager.php      # Main plugin file
├── readme.txt                    # WordPress.org readme
├── license.txt                   # GPL license
├── uninstall.php                 # Uninstall script
├── .gitignore                    # Git ignore file
├── includes/                     # PHP classes
│   ├── class-ghl-settings.php
│   ├── class-ghl-api.php
│   ├── class-ghl-contacts.php
│   ├── class-ghl-opportunities.php
│   └── class-ghl-appointments.php
├── js/                          # JavaScript files
│   ├── contacts.js
│   ├── opportunities.js
│   └── appointment.js
├── css/                         # CSS files
│   └── appointment.css
├── assets/                      # Additional assets
│   ├── css/
│   │   └── ghl-opportunities.css
│   └── screenshots/
└── languages/                   # Translation files
    └── ghl-contacts-manager.pot
```

### Hooks and Filters

The plugin provides several hooks for customization:

#### Actions
- `ghl_contacts_manager_init` - Fired after plugin initialization
- `ghl_contact_created` - Fired when a new contact is created
- `ghl_opportunity_updated` - Fired when an opportunity is updated

#### Filters
- `ghl_contact_fields` - Modify contact form fields
- `ghl_opportunity_stages` - Modify opportunity stages display
- `ghl_api_request_args` - Modify API request arguments

### API Integration

The plugin uses the GoHighLevel REST API v1. All API calls are handled through the `GHL_API` class, which provides methods for:

- Contact management (CRUD operations)
- Opportunity management
- Pipeline and stage management
- Task creation and management
- Appointment scheduling

## Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request

## Support

For support, documentation, and updates, visit our [official website](https://yourwebsite.com/ghl-contacts-manager).

## Changelog

### 1.0.0
- Initial release
- Contact management functionality
- Opportunity pipeline with Kanban board
- Task creation and management
- Appointment scheduling
- GoHighLevel API integration
- Professional admin interface

## License

This plugin is licensed under the GPL v2 or later.

## Credits

Developed by [Your Name](https://yourwebsite.com)

## Security

To report security issues, please contact [security@yourwebsite.com](mailto:security@yourwebsite.com) 