Listeo Perfex CRM Sync
Custom WordPress plugin that will send HTTP (POST/PUT) requests to a specified Perfex CRM API URL whenever specific actions happen inside our WordPress site (Listeo theme).
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/stormylife/custom-wordpress-plugin/archive/refs/heads/main.zipListeo Perfex CRM Sync Plugin
A WordPress plugin that automatically syncs Listeo theme bookings, listings, and user data with Perfex CRM via API.
Features
🎫 Booking Synchronization
Automatically sends booking data to Perfex CRM when:
- A new booking is created
- A booking is approved by admin/host
- A booking is paid by user
- A booking is cancelled by user
- A booking is cancelled by admin
- A booking is completed
🏠 Listing Synchronization
Automatically sends listing data to Perfex CRM when:
- A listing is created (pending review)
- A listing is approved/published
- A listing is rejected
- A listing is expired
- A listing is deleted
👤 User Synchronization
Automatically sends user data to Perfex CRM when:
- A new user (host or customer) registers
⚙️ Admin Features
- Settings Page: Configure Perfex CRM API credentials
- Enable/Disable Events: Toggle individual sync events on/off
- Connection Testing: Test your API connection before going live
- Sync Logs: View detailed logs of all sync operations
- Statistics Dashboard: See success/failure rates at a glance
- Manual Retry: Retry failed requests individually or automatically
- Data Inspection: View full request/response data for debugging
Installation
-
Upload the Plugin
- Upload the
listeo-perfex-sync-customfolder to/wp-content/plugins/ - Or install via WordPress admin: Plugins → Add New → Upload Plugin
- Upload the
-
Activate the Plugin
- Go to Plugins page in WordPress admin
- Click "Activate" on the Listeo Perfex CRM Sync plugin
-
Configure Settings
- Navigate to Perfex Sync → Settings in WordPress admin
- Enter your Perfex CRM Base URL (e.g.,
https://your-perfex-crm.com) - Enter your Perfex CRM API Key
- Click "Test Connection" to verify the setup
- Enable/disable specific sync events as needed
- Save changes
Configuration
API Credentials
You need to obtain an API key from your Perfex CRM installation:
- Log in to Perfex CRM as administrator
- Navigate to Setup → API
- Create a new API key or use an existing one
- Copy the API key to the plugin settings
Event Configuration
Each sync event can be enabled or disabled individually:
Booking Events:
- ✅ Booking Created
- ✅ Booking Approved
- ✅ Booking Paid
- ✅ Booking Cancelled by User
- ✅ Booking Cancelled by Admin
- ✅ Booking Completed
Listing Events:
- ✅ Listing Created (Pending Review)
- ✅ Listing Approved/Published
- ✅ Listing Rejected
- ✅ Listing Expired
- ✅ Listing Deleted
User Events:
- ✅ User Registration
Retry Settings
Configure automatic retry behavior for failed requests:
- Automatic Retry: Enable/disable automatic retry
- Max Retries: Set maximum number of retry attempts (1-10)
- Failed requests are automatically retried every hour via WordPress cron
Usage
Viewing Sync Logs
- Navigate to Perfex Sync → Logs
- View all sync operations with their status
- Filter by status (Success/Failed) or type (Booking/Listing/User)
- Click "View Data" to inspect request/response details
- Click "Retry" to manually retry failed requests
Statistics Dashboard
The logs page displays real-time statistics:
- Total sync operations
- Successful syncs (green)
- Failed syncs (red)
Manual Retry
For failed sync operations:
- Go to Perfex Sync → Logs
- Find the failed log entry
- Click the "Retry" button
- The request will be resent immediately
Clear Logs
To clear old logs:
- Go to Perfex Sync → Logs
- Click "Clear All Logs" button
- Confirm the action
Data Structure
Booking Data
array(
'booking_id' => 123,
'booking_status' => 'confirmed',
'listing' => array(
'id' => 456,
'title' => 'Luxury Apartment',
'url' => 'https://accomthai.com/listing/luxury-apartment'
),
'customer' => array(
'id' => 789,
'name' => 'John Doe',
'email' => 'john@example.com',
'phone' => '+1234567890'
),
'host' => array(
'id' => 101,
'name' => 'Jane Smith',
'email' => 'jane@example.com'
),
'dates' => array(
'start' => '2025-10-15',
'end' => '2025-10-20'
),
'price' => 500.00,
'comment' => 'Special request...',
'created_at' => '2025-10-10 14:30:00',
'modified_at' => '2025-10-10 14:30:00'
)
Listing Data
array(
'listing_id' => 456,
'title' => 'Luxury Apartment',
'description' => 'Full description...',
'status' => 'publish',
'url' => 'https://accomthai.com/listing/luxury-apartment',
'author' => array(
'id' => 101,
'name' => 'Jane Smith',
'email' => 'jane@example.com'
),
'contact' => array(
'address' => '123 Main St, City',
'phone' => '+1234567890',
'email' => 'contact@example.com',
'website' => 'https://example.com'
),
'location' => array(
'address' => '123 Main St, City',
'latitude' => '40.7128',
'longitude' => '-74.0060'
),
'pricing' => array(
'price' => 100.00,
'price_range' => '$$'
),
'categories' => array('Hotels', 'Apartments'),
'regions' => array('New York'),
'featured_image' => 'https://accomthai.com/wp-content/uploads/...',
'created_at' => '2025-10-10 14:30:00',
'modified_at' => '2025-10-10 14:30:00'
)
User Data
array(
'user_id' => 789,
'username' => 'johndoe',
'email' => 'john@example.com',
'first_name' => 'John',
'last_name' => 'Doe',
'display_name' => 'John Doe',
'role' => 'customer', // or 'host', 'admin'
'roles' => array('customer'),
'contact' => array(
'phone' => '+1234567890',
'company' => 'Acme Inc',
'address' => '123 Main St',
'city' => 'New York',
'state' => 'NY',
'postcode' => '10001',
'country' => 'US'
),
'registered_at' => '2025-10-10 14:30:00',
'profile_url' => 'https://accomthai.com/author/johndoe'
)
API Endpoints
The plugin sends requests to the following Perfex CRM API endpoints:
- Bookings:
/api/bookings - Listings:
/api/listings - Users:
/api/contacts
You can customize these endpoints by filtering the data in your theme or another plugin.
Filters & Hooks
Modify Booking Data
add_filter('listeo_perfex_sync_booking_data', function($data, $booking_id) {
// Modify booking data before sending to Perfex
$data['custom_field'] = 'custom_value';
return $data;
}, 10, 2);
Modify Listing Data
add_filter('listeo_perfex_sync_listing_data', function($data, $listing_id) {
// Modify listing data before sending to Perfex
$data['custom_field'] = 'custom_value';
return $data;
}, 10, 2);
Modify User Data
add_filter('listeo_perfex_sync_user_data', function($data, $user_id) {
// Modify user data before sending to Perfex
$data['custom_field'] = 'custom_value';
return $data;
}, 10, 2);
Troubleshooting
Connection Issues
If the connection test fails:
- Check API URL: Ensure the URL is correct and includes
https:// - Verify API Key: Confirm the API key is valid and active in Perfex CRM
- Check Firewall: Ensure your server can make outbound HTTPS requests
- SSL Certificate: Verify your Perfex CRM has a valid SSL certificate
Failed Syncs
If syncs are failing:
- Check Logs: View error messages in Perfex Sync → Logs
- View Data: Click "View Data" to see what was sent
- API Response: Check the response from Perfex CRM for error details
- Retry: Use the "Retry" button to resend failed requests
No Events Triggering
If events aren't triggering:
- Check Event Settings: Ensure events are enabled in settings
- Verify Hooks: Confirm Listeo theme is properly firing hooks
- Check Post Types: Ensure booking/listing post types exist
- Debug Mode: Enable WordPress debug mode to see PHP errors
Performance Issues
For high-volume sites:
- Disable Unnecessary Events: Only enable events you need
- Increase Timeout: Add to
wp-config.php:define('WP_HTTP_TIMEOUT', 60); - Use Caching: Ensure you have proper server-side caching
- Clear Old Logs: Regularly clear old logs to keep database lean
Database
The plugin creates one custom table:
wp_listeo_perfex_sync_logs
Stores all sync operation logs:
id: Unique log IDevent_type: booking, listing, or userevent_action: created, approved, paid, etc.data: Serialized request dataresponse: API responsestatus: success or failederror_message: Error details if failedcreated_at: Timestampretries: Number of retry attempts
Requirements
- WordPress 5.0 or higher
- PHP 7.2 or higher
- Listeo theme or compatible theme
- Perfex CRM installation with API enabled
- SSL certificate (HTTPS) recommended
Support
For issues, questions, or feature requests:
- Check the plugin logs for error details
- Review this README and troubleshooting section
- Contact your Perfex CRM administrator for API issues
- Contact the plugin developer for WordPress-specific issues
Changelog
Version 1.0.0
- Initial release
- Booking synchronization
- Listing synchronization
- User synchronization
- Admin settings page
- Sync logs viewer
- Automatic retry mechanism
- Connection testing
- Statistics dashboard
License
GPL v2 or later
Credits
Developed for WordPress sites using Listeo theme with Perfex CRM integration.