
Language 🇺🇸 English
Pantheon Installation
WordPress on Pantheon
Drupal on Pantheon
Pantheon Hosting
Add Live Commenting to WordPress and Drupal Sites on Pantheon
This guide covers installing FastComments on a WordPress or Drupal site hosted on Pantheon, and the Pantheon features that affect the integration: the Dev, Test, and Live workflow, Integrated Composer, the Global CDN, and Pantheon Cron.
Pantheon hosts WordPress and Drupal sites. Both use their core comment systems by default, which store comments in each environment's database. The FastComments WordPress plugin and Drupal module replace the core comment system with the FastComments widget. Their setup, moderation, and SSO options are described in the WordPress guide and the Drupal guide. This guide does not repeat them.
This tutorial requires a FastComments account. You can create an account here.
Quick Start 
Code is added on the Dev environment and deployed to Test and Live. Each environment has its own database, so the plugin or module is activated and configured on each environment.
WordPress
- Set the Dev environment to SFTP connection mode, install the FastComments plugin from
Plugins > Add Newin the Dev site's WordPress dashboard, and commit the change in the Pantheon Site Dashboard. - Deploy the code to Test and Live, and activate the plugin on Live.
- Run the FastComments setup on Live.
- Optionally, choose
Every houras theSync Intervalin the plugin'sAdvanced Settings. Pantheon Cron runs WP-Cron once an hour.
Drupal
- In a local clone of the site repository, run
composer require drupal/fcom, commitcomposer.jsonandcomposer.lock, and push to Dev. - Enable the module with
terminus drush <site>.dev -- en fastcomments -y, and configure it at/admin/config/content/fastcomments. - Deploy the code to Test and Live, then enable and configure the module on each environment.
Both
Add the site's custom domain and the pantheonsite.io domains you use on the domain configuration page. No Global CDN settings need to change.
Install the Plugin 
On Pantheon, code can only be added or changed on the Dev environment (and Multidev environments). Test and Live receive code through deploys, and their code is read-only. Installing a plugin from the WordPress dashboard works only on Dev in SFTP connection mode. If WordPress asks for FTP credentials, the environment or the connection mode is wrong.
Install on Dev
- In the Pantheon Site Dashboard, open the
Devtab, selectCode, and set the connection mode toSFTP. - Click
Site Adminto open the WordPress dashboard of Dev. - Go to
Plugins > Add New, search forFastComments, and clickInstall Now. - Return to the Site Dashboard, review the pending changes, enter a commit message, and click
Commit.
The plugin is also available from wordpress.org/plugins/fastcomments. Sites based on Pantheon's wordpress-composer-managed upstream add plugins with Composer instead, from the WordPress.org mirror configured in the site's composer.json (WPackagist or WP Packages).
Deploy to Test and Live
- Open the
Testtab, selectDeploys, and clickDeploy Code from Development to Test Environment. - Open the
Livetab, selectDeploys, and clickDeploy Code from Test to Live Environment.
Plugin activation is stored in the database, and each environment has its own database. Activate the plugin on each environment where you want FastComments, from Plugins in that environment's WordPress dashboard.
The same steps with Terminus:

Run the Setup on Live
Click FastComments in the WordPress left navigation of the Live site and follow the setup steps. The Live database holds the site's current comments, so run the setup there to upload them to FastComments. The setup is described in the WordPress guide.
Network Requirements
All requests made by the plugin are outbound HTTPS requests from Pantheon to fastcomments.com, or to eu.fastcomments.com for EU accounts. The plugin's REST routes under /wp-json/fastcomments/v1/api/ are used by the plugin's admin pages and require an administrator.
Cron and Comment Sync 
The plugin copies comments from FastComments back into the WordPress database with a WP-Cron event, fastcomments_cron_hook. The copy is kept for backups and for plugins that read WordPress comments. Comments are shown to visitors from FastComments, so the sync schedule does not affect what visitors see.
Sync Interval
Choose how often the sync runs with the Sync Interval setting on the plugin's Advanced Settings page:
- Every 24 hours (default)
- Every hour
- Every 15 minutes
- Every 5 minutes
How Pantheon Runs WP-Cron
Pantheon's WordPress upstream disables WP-Cron on page requests. Pantheon Cron runs wp cron event run --due-now once an hour on each environment instead. It does not run on environments that are idle and have spun down, and a cron run can take at most 180 seconds (Pantheon Docs: Cron for WordPress).
The Every 24 hours and Every hour intervals run on schedule with Pantheon Cron. The Every 15 minutes and Every 5 minutes intervals run at most once an hour, unless an external service calls the site's cron. To run cron more often, Pantheon's documentation describes disabling WP-Cron in wp-config.php above the require_once for wp-config-pantheon.php, and calling https://example.com/wp-cron.php?doing_wp_cron from an external cron service, for example every 15 minutes.
On WordPress Multisite, Pantheon Cron is disabled by default and standard WP-Cron runs on page requests.
Initial Comment Upload
During setup, the plugin uploads existing WordPress comments to FastComments while the setup page is open. If the setup page is closed before the upload finishes, the upload continues through one-off WP-Cron events, which on Pantheon run with Pantheon Cron once an hour. Keep the setup page open until the upload completes.
Running the Sync Manually
The sync can be started at any time from the plugin dashboard with Manually Sync, as described in the WordPress guide. With Terminus, run the due WP-Cron events of an environment:

Install the Module 
The FastComments module is published at drupal.org/project/fcom. It supports Drupal 10 and 11 and requires PHP 8.1 or newer. The Composer package is drupal/fcom and the module's machine name is fastcomments. It depends only on the core user and field modules.
Add the Module with Integrated Composer
Drupal sites on Pantheon's drupal-composer-managed upstream use Integrated Composer. Pantheon runs composer install when code is pushed, using the committed composer.lock, so only composer.json and composer.lock are committed. Installing modules from the Drupal admin interface does not update composer.json, and modules added that way are removed by the next build.
- In the Pantheon Site Dashboard, open the
Devtab, selectCode, and set the connection mode toGit. - Click
Clone with Gitand run the clone command in a terminal. - In the clone, add the module and push the change:

The Dev environment tracks the master branch. Pantheon runs Composer and deploys the change to Dev.
Enable and Configure on Dev
Enable the module with Terminus, or from Extend (/admin/modules) on the Dev site:

Configure the Tenant ID, API Secret, and SSO mode at Administration > Configuration > Content > FastComments (/admin/config/content/fastcomments), and add the FastComments field to content types. These steps, and the options for storing the API Secret outside the database, are described in the Drupal guide.
Deploy to Test and Live
- Open the
Testtab, selectDeploys, and clickDeploy Code from Development to Test Environment. - Open the
Livetab, selectDeploys, and clickDeploy Code from Test to Live Environment.
A deploy moves code only. Module status and module configuration are stored in each environment's database. Enable and configure the module on Test and Live, or deploy the configuration with your configuration management workflow:

Cron
The module does not use Drupal cron, so Pantheon's hourly cron does not affect it. The widget loads comments from FastComments in the browser when a page is viewed.
Webhook URL
The module's settings page shows a webhook URL (/fastcomments/webhook) to configure in the FastComments webhooks page for comment notification emails. The URL is built from the domain of the environment the settings page is opened on. Open the settings page on Live with the site's custom domain, so the webhook points to Live and not to a pantheonsite.io domain.
Page Cache 
Pantheon's Global CDN caches full pages. FastComments works with it without cache rules or exclusions, on both WordPress and Drupal.
Anonymous Visitors
The WordPress plugin and the Drupal module output a container element and a script that loads from cdn.fastcomments.com and calls FastCommentsUI. Comments are loaded in the visitor's browser, not rendered into the HTML. The widget configuration in the page is the same for every anonymous visitor of a page, so cached pages are correct for all anonymous visitors, and new comments appear without clearing the cache.
The Drupal module also adds the user cache context and the config:fastcomments.settings cache tag to its output, so Drupal's own render cache varies the widget per user and invalidates it when the module settings are saved.
Logged-In Users and SSO
With SSO enabled, the page HTML contains the SSO payload of the logged-in user. The Global CDN does not cache requests that carry a session cookie. Pantheon's list of cache-busting cookie patterns includes (Pantheon Docs: Working with Cookies):
S+ESS[a-z0-9]+, which matches Drupal'sSESSandSSESSsession cookies.wordpress[A-Za-z0-9_]*, which matches WordPress'swordpress_logged_in_cookie.
Requests from logged-in users bypass the cache, so an SSO payload is never stored in a cached page or served to another visitor. The cookie list is set by Pantheon for the whole platform and cannot be changed per site.
Clearing the Cache
Clear the cache of an environment after enabling, configuring, or removing FastComments on it:
- In the Site Dashboard, open the environment and click
Clear Caches. This clears the environment's caches and the Global CDN. - With Terminus:

When deploying to Live from the dashboard, the Clear Caches option clears the cache as part of the deploy. Widget customizations made in the FastComments dashboard do not require clearing the cache, because the widget loads them in the browser.
Environments and Domains 
Platform Domains
Each Pantheon environment is served on a platform domain:
- Dev:
dev-<site>.pantheonsite.io - Test:
test-<site>.pantheonsite.io - Live:
live-<site>.pantheonsite.io - Multidev:
<env>-<site>.pantheonsite.io
FastComments only loads on domains that are listed on the domain configuration page of your account. Add the Live site's custom domain, and each platform domain on which you view the site with FastComments enabled.
Code and Content Between Environments
Code moves up from Dev to Test to Live through deploys. Content moves down: each environment has its own database and files, and Test and Dev can be refreshed with a copy of Live's database. The FastComments plugin or module therefore has to be activated or enabled on each environment, and its settings are stored per environment.
When Test or Dev receives a copy of Live's database, the copy includes the FastComments settings saved on Live.
Comment Threads on Dev and Test
The comment thread of a page is identified by content ID, not by domain. The WordPress plugin uses the post ID, and the Drupal module uses drupal-<entity type>-<entity ID> unless the field sets a custom identifier. When Dev or Test has a copy of Live's database and uses the same FastComments account, a post on Dev or Test shows the same comment thread as on Live, and comments posted there appear on Live. Delete test comments in the FastComments moderation dashboard.
On WordPress, the copied database also contains the token that connects the plugin to FastComments, so the Dev or Test site runs its own comment sync with the same account. Deactivate the plugin on Dev and Test when it is not being tested. Deactivating it removes the token from that environment's database and stops the sync there. It does not change Live.
Sleeping Environments
Pantheon Cron does not run on environments that are idle and have spun down. On WordPress, the plugin's sync does not run on an environment while it is spun down. The widget does not depend on cron.
Domain Errors 
The widget may show an authorization error like the following:
This error means the domain of the page is not in the list of domains allowed for your FastComments account.
Add the domain on the domain configuration page of your account. On Pantheon, this includes the pantheonsite.io platform domains of the Dev, Test, Live, and Multidev environments described in Environments and Domains, if the site is viewed on them.
Customization 
Styling and configuration options for the widget are described in the Customization Documentation.
Most options are set on the widget customization page of your FastComments account and apply without code changes or deploys. Options of the WordPress plugin and the Drupal module, such as SSO and the widget type, are covered in the WordPress guide and the Drupal guide. These options are stored in each environment's database, so set them on each environment, then clear that environment's cache as described in Page Cache.