Case study
Case study: a multi-tenant website platform for real-estate agencies
Alongside the WordPress plugin for the same real-estate CRM company, I work on the company’s own website platform: a multi-tenant application, built on CakePHP 5, that hosts websites for estate agencies, each with its own theme, content, languages, and domain. This case study describes the work without naming the company or its clients.
| Client | Real-estate CRM company (anonymous) |
|---|---|
| My role | Developer on the platform team, 200+ commits since December 2024 |
| Stack | PHP 8.4, CakePHP 5, MariaDB, Tailwind CSS, vanilla JavaScript, Docker, GitHub Actions |
| Quality | PHPUnit, PHPStan with strict rules, PHPCS, Sentry error monitoring |
The platform
Instead of a separate WordPress install per agency, the platform runs many agency websites from one codebase. Each site (tenant) gets its own database and configuration, and switches on the features it needs. More than twenty themes and client portals are packaged as plugins, so a new agency design doesn’t touch the core. Property listings, projects, and lead forms connect directly to the CRM’s API, and background jobs run through a queue.
Multilingual sites
Agencies sell to international buyers, so most sites run in several languages. I worked on making that reliable across the platform:
- Translation support across themes, site pages, and structured content fields, including recursive merging of translated JSON options.
- Language-prefixed URLs that are only registered when a language is actually enabled for a site.
- Per-locale schema settings and cached configuration, so each language version gets correct metadata.
- Locale resolution that no longer depends on the visitor’s browser storage, and language switchers that keep working after listing URLs change.
SEO and structured data
- Property structured data (JSON-LD) with bedrooms, bathrooms, floor size, plot size, and locality, so listings are easier for search engines to understand.
- Editable SEO titles and descriptions for property listing pages.
- An SEO robots integration for every theme and an improved default
robots.txt. - Blocking search engines from the platform’s default subdomains, so each site is only indexed on its own domain.
- Faster hero images using
preloadandfetchpriorityto improve Largest Contentful Paint. - Fixing map pins and structured data coordinates that disagreed and shifted on every page load.
Security
- An XSS audit across the application, followed by fixes, including escaping SEO fields and CRM data that were printed into page markup.
- Token security checks for a bank-partner portal.
- Cloudflare Turnstile added alongside reCAPTCHA for spam protection on forms.
Platform work
- Site export and import: sites, pages, and menus can be exported to JSON and imported into another tenant, which makes migrations and new launches much faster.
- PHP 8.4 upgrade: updated the deployment Docker image, the GitHub Actions CI pipeline, and Composer requirements.
- Theme refactoring: converted raw PHP includes into reusable CakePHP elements across nine themes.
- Analytics: lead-form and page events pushed to the data layer so agencies can track enquiries in their marketing tools.
- Admin improvements: sortable site lists, better navigation for sites with lots of content, and normalised custom-domain setup.
Reliability
On a platform where one bug can affect every site, small errors matter. A steady part of my work is tracking production warnings reported by Sentry back to their root cause and fixing them, and adding unit tests for the CRM API connectors so those fixes stay fixed.
What this means for your project
Not every website should be WordPress. When a business needs many similar sites, deep integration with its own systems, or strict control over performance and security, a custom PHP application can be the better fit. I work across both, and I can help you choose the one that suits your project. See my development services.
Planning a platform or a complex website?
Tell me what you’re building, and I’ll help you pick the right stack and plan the work.
Chat on WhatsApp