Remote Portal
Remote Portal runs the helpdesk on one WordPress site and the customer portal on another:
| Site | Plugins | Role |
|---|---|---|
| Support site | Fluent Support + Fluent Support Pro | Stores every ticket. Agents work here. |
| Main site | Fluent Support Client (the connector) | Shows the portal to logged-in customers and serves customer data back to the support site. |
The connector calls the support site's REST API with an Application Password for one agent (or administrator) there, and files tickets on behalf of the main site's logged-in customer, matched by email. The support site calls back to the main site with an API token to fetch customer widgets.
The user guide covers the setup screens: Remote Portal. This page covers the wp-config.php connection, the hooks on both sites, and how widgets travel between them.
INFO
Remote Portal replaces the standalone Fluent Support Server plugin. While that plugin is active, Remote Portal stays off and shows a notice. Deactivate it and connect again.
The connection user
The main site acts on the support site as one WordPress user. It must be an administrator, or an agent with all three permissions:
- Sensitive Data (
fst_sensitive_data) - Manage Other Tickets (
fst_manage_other_tickets) - Manage Settings (
fst_manage_settings)
Restrict that agent to the mailbox the portal uses to limit what the main site can reach. Mailbox restrictions apply to every portal request.
Connect with wp-config.php
Instead of a one-time connection key, both sites can read the connection from constants. The support site's Settings > Remote Portal > Use wp-config.php instead writes both snippets with a new token.
The token must be the same on both sites: 32 to 128 letters and digits, for example from openssl rand -hex 32.
Support site
define('FLUENT_SUPPORT_PORTAL_BASE_URL', 'https://example.com/support'); // the portal page on the main site
define('FLUENT_SUPPORT_REMOTE_API_TOKEN', 'TOKEN');| Constant | Required | Meaning |
|---|---|---|
FLUENT_SUPPORT_PORTAL_BASE_URL | yes | The customer portal page on the main site. Its scheme, host and port identify the main site. Ticket emails link here. |
FLUENT_SUPPORT_REMOTE_API_TOKEN | yes | Sent on widget calls to the main site. |
FLUENT_SUPPORT_REMOTE_API_URL | no | The main site's REST base, only if it is not /wp-json. It must be on the main site. |
FLUENT_SUPPORT_REMOTE_PORTAL | no | true or false forces Remote Portal on or off. With the constants above it is on unless this is false. |
FLUENT_SUPPORT_ADMIN_PORTAL_BASE_URL | no | The admin ticket URL used in links, if not the default. |
Main site
define('FLUENT_SUPPORT_SERVER_URL', 'https://support.example.com');
define('FLUENT_SUPPORT_SERVER_USERNAME', 'USERNAME');
define('FLUENT_SUPPORT_SERVER_PASSWORD', 'APPLICATION PASSWORD');
define('FLUENT_SUPPORT_REMOTE_API_TOKEN', 'TOKEN');| Constant | Required | Meaning |
|---|---|---|
FLUENT_SUPPORT_SERVER_URL | yes | The support site. |
FLUENT_SUPPORT_SERVER_USERNAME | yes | The connection user on the support site. |
FLUENT_SUPPORT_SERVER_PASSWORD | yes | That user's Application Password. |
FLUENT_SUPPORT_REMOTE_API_TOKEN | yes | Checked on widget calls from the support site. |
FLUENT_SUPPORT_SERVER_API_URL | no | The support site's REST base, only if it is not /wp-json. |
Then open Settings > FluentSupport Client on the main site, choose the portal page and save. The connector loads the mailbox list and the admin portal link from the support site.
How constant mode behaves
- Nothing from the constants is written to the database. Remove them to fall back to a connection made with a key. While they are set, the user and token of an earlier key connection are ignored.
- The connection key, Disconnect, token rotation and portal URL changes are refused on both sites. Change the constants instead.
- No connect call names a user, so the support site accepts any administrator or agent with the three permissions. The username in the main site's
wp-config.phpdecides who it is.
HTTPS and local sites
Both sites require HTTPS and verify certificates, unless the site sets WP_ENVIRONMENT_TYPE to local or development:
define('WP_ENVIRONMENT_TYPE', 'local');Each side has a filter to override certificate checks; see the hooks below.
Customer widgets from the main site
When an agent opens a ticket on the support site, Fluent Support Pro asks the main site for the customer's widgets. The connector runs the same fluent_support/customer_extra_widgets filter on the main site and returns the result, so a widget written for Fluent Support also works on a main site that runs only the connector.
On the main site, the filter receives:
$widgets(array): empty to start.$customer(object):user_id(the customer's user ID on the main site,0if unknown) andemail. Fluent Support's ownCustomermodel is not available there.$context(array):format(htmlormcp) andkeys(the widget keys asked for, ornullfor all), the same as on the support site.
// On the main site, where only Fluent Support Client runs.
add_filter('fluent_support/customer_extra_widgets', function ($widgets, $customer, $context = null) {
if (!\FluentSupportClient\Classes\DataProviderHandler::wantsWidget($context, 'my_plan')) {
return $widgets;
}
$user = $customer->user_id ? get_user_by('ID', $customer->user_id) : get_user_by('email', $customer->email);
if (!$user) {
return $widgets;
}
$plan = get_user_meta($user->ID, 'my_plan', true);
if (\FluentSupportClient\Classes\DataProviderHandler::isMcpWidgetRequest($context)) {
$widgets['my_plan'] = ['title' => 'Plan', 'mcp' => ['plan' => $plan]];
} else {
$widgets['my_plan'] = ['header' => 'Plan', 'body_html' => '<p>' . esc_html($plan) . '</p>'];
}
return $widgets;
}, 10, 3);On the support site, every widget from the main site is keyed <key>_remote (here my_plan_remote), so it never collides with a widget of the same name on the support site. A caller that asks for specific keys must use the _remote suffix; the support site strips it before calling the main site.
The connector ships widgets for FluentCart (purchases, subscriptions, licenses), Easy Digital Downloads and FluentCRM.
When the main site is down
The support site waits up to 8 seconds for widgets. After a failed call it skips widget calls for one minute, so ticket views stay fast while the main site is down. Test connection on the settings page always calls through.
Hooks on the support site
These existing hooks also apply to Remote Portal:
fluent_support/customer_portal_varsalso filters the portal settings sent to the main site. Those settings are built once for all remote customers, so a callback must not depend on the current user there.fluent_support/portal_base_urlreturns the main site's portal page while a main site is connected, so ticket links in emails point there. Pro hooks it at priority100.
Hooks on the main site
These run in the Fluent Support Client plugin.
fluent_support/customer_extra_widgets also runs on the main site; see Customer widgets from the main site.
