Description
QuantCDN is a CDN engineered for the static web. This plugin works in two modes:
- Static Site: every page, listing, file and redirect is rendered and published to the Quant edge. Content changes are pushed automatically. Visitors never reach WordPress.
- CDN Only: WordPress serves pages behind Quant, and the plugin purges the Quant cache when content changes.
Static mode publishes:
- Posts, pages and public custom post types
- The home page, blog listing, category, tag and custom taxonomy pages, author pages, date and post type archives, including every paginated page
- Media library files with all image sizes, theme assets, and every stylesheet, script, image or document a page references
- Custom routes, the 404 page, robots.txt and sitemaps (WordPress core, Yoast SEO, Rank Math)
- Redirects from the Redirection plugin and from changed post slugs
- Quant Search records, so the Quant Search pages and autocomplete box work on the static site
Also included:
- A React admin under QuantCDN with a dashboard, content browser, cache purge, search configuration, settings and diagnostics
- Sync status in the post lists and the admin bar, with a “Push to Quant” row action
- Login with your Quant account to pick a project, or paste the project credentials
- QuantGov support: set the endpoint to
https://api.quantgov.cloud - WP-CLI commands for scripted pushes and purges, with parallel workers
- Background processing with WP-Cron and an optional scheduled re-push
- Configuration from
QUANT_*environment variables for Quant Cloud
The QuantCDN platform provides forms and search for static sites.
Requires a QuantCDN account.
Upgrading from 1.x
Version 2.0 keeps your settings. On the first page load after the update the plugin copies the 1.x settings (API credentials, automatic push, cache purge on save, webserver URL and host, 404 route, custom routes, relative rewrite domains and cron settings) to the new format. Content pushes continue to work without any action. A notice links to a review page.
The 1.x WP-CLI commands wp quant info, wp quant reset_queue <queue|all> and wp quant process_queue <queue|all> --threads=N keep working.
Version 2.0 requires PHP 8.2. Sites on older PHP are not offered the update and stay on 1.6.
WP-CLI
wp quant status– connection, mode and queue countswp quant sync --all --process– queue the whole site and push itwp quant sync --type=page– queue one content type (post,page,media,taxonomy,home,archives,authors,theme_assets,custom_routes,sitemaps,redirects,search, or a custom post type)wp quant sync 123 456 --process– push specific postswp quant queue process --all --threads=5– process the queue with parallel workerswp quant queue status|retry|clear|errorswp quant purge /pathandwp quant purge --allwp quant unpublish /pathwp quant search --clear --process– rebuild the Quant Search index
Environment variables
Set these to configure the plugin without the admin UI (for example on Quant Cloud): QUANT_API_ENDPOINT, QUANT_CUSTOMER, QUANT_PROJECT, QUANT_TOKEN, QUANT_WEBSERVER_URL, QUANT_WEBSERVER_HOST, QUANT_ENABLED, QUANT_PURGE_ON_SAVE, QUANT_DISABLE_TLS_VERIFY, QUANT_HTTP_REQUEST_TIMEOUT, QUANT_MODE. The same names work as PHP constants in wp-config.php. Overridden fields are read-only in the UI.
QUANT_HTTP_REQUEST_TIMEOUT is the time in seconds that the plugin waits for one answer from the Quant API (default 30, minimum 5). It is the same value as "HTTP request timeout" on the Settings page. File uploads, and pages larger than 512 KB, always get at least 120 seconds. The connection itself must open within 10 seconds (the WordPress HTTP API default). Increase the value if a slow network makes pushes fail with "Quant did not answer in time":
define('QUANT_HTTP_REQUEST_TIMEOUT', 60);
Styling the search page
The search page (the page the plugin creates, the “Quant Search” block and the [quant_search] shortcode) uses the theme’s fonts and text colour. Result titles are in the text colour and are underlined on hover and focus. Lines, count badges, tags and secondary text are mixes of the text colour, so the page also works on a dark theme. The plugin’s own rules apply only inside .quant-search; the bundled InstantSearch.js theme styles the ais- widget classes.
To restyle the page, set these custom properties on .quant-search in the theme stylesheet or in Additional CSS (Appearance > Editor > Styles in a block theme, Appearance > Customize in a classic theme). The plugin defaults have no specificity, so a rule on .quant-search wins in any stylesheet order.
.quant-search {
--quant-search-accent: #1d4ed8;
--quant-search-gap: 1.25rem;
--quant-search-facets-width: 16rem;
}
Spacing and layout:
--quant-search-gap(1rem): the base space. The other spaces are multiples of it, so a change here scales the page.--quant-search-gap-xs,-sm,-md,-lg,-xl(0.25, 0.5, 0.75, 1.5 and 2.5 times the gap).-xlis the space between the facets and the results.--quant-search-facets-width(14rem): the width of the facet column.--quant-search-content-min-width(20rem): the results column is never narrower than this next to the facets.--quant-search-hit-image-width(7.5rem): the result thumbnail width.--quant-search-radius(0.375rem): the corner radius of the search box, buttons, pagination and thumbnails.
Colours:
--quant-search-accent: the checked boxes, the search box border on focus, the current page and the focus ring. Default: the block theme’scontrastcolour, or the text colour.--quant-search-muted: secondary text (result summaries, counts, tags, the result count). Default: 75% of the text colour.--quant-search-border,--quant-search-border-strong: lines and control borders (18% and 45% of the text colour).--quant-search-surface,--quant-search-surface-hover: the count badge and tag background, and the hover background (6% and 10% of the text colour).--quant-search-input-background(transparent): the search box and select background.--quant-search-highlight: the background of the matched words.--quant-search-focus-ring(the accent) and--quant-search-focus-width(2px): the focus outline of every link, button and field.--quant-search-disabled-opacity(0.55): disabled buttons and pagination links.
Type (relative to the theme’s text size):
--quant-search-hit-title-size(1.25em) and--quant-search-hit-summary-size(0.9375em): the result title and summary.--quant-search-facet-heading-size(0.75em): the facet headings.--quant-search-font-size-small(0.875em) and--quant-search-font-size-xsmall(0.8125em): the result count, the “Clear refinements” button, counts and tags.
When the search area is narrower than 37.5rem (for example on a phone), the facets move above the results, side by side when there is room. A facet with no values for the current search is hidden with its heading.
For larger changes, target the classes. They are stable: quant-search, quant-search__description, quant-search__facets, quant-search__clear, quant-search__facet, quant-search__facet-heading, quant-search__content, quant-search__box, quant-search__stats, quant-search__hits, quant-search__hit, quant-search__hit-title, quant-search__hit-summary, quant-search__hit-tag, quant-search__pagination, quant-search__empty, quant-search__fallback (the search form without JavaScript) and quant-search--unavailable. The widgets inside them use the InstantSearch.js ais- classes, for example ais-SearchBox-input, ais-RefinementList-label, ais-RefinementList-count, ais-ClearRefinements-button and ais-Pagination-link.
Installation
- Install from the Plugins screen or upload the
quantdirectory to/wp-content/plugins/. - Activate the plugin.
- Open QuantCDN in the admin menu. Log in to Quant and choose a project, or enter the organisation, project and token from the Integrations page of the Quant dashboard.
- Choose the mode. In Static mode, check Internal connectivity under Settings, then open Content and press Push everything.
FAQ
Where do I find the project credentials?
In the Quant dashboard, open the project and go to Integrations. Copy the organisation (API customer), project name and token.
The internal connectivity test fails
The plugin renders pages by requesting them from the web server. Set Webserver URL to an address the PHP process can reach (for example http://localhost) and Hostname to the public domain. In a container, WP-CLI runs without a web server, so point the Webserver URL at the web container.
How do I use Quant Search?
Enable search for the project in the Quant dashboard, then open QuantCDN > Search, turn on search records and create a search page. Place the “Quant Search” block or [quant_search] shortcode on any page for more search pages, and the “Quant Search Autocomplete” block or [quant_search_autocomplete] shortcode in a header or sidebar.
A push failed with “Quant did not answer in time”
The Quant API did not answer within the HTTP request timeout, or a gateway between your server and Quant was busy (HTTP 502, 503 or 504).
- A page or file push that fails fast (a gateway error, or a refused or reset connection) is sent again up to two times in the same run, after about 1 and 3 seconds.
- A request that timed out is sent again only when another attempt of the same length still fits in 45 seconds. With the default 30 second timeout it is not sent again in the same run; with a 10 second timeout it can be sent again twice.
- All retries in one run share the same 45 seconds. When one push used both retries and still failed, the other pushes in the same run are not retried until a push works again.
- Unpublish, purge, redirects and search records are not sent again in the same run.
If the push still fails, the job stays in the queue as failed. While the job has attempts left (three in total) and the queue runs in the background, the message ends with “The plugin will try again.” and the background run tries it again, with a longer wait each time. The queue runs in the background when WP-Cron is enabled, or when DISABLE_WP_CRON is set and a system cron ran the queue in the last 15 minutes. With DISABLE_WP_CRON set, the plugin never starts WP-Cron from a web request: the system cron, WP-CLI or the push progress runs the queue. When the job has used all attempts, or nothing runs the queue in the background, the message ends with “Select Retry failed on the dashboard.”: select “Retry failed” on the QuantCDN dashboard (or in the push progress), or run wp quant queue retry. A failed connection test says “Test the connection again in a minute.” The raw error text (for example the cURL error) is in the report from QuantCDN > Diagnostics > Download Report.
Forms on a static site
Follow the Forms documentation. Contact Form 7 needs define('WPCF7_LOAD_JS', false);.
Changelog
2.0.7
- Fixed: the push progress and the Search Rebuild progress counted only the items that the open admin page processed, so a run that WP-Cron, a system cron or WP-CLI also processed ended with too low a count (for example “114 completed” for 189 pushed, or “0 completed”). The progress now shows the result of the whole run. With
DISABLE_WP_CRONset, the plugin no longer starts WP-Cron after content is queued.
2.0.6
- Fixed: when the Quant API did not answer, the push showed raw transport text such as “cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received”. The dashboard queue card and the push progress now show a short message, for example “Quant did not answer in time. The plugin will try again.” The message says “Select Retry failed on the dashboard.” instead when the job has used all attempts or nothing runs the queue in the background (WP-Cron disabled and no system cron run in the last 15 minutes), and a failed connection test says “Test the connection again in a minute.” The raw text is kept apart and is in the diagnostics report and in
wp quant queue errors. - Fixed: one stalled request or gateway error (502, 503, 504) failed the page until the next background run, and the background run only happens when WP-Cron runs. A page or file push that fails fast is now sent again up to two times in the same run, after about 1 and 3 seconds. A request that timed out is sent again only when another attempt still fits in 45 seconds. All retries in one run share those 45 seconds, and after one push fails with both retries the others in the run are not retried.
- Other request failures (for example too many redirects) show “The request to Quant failed.” and are not sent again in the same run.
- A page larger than 512 KB now gets the same 120 second minimum timeout as a file upload.
- Readme:
QUANT_HTTP_REQUEST_TIMEOUTis documented. - The queue table has a new column for the error detail. It is added automatically on the first request after the update; the schema version is recorded only after the column exists.
- Diagnostics: the report shows whether the queue runs in the background and when it last ran.
2.0.5
- Search page: a cleaner default style that still follows the theme. The checkboxes, counts, headings, tags, buttons and pagination have even spacing, every control has a visible focus outline, the “Clear refinements” button uses the theme text colour (it was pale blue), the result title is larger than its summary, and on a phone the facets move above the results. The InstantSearch widgets no longer turn the text navy.
- Search page: every size, space and colour is a CSS custom property (
--quant-search-gap,--quant-search-accentand others). See “Styling the search page” in the readme. - Admin: the search settings, the search page form, the first-run form and the block settings had no space between their fields, checkboxes and toggles on current WordPress (7.x). They now use the block editor spacing.
2.0.4
- Security: after you choose a project, the Quant login is limited to that project, so it can no longer read the publishing token of other projects in your organization. To choose another project, “Change Project” asks you to log in again.
- Security: “Disconnect” now ends the Quant login at Quant, not only in WordPress.
2.0.3
- Fixed: on a Quant Search page, each result showed as a narrow card a quarter of the results column wide (one word per line in a block theme). Results are full-width rows again, with a line between rows and the thumbnail held in its row.
- Fixed: the core Search block (the header search of block themes) now goes to the Quant Search page when “Send the WordPress search form to a Quant Search page” is on, so search works on the static site.
- Saving a change to where the search form goes (the search settings, or the route, status or removal of the default search page) now tells you to push everything, because pages on the edge keep the old form until they are pushed again.
- Fixed: one failed request (for example a 502 from a busy server) stopped the whole push progress. The progress card now tries again up to four times before it stops.
- Fixed: the Settings page showed “No organizations or projects” for a moment after login, before the project list loaded. It now shows a spinner until the list loads.
- Fixed: the search Records count did not change after “Rebuild index” until you pressed Refresh.
- Fixed: “Last Synced”, the sync status column and “Next background run” now show the time in the site time zone, with the zone. “Last Synced” was off by the difference between UTC and the browser time zone.
- REST: last_synced is now ISO 8601 UTC; last_synced_label and next_cron_label added.
2.0.2
- Fixed: a site connected through the Quant login showed as disconnected 24 hours after it connected, and the project list failed. Tokens without an expiry no longer expire in the plugin.
- The Quant login supports refresh tokens. The plugin renews an expiring login token by itself, one request at a time. If Quant no longer accepts the login, QuantCDN > Settings asks you to log in again; publishing continues with the project token.
- A copy of a site (for example a production database restored to staging) no longer shares the login of the original. The copy asks you to reconnect it, so it cannot log the original site out.
2.0.1
- The Quant login (OAuth) sends PKCE (S256). The Quant dashboard will require it, so update before you connect a site.
2.0.0
- Complete rewrite: React admin, service container, REST API, WP-Cron queue.
- New CDN Only mode for sites that keep WordPress as the origin.
- Publishes paginated listings, author pages, date archives, sitemaps and referenced assets automatically.
- Captures slug changes as redirects and unpublishes removed content reliably.
- Uploads sitemaps and robots.txt as files so they keep their content type; makes localhost and private-IP URLs relative.
- Quant Search: records with every push, search pages with facets, autocomplete, index rebuild. Algolia on QuantCDN, Typesense on QuantGov.
- Calls to the Quant API always verify TLS; “Disable SSL verification” applies only to the local webserver.
- Sync status column, admin bar item and “Push to Quant” row action.
- QUANT_* environment variable and constant overrides.
- QuantGov dashboard support for the Quant login.
- Automatic migration of 1.x settings; 1.x WP-CLI commands kept as aliases.
- Requires PHP 8.2.
1.6.0
- Feature: Added new Cache tab for manual CDN cache purging (purge all or selective paths).
- Feature: Added “Cache purge on save” option to automatically purge CDN cache when content changes.
- Feature: Renamed “Quant Enabled” to “Automatic static push” for clarity.
- Feature: Automatic trailing slash handling – purges both /path and /path/ variants.
- Improvement: Enhanced error handling and validation for cache purge operations.
- Improvement: Cache purge now works independently of automatic static push.
- Tested with WordPress 6.8.2.
- Updated minimum PHP requirement to 7.4 (previously stated 8.1).