Skip to content

Conversation

@brunobasto
Copy link

@brunobasto brunobasto commented Nov 21, 2025

Screenshot 2025-11-21 at 12 44 11

Description

This PR adds Ingest API capabilities, enabling WordPress sites to push post data to Salesforce Data Cloud. The implementation includes:

  • Authentication & Settings UI: Admin interface for users to configure Salesforce Instance URL and Access Token - this is probably gonna be setup via the VIP dashboard on the integration configs later on, but added here for testing purposes for now. cc @pandah3
  • Ingest API Client: Handles token exchange (Salesforce Token → Data Cloud Token) and data ingestion to Salesforce Data Cloud
  • Data Kit Deployment: Checks package installation status and provides ability to deploy Data Kit components via Salesforce Flow API - untested due to license limitation on our scratch orgs
  • Data Synchronization: WordPress cron job that runs hourly to sync published posts to Salesforce Data Cloud - this is just the kickoff to start testing this, not the final implementation
  • Admin Status Page: UI showing deployment status, package installation checks, and manual action buttons

This is largely untested because of problems deploying DataKit features via the 2GP package due to license limitations on our scratch orgs. So this is a draft PR for now.

Pre-review checklist

Please make sure the items below have been covered before requesting a review:

  • [] This change works and has been tested locally or in Codespaces (or has an appropriate fallback).
  • This change has relevant unit tests (if applicable).
  • This change has relevant documentation additions / updates (if applicable).
  • I've created a changelog description that aligns with the provided examples.

Pre-deploy checklist

  • VIP staff: Ensure any alerts added/updated conform to internal standards (see internal documentation).

Steps to Test

  1. Check out PR and activate the plugin
  2. Navigate to wp-admin > Settings > Agentforce
  3. Enter Salesforce Instance URL (e.g., https://my-domain.my.salesforce.com)
  4. Enter Salesforce Access Token (obtained via Salesforce CLI or Developer Console - see instructions on the page)
  5. Click "Save Credentials"
  6. Verify the status table shows:
    • DataKit Package status (Installed/Not Installed)
    • Data Stream status (Deployed/Not Deployed)
  7. If Data Stream is not deployed, click "Deploy DataKit" button
  8. After deployment, click "Sync Now" to test data ingestion
  9. Check browser console for debug logs showing the payload sent to Salesforce
  10. Verify data appears in Salesforce Data Cloud (if Data Kit is properly configured)

- Implemented form handling for saving Salesforce credentials and actions.
- Added DataKit deployment and data sync functionalities.
- Created new classes for Data_Sync, DataKit_Deployment, Ingest_Client, and Credentials to manage data ingestion and Salesforce interactions.
- Enhanced the Admin Status page to display and manage Salesforce settings and actions.
- Updated tracking methods to be publicly accessible for event recording.
@brunobasto brunobasto requested a review from a team November 21, 2025 16:04
- Added test setup for Salesforce credentials.
- Mocked HTTP requests to simulate Salesforce API responses.
- Updated assertions to verify the presence of Salesforce settings in the output.
Comment on lines +60 to +65
return [
'id' => (string) $post->ID,
'title' => $post->post_title,
'content' => wp_strip_all_tags( $post->post_content ),
'excerpt' => get_the_excerpt( $post ),
'categories' => implode( ',', $categories ),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a few fields in pcNUl3-2WJ-p2

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd also want slug or URL I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants