AgencyStudio Simpatico

WordPress to Salesforce sync for a performing-arts foundation

Keeping records in sync via Salesforce's API proved challenging but satisfying.

What I did

I helped Studio Simpatico deliver a system to keep data in sync between WordPress and Salesforce for a performing-arts foundation. Studio Simpatico was handling the design and build and needed someone on the team who knew their way around Salesforce API calls, so I was brought in to link up the backend API and keep their WordPress listings accurate.

What I did:

  • WordPress integration with the official PHP Salesforce SDK, inserting Event records and their relations into two custom post types which the agency had created and were filtering on the front-end.
  • Set up a two-minute background WP-cron call, plus on-demand triggers I could use to easily test the system - testing live data required a more laborious sequence of Salesforce manual actions and log review.
  • Duplicate cleanup within the WordPress code before records reach the live site. This was after discovering an issue where delays in communication might cause two records to be created. I resolved this by checking hashed data values.
  • An ACF admin UI showing the foundation's editors exactly what is happening to the data. Notifications alert myself and admin if a sync needs attention. Client visibility on the events being created was one of the most important deliverables.

How it helped

After the changes had been made, the foundation pushed changes on Salesforce alone, and the sync script pulled updates into WordPress. The biggest gain for the foundation was no longer needing to update records twice.

Why this way

The hard part of an integration like this is figuring out who owns each piece of data. Salesforce was the source of truth for the synced event fields; WordPress kept ownership of its own metadata around them. The source of truth is vital, without it you're left guessing as to if data is stale, or if an overwrite has happened, necessitating a review of the audit trail.

To prevent data within the listings becoming unsynced I disabled editing on specific fields to prevent accidental overwrite. The Advanced Custom Fields integration used to add these fields let me do that with ease.

Two further moves shored up the contract. The duplicate-cleanup logic - hashed-data comparison before any record reaches the live site - meant communication delays couldn't cause twin records to drift into the catalogue. And a second scheduled task fires after each Salesforce sync to force WordPress to re-derive its filter cache, so the front-end always sees the freshest version of the truth.

What "done" looked like

Myself, the agency and the foundation agreed that we'd run the system for a few weeks to monitor behaviour before signing off.

I would occasionally have to log in to WordPress, or run diagnostics against Salesforce event logs we'd gathered to debug a sync issue, but it was always minor, and resolved itself on the next sync refresh.

The site continued to run smoothly over the following months, and has been operational ever since, serving fresh data from the Salesforce pipeline without issue.

Working together

The brief from Studio Simpatico was clear and detailed, and I collaborated directly with the client to work through edge cases during testing. Clear communication between all parties involved meant that not only was the functionality implemented on time and to spec, but I was also able to accommodate any minor alterations during the build that arose due to requirements relating to the display of specific fields within the layout.

I also helped debug an issue with the listing plugin itself where listings weren't showing - turned out to be a cache problem, a very common issue!

All case studies

Let's talk.

Got an API integration that needs to stay legible months later? That is the kind of work I love.