Blog / CMS (WordPress)

WordPress hosts the blog and some marketing pages. It has its own repository (swappsco/wp-swappscom) and runs on Pantheon (managed WordPress, PHP 8.3). The repo is a complete WordPress install managed with Composer (community plugins via WPackagist + private Swapps plugins).

What's in the repo

  • Custom theme swapps — a Beaver Builder child theme; includes classes for Cloudflare integration, REST API and SEO.
  • Custom plugin swapps-core-plugin — portfolio, Beaver modules, Mailchimp subscription, post search filters, tag cloud.
  • Key plugins — WPML (multilingual), ACF Pro, Formidable Pro, Yoast SEO Premium, WP-Rocket, Jetpack, Imagify.

How it fits the platform

flowchart LR WP["WordPress
(Pantheon)"] P["Platform
swapps-worker"] W["Website
swapps-client"] U([User]) U -->|swapps.com/blog| W W -->|Service Binding| P P -->|"WP REST API /wp-json/wp/v2"| WP WP -->|"purge cache on publish"| CF["Cloudflare"]
  • Cloudflare routes /wp-* and /wp-json/* of swapps.com to WordPress (those routes are "Workers disabled" — see Cloudflare Edge).
  • The Platform worker consumes the WP REST API and delivers already-processed content to the Website, so the blog renders inside the React site (SSR) while keeping a single URL under swapps.com.
  • The theme exposes a custom REST field: /wp-json/wp/v2/posts?_fields=*,translations, which adds the WPML translation mapping per post (used by the worker for the multilingual blog).
  • On publish/edit/delete of a post, WordPress purges the Cloudflare cache (class-swapps-cloudflare.php + Pantheon Quicksilver hooks), so content changes show on the site without waiting for the cache TTL.

Deployment & observability

  • Deploy: Git push to Pantheon (Composer --no-dev) + Quicksilver hooks; CI via GitHub Actions (sync_pantheon_master.yml).
  • Observability: errors to Sentry (PHP SDK); deploy markers in New Relic via Quicksilver.

Cache purge secrets

Pantheon holds CLOUDFLARE_TOKEN / CLOUDFLARE_ZONE_ID (names only) used to purge the Cloudflare cache when content is published.