WP Manifestindependent plugin directory
manifest / integrations / custom-wordpress-plugin

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).

by Benjamin Wilson · github.com/stormylife/custom-wordpress-plugin · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/stormylife/custom-wordpress-plugin/archive/refs/heads/main.zip

Listeo 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

  1. Upload the Plugin

    • Upload the listeo-perfex-sync-custom folder to /wp-content/plugins/
    • Or install via WordPress admin: Plugins → Add New → Upload Plugin
  2. Activate the Plugin

    • Go to Plugins page in WordPress admin
    • Click "Activate" on the Listeo Perfex CRM Sync plugin
  3. Configure Settings

    • Navigate to Perfex SyncSettings 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:

  1. Log in to Perfex CRM as administrator
  2. Navigate to Setup → API
  3. Create a new API key or use an existing one
  4. 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

  1. Navigate to Perfex SyncLogs
  2. View all sync operations with their status
  3. Filter by status (Success/Failed) or type (Booking/Listing/User)
  4. Click "View Data" to inspect request/response details
  5. 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:

  1. Go to Perfex SyncLogs
  2. Find the failed log entry
  3. Click the "Retry" button
  4. The request will be resent immediately

Clear Logs

To clear old logs:

  1. Go to Perfex SyncLogs
  2. Click "Clear All Logs" button
  3. 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:

  1. Check API URL: Ensure the URL is correct and includes https://
  2. Verify API Key: Confirm the API key is valid and active in Perfex CRM
  3. Check Firewall: Ensure your server can make outbound HTTPS requests
  4. SSL Certificate: Verify your Perfex CRM has a valid SSL certificate

Failed Syncs

If syncs are failing:

  1. Check Logs: View error messages in Perfex SyncLogs
  2. View Data: Click "View Data" to see what was sent
  3. API Response: Check the response from Perfex CRM for error details
  4. Retry: Use the "Retry" button to resend failed requests

No Events Triggering

If events aren't triggering:

  1. Check Event Settings: Ensure events are enabled in settings
  2. Verify Hooks: Confirm Listeo theme is properly firing hooks
  3. Check Post Types: Ensure booking/listing post types exist
  4. Debug Mode: Enable WordPress debug mode to see PHP errors

Performance Issues

For high-volume sites:

  1. Disable Unnecessary Events: Only enable events you need
  2. Increase Timeout: Add to wp-config.php:
    define('WP_HTTP_TIMEOUT', 60);
  3. Use Caching: Ensure you have proper server-side caching
  4. 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 ID
  • event_type: booking, listing, or user
  • event_action: created, approved, paid, etc.
  • data: Serialized request data
  • response: API response
  • status: success or failed
  • error_message: Error details if failed
  • created_at: Timestamp
  • retries: 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:

  1. Check the plugin logs for error details
  2. Review this README and troubleshooting section
  3. Contact your Perfex CRM administrator for API issues
  4. 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.