FastComments.com

Add Live Commenting to WordPress Sites on Pagely

This guide covers installing the FastComments WordPress plugin on a site hosted on Pagely, and the parts of the Pagely platform that affect the plugin: the PressCACHE page cache, the server cron that runs WordPress scheduled tasks, and the domains used by staging and preview sites.

Pagely runs standard WordPress, so comments on a Pagely site are handled by the WordPress comment system or by an installed comment plugin. The FastComments plugin replaces the theme's comment section with the FastComments widget. Plugin setup, comment import, moderation, notifications, and SSO work the same way as on any WordPress site and are documented in the WordPress guide.

This tutorial requires a FastComments account. You can create an account here.

Install the Plugin Internal Link

In the WordPress admin, go to Plugins > Add Plugin, search for FastComments, click Install Now, and then Activate. The plugin can also be downloaded from wordpress.org and uploaded with Plugins > Add Plugin > Upload Plugin.

After activation, click FastComments in the admin menu. The setup asks whether your account is in the EU, connects the site to a FastComments account, and can upload the site's existing WordPress comments. Keep the setup page open until the upload finishes. Each setup step, as well as moderation, notifications, and SSO, is described in the WordPress guide.

Pagely Plugin Policies

FastComments is not on Pagely's list of disallowed plugins.

Pagely updates WordPress plugins automatically, so new releases of the FastComments plugin are installed without manual updates.

Network Requirements

All communication between the plugin and FastComments is outbound HTTPS from the WordPress server to fastcomments.com, or eu.fastcomments.com for EU accounts. Comments are synced back to WordPress by the WordPress server polling FastComments, so FastComments does not open inbound connections to the site. Pagely requires a support ticket and an IP allowlist entry in its WAF only for inbound connections from external systems, so no request to Pagely support is needed for FastComments.

Page Cache Internal Link

PressCACHE is Pagely's NGINX-based page cache. The FastComments widget is rendered in the visitor's browser: the cached HTML contains a <div id="fastcomments-widget"> element and a script that loads from cdn.fastcomments.com (cdn-eu.fastcomments.com for EU accounts). For visitors who are not logged in to WordPress, the widget configuration in the page identifies only the post, so the same cached page can be served to all of them. New comments appear without a cache purge.

Purging the Cache After Activation

Pages cached before the plugin was activated still contain the theme's previous comment section. PressCACHE purges relevant pages automatically when a post is modified or published, but activating a plugin does not modify any post. Purge all cached pages once after the FastComments setup finishes, using one of the methods in Pagely's purge instructions:

  • WordPress admin: click Pagely, then App Dashboard, and press Purge All Caches + CDN.
  • Atomic control panel: click Apps in the left menu, select the app, click the CDN icon below the app's name, and click Purge Cache. The Last Purged date updates to the current time.
  • WP-CLI over SSH, from the site's home directory (Clearing Your WordPress Site's Cache with WP-CLI):
Purge the Pagely Page Cache and CDN
Copy Copy
1
2wp pagely purge-nginx '*'
3wp pagely purge-cdn
4

Logged-In Users and SSO

When the plugin's SSO option is enabled, each page includes an SSO payload for the WordPress user who is logged in. PressCACHE does not serve cached pages to visitors who are logged in to WordPress (What Is PressCACHE and How Does It Work), so a page that contains one user's SSO payload is not served to another visitor.

Pagely can set up custom cache keys, including a key that serves cached pages to logged-in users. Do not use a rule that caches pages for logged-in users while FastComments SSO is enabled.

PressCDN

PressCDN delivers the site's static assets, such as CSS, JavaScript, images, and fonts. The FastComments script and the widget's API requests go to FastComments servers, not to the site's domain, so PressCDN does not cache them.

WP-Cron and Comment Sync Internal Link

The plugin copies new comments, edits, and deletions from FastComments into the WordPress database with a WP-Cron event, fastcomments_cron_hook. The interval is set with Sync Interval under Advanced Settings on the FastComments plugin page: every 24 hours (the default), every hour, every 15 minutes, or every 5 minutes. A large initial comment import also continues in the background through one-off WP-Cron events.

How Pagely Runs WP-Cron

On Pagely, WP-Cron does not run on page loads. A server-level cron runs due WordPress scheduled tasks every three minutes by default on VPS plans, and the interval can be adjusted (Does Pagely Have Any Cron Mechanisms). The FastComments sync runs on schedule whether or not pages are served from the cache, up to about three minutes after it is due. No configuration change is needed.

The WordPress dashboard may show a notice that DISABLE_WP_CRON is set to true and that scheduled tasks are not running. Pagely documents this notice as expected behavior: scheduled tasks are run by the server cron instead (WordPress Cron Disabled Warnings).

Checking the Sync Event

Over SSH, list the sync event and its next run time with WP-CLI, or run it immediately:

Check the FastComments Sync Event
Copy Copy
1
2wp cron event list --hook=fastcomments_cron_hook
3wp cron event run fastcomments_cron_hook
4

A sync can also be started from the FastComments plugin page with Manually Sync.

Customization Internal Link

Styling and configuration options for the widget are described in the Customization Documentation.

Customization rules created in your FastComments account are loaded by the widget in the browser, so they apply to pages already in the Pagely page cache without a purge.

Plugin settings, such as the widget type and the sync interval, are under Advanced Settings on the FastComments plugin page in the WordPress admin.