Plugin / Object Sync for Salesforce

MinnPost

Installation

Installation

WordPress

Prerequisites

To install the plugin in WordPress, your PHP environment needs the following:

  1. At least version 5.6.20.
  2. SSL support (this is required to connect to Salesforce).
  3. A domain where WordPress is successfully running. For purposes of this documentation, we’ll assume that you are using https://<your site>. You would use https://www.example.com instead, if your site was www.example.com.

Activate the plugin

In the Plugins list in WordPress, activate the plugin and find the settings link (you can also find this plugin’s settings in the main Settings list in WordPress, under the Salesforce menu item once it is activated).

The plugin’s settings URL is https://<your site>/wp-admin/options-general.php?page=object-sync-salesforce-admin.

Salesforce

Prerequisites

You’ll need to have access to a Salesforce developer account. This should come with Enterprise Edition, Unlimited Edition, or Performance Edition. Developers can register for a free Developer Edition account at https://developer.salesforce.com/signup.

We recommend using a Sandbox to set up this plugin first before running it in production.

For purposes of this documentation, we’ll assume that your name, as defined in Salesforce, is Your Name. This is what you see at the top right of the browser window, when you are logged in.

Create an App

  1. In Salesforce, go to Your Name > Setup. Then on the left sidebar, under App Setup, click Create > Apps. In the Connected Apps section of this page, click New to create a new app.
  2. Enable OAuth Settings
  3. Set the callback URL to: https://<your site>/wp-admin/options-general.php?page=object-sync-salesforce-admin&tab=authorize (must use HTTPS).
  4. Select at least “Perform requests on your behalf at any time” for OAuth Scope as well as the appropriate other scopes for your application. Many setups will also need to select “Access and manage your data (api)” as one of these scopes.

Get the values for WordPress

After you save these settings, click Continue and you’ll see the values for your new app. For WordPress, you’ll need these values:

  1. Consumer Key (in the screenshot, this value says “valuefromsalesforce”)
  2. Consumer Secret (you’ll have to click “Click to reveal” to get this value)

Connect the plugin to Salesforce

Settings

Go to the Settings tab for the plugin. It is the default URL that opens when you click Salesforce in the main Settings menu. Enter the values based on your Salesforce environment.

  1. Consumer Key: (your value from above)
  2. Consumer Secret: (your value from above)
  3. Callback URL: https://<your site>/wp-admin/options-general.php?page=object-sync-salesforce-admin&tab=authorize
  4. Login Base URL: For most Salesforce environments, you can use https://test.salesforce.com for sandbox, and https://login.salesforce.com for production.
  5. Authorize URL Path: The plugin starts with a default of /services/oauth2/authorize. You should generally not have to change this.
  6. Token URL Path: The plugin starts with a default of /services/oauth2/token. You should generally not have to change this.
  7. Salesforce API Version: You should generally use the latest version your install has access to. This plugin starts with 42.0, but once it is authenticated the text field will be replaced with a dropdown of your available versions from which you can choose.
  8. Limit Salesforce Objects: These allow you to indicate whether Salesforce should relate to objects that can’t be triggered or updated via the API. Generally it’s a good idea to have these boxes checked to avoid errors.
  9. Salesforce Field Display Value: When mapping Salesforce fields, you can choose whether the plugin will display a field’s Field Label (possibly a more user friendly value) or the API Name (which is always unique). Neither choice changes how the plugin functions on the back end, but making a choice can sometimes make the mapping choices easier to find.
  10. Pull Throttle (seconds): This plugin starts with 5 seconds, but you can change it based on your server’s needs.
  11. Debug mode: This won’t do anything until after the plugin has been authorized, but once it has you can use it to see more information about what the API is doing. Don’t check this in a production environment.

Save the settings. If the values required are set, you’ll see a message that says “Salesforce needs to be authorized to connect to this website. Use the Authorize tab to connect.” You can use that link for the next steps.

Using constants for settings

You can set several of the above values as constants in your wp-config.php file. The plugin will always use a constant ahead of a database setting.

Supported constant names are:

  1. OBJECT_SYNC_SF_SALESFORCE_CONSUMER_KEY
  2. OBJECT_SYNC_SF_SALESFORCE_CONSUMER_SECRET
  3. OBJECT_SYNC_SF_SALESFORCE_CALLBACK_URL
  4. OBJECT_SYNC_SF_SALESFORCE_LOGIN_BASE_URL
  5. OBJECT_SYNC_SF_SALESFORCE_AUTHORIZE_URL_PATH
  6. OBJECT_SYNC_SF_SALESFORCE_TOKEN_URL_PATH
  7. OBJECT_SYNC_SF_SALESFORCE_API_VERSION

Set them in wp-config.php like this:

define('OBJECT_SYNC_SF_SALESFORCE_CONSUMER_KEY', 'valuefromsalesforce');
define('OBJECT_SYNC_SF_SALESFORCE_CONSUMER_SECRET', 'valuefromsalesforce');
define('OBJECT_SYNC_SF_SALESFORCE_CALLBACK_URL', 'https://<your site>/wp-admin/options-general.php?page=object-sync-salesforce-admin&tab=authorize');
define('OBJECT_SYNC_SF_SALESFORCE_LOGIN_BASE_URL', 'https://test.salesforce.com');
define('OBJECT_SYNC_SF_SALESFORCE_API_VERSION', '40.0');
define('OBJECT_SYNC_SF_SALESFORCE_AUTHORIZE_URL_PATH', '/services/oauth2/authorize');
define('OBJECT_SYNC_SF_SALESFORCE_TOKEN_URL_PATH', '/services/oauth2/token');

For any value that is already defined in wp-config.php, the Settings screen will display “Defined in wp-config.php” in place of the text field.

Authorize

Go to the Authorize tab in the plugin’s settings. If it is not yet authorized, you’ll see a message that says “Salesforce needs to be authorized to connect to this website. Use the Authorize tab to connect.”

The authorize tab will force you to be logged in using HTTPS, if you weren’t already.

Steps:

  1. Click the Connect to Salesforce button to authenticate WordPress with your Salesforce installation.
  2. You may have to log into Salesforce.
  3. Salesforce will ask you to allow access to the app (in these instructions, the name is WordPress Example), and will show you what permissions it needs.
  4. Click Allow.
  5. You’ll be redirected back to WordPress. Don’t do anything until you see a message that says “Salesforce is successfully authenticated.”
  6. The tab will display a “Disconnect from Salesforce” button which you can click at any time, and will also show a bit of basic information about your Salesforce environment (the available API versions and a basic table of Contacts.)
  7. If you’d like to use a different Salesforce API version, go back to the Settings tab and pick your desired version from the dropdown.

More documentation

There is extensive documentation of the plugin, including its developer hooks, on GitHub. You can find a detailed initial setup instruction document there as well.

Ratings

5
6 reviews

Rating breakdown

Details Information

Version

1.8.12

First Released

26 May, 2017

Total Downloads

7,760

Wordpress Version

4.6 or higher

Tested up to:

5.2.4

Require PHP Version:

5.6.20 or higher

Tags

Contributors

Languages

The plugin hasn't been transalated in any language other than English.

DIRECTORY DISCLAIMER

The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.