manifest / integrations / ringcx_plugin_callback_wordpress
RingCX_Plugin_Callback_WordPress
WordPress plugin: floating callback-request widget that creates RingCX leads and schedules agent or campaign/group callbacks via the RingCX REST API
by Patrick Heller · github.com/patrickheller/ringcx_plugin_callback_wordpress
★ 1stars
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/patrickheller/ringcx_plugin_callback_wordpress/archive/refs/heads/main.zipCallBack4RingCX – RingCX Callback Widget for WordPress
A WordPress plugin that adds a floating "Request Callback" button to any page. Visitors fill out a short form (name, phone number, preferred date/time, message) and the plugin creates a lead directly in RingCX via the RingCX REST API, then schedules either:
- an agent callback, reserved for a specific agent at the requested time, or
- a group/campaign callback, requeued into a dial group's campaign with a calculated delay.
Features
- Floating callback button + modal form, rendered site-wide via
wp_footer - Visitor-selectable callback target: named agent or campaign/group
- OAuth2 JWT-bearer authentication against RingCentral, exchanged for a RingCX access token, with automatic token refresh/re-authentication
- Admin settings page (Settings → CallBack4RingCX) for API credentials, base URL, default campaign, dial priority, duplicate handling, list state, timezone options, widget texts, and privacy notice
- RingCX campaign and agent-group dropdowns auto-populated live from the RingCX Admin API once credentials are configured
- Automatic phone-number origin-country detection
(via
giggsey/libphonenumber-for-php) for RingCX'snumberOriginCountryfield - Honeypot field for basic spam protection; nonce-protected AJAX endpoints
- Debug logging gated behind
WP_DEBUG
Requirements
- WordPress 5.x+, PHP 7.4+
- Composer dependency
giggsey/libphonenumber-for-php(bundled invendor/, seecomposer.json) - A RingCentral app configured for JWT-bearer OAuth with access to the RingCX Voice APIs
- A RingCX account with at least one campaign (and optionally an agent group) to receive the leads
Installation
- Copy the plugin folder into
wp-content/plugins/callback4ringcx, or install it as a zip via WP Admin → Plugins → Add New → Upload. - Activate the plugin.
- Go to Settings → CallBack4RingCX and fill in:
- RingCentral Client ID / Client Secret / JWT assertion
- RingCX Base URL (default
https://ringcx.ringcentral.com/voice/api/v1) - Default campaign, dial priority, duplicate handling, list state, timezone options
- Widget texts (button label, success message, privacy notice)
- Save. The plugin authenticates immediately and, on success, auto-fills the RingCX account ID and lets you pick campaigns/agent groups from live dropdowns.
How it works
CallBack4RingCX_Public::render_widget()outputs the button and modal in the site footer (only when the widget is enabled).- On submit, the form posts via AJAX, nonce- and honeypot-checked
(
CallBack4RingCX_Ajax::handle_submit()). CallBack4RingCX_API::get_valid_ringcx_token()returns a cached token, refreshes it, or performs the full RingCentral JWT → RingCX token exchange.- A lead is uploaded to RingCX
(
.../campaigns/{id}/leadLoader/direct). - Depending on the chosen target:
- Agent –
set_scheduled_callback()reserves the lead for a specific agent at the requested date/time (CALLBACK_LEADSaction). - Group/Campaign –
set_group_callback()requeues the lead into the campaign with a delay calculated from the requested time (MANUAL_LEADSaction).
- Agent –
- The visitor sees a success message; failures surface a user-facing error while the RingCX error details are written to the debug log.
File structure
callback4ringcx.php– plugin bootstrapincludes/class-callback4ringcx.php– hook wiringincludes/class-callback4ringcx-settings.php– settings storage & defaultsincludes/class-callback4ringcx-api.php– RingCentral/RingCX API client (auth, campaigns, agent groups, leads, callbacks)admin/class-callback4ringcx-admin.php(+admin/views/settings-page.php) – settings UIpublic/class-callback4ringcx-public.php– frontend widget markup & asset enqueueingpublic/class-callback4ringcx-ajax.php– AJAX submission handlersassets/callback-widget.{css,js}– frontend styling and behaviour
Notes
- The plugin talks to RingCX directly from the WordPress server; no callback data passes through a CRM.
- RingCX access/refresh tokens are stored in the WordPress options table
(
callback4ringcx_settings) — handle database backups accordingly.