Skip to content

Added filter to short-circuit API calls to Salesforce. Thanks to GitHub user @verygoodplugins for the submission.#512

Merged
jonathanstegall merged 3 commits intoMinnPost:masterfrom
jack-arturo:add-filter-to-short-circuit-api-calls
Feb 3, 2023
Merged

Added filter to short-circuit API calls to Salesforce. Thanks to GitHub user @verygoodplugins for the submission.#512
jonathanstegall merged 3 commits intoMinnPost:masterfrom
jack-arturo:add-filter-to-short-circuit-api-calls

Conversation

@jack-arturo
Copy link
Copy Markdown
Contributor

What does this Pull Request do?

This PR adds a filter to the http_request() function in class Object_Sync_Sf_Salesforce to allow short-circuiting the API call and response.

The goal of the PR is to help create a tighter integration with WP Fusion (https://github.com/verygoodplugins/wp-fusion-lite/ and https://wpfusion.com/).

The logic follows what already exists in WP core, for example with update_metadata(): https://github.com/WordPress/WordPress/blob/master/wp-includes/meta.php#L233

With this filter in place, we will be able to:

  • Route outgoing API calls through WP Fusion (and the WordPress HTTP API / wp_remote_request())
  • Use WP Fusion's built in error handling, logging, and token refresh capabilities for Object Sync API calls
  • Detect potential data collision (for example if WP Fusion is about to operate on the same record)
  • Automatically configure Object Sync using the Salesforce client ID and tokens already managed by WP Fusion

We're excited to create a deeper integration between WP Fusion and Object Sync for Salesforce, and this change would allow us to tie the two plugins together much more closely than is currently possible.

Thanks for your consideration :)

@jonathanstegall
Copy link
Copy Markdown
Member

Thanks for this! There's nothing obvious that looks troubling at all, I just want to have a chance to run it before I merge it, and also add the new hook to the developer hook documentation spots where it belongs.

@jonathanstegall jonathanstegall added feature Pull request that adds a feature minor pull request that requires a minor release, ex v2.2.0. labels Feb 3, 2023
@jonathanstegall jonathanstegall added this to the v2.2.7 milestone Feb 3, 2023
@jonathanstegall jonathanstegall merged commit 8d7ef20 into MinnPost:master Feb 3, 2023
@jonathanstegall jonathanstegall changed the title Added filter to short-circuit API calls to Salesforce Added filter to short-circuit API calls to Salesforce. Thanks to GitHub user @verygoodplugins for the submission. Feb 3, 2023
@jonathanstegall jonathanstegall added patch pull request that requires a patch release, ex v2.1.2. This is the default for new releases. and removed minor pull request that requires a minor release, ex v2.2.0. labels Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Pull request that adds a feature patch pull request that requires a patch release, ex v2.1.2. This is the default for new releases.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants