forked from MinnPost/object-sync-for-salesforce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobject-sync-for-salesforce.php
executable file
·625 lines (551 loc) · 21.5 KB
/
object-sync-for-salesforce.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
<?php
/*
Plugin Name: Object Sync for Salesforce
Description: Object Sync for Salesforce maps and syncs data between Salesforce objects and WordPress objects.
Version: 1.8.12
Author: MinnPost
Author URI: https://code.minnpost.com
License: GPL2+
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: object-sync-for-salesforce
*/
/**
* Start up the Object Sync for Salesforce plugin; initialize parameters and classes
*/
class Object_Sync_Salesforce {
/**
* @var object
* Global object of `$wpdb`, the WordPress database
*/
private $wpdb;
/**
* @var string
* The plugin's slug so we can include it when necessary
*/
private $slug;
/**
* @var string
* The plugin's option prefix
*/
private $option_prefix;
/**
* @var array
* Login credentials for the Salesforce API; comes from wp-config or from the plugin settings
*/
private $login_credentials;
/**
* @var array
* Array of what classes in the plugin can be scheduled to occur with `wp_cron` events
*/
public $schedulable_classes;
/**
* @var string
* Current version of the plugin
*/
private $version;
/**
* @var object
*/
private $queue;
/**
* @var bool
*/
private $load;
/**
* @var object
*/
private $activated;
/**
* @var object
* Load and initialize the Object_Sync_Sf_Logging class
*/
private $logging;
/**
* @var object
* Load and initialize the Object_Sync_Sf_Mapping class
*/
public $mappings;
/**
* @var object
* Load and initialize the Object_Sync_Sf_WordPress class
*/
private $wordpress;
/**
* @var array
* Load and initialize the API on the Object_Sync_Sf_Salesforce class.
* This contains the Salesforce API methods
*/
public $salesforce;
/**
* @var object
* Load and initialize the Object_Sync_Sf_Salesforce_Push class
*/
private $push;
/**
* @var object
* Load and initialize the Object_Sync_Sf_Salesforce_Pull class
*/
private $pull;
/**
* @var object
* Load and initialize the Object_Sync_Sf_Rest class
*/
private $rest;
/**
* @var object
* Static property to hold an instance of the class; this seems to make it reusable
*
*/
static $instance = null;
/**
* Load the static $instance property that holds the instance of the class.
* This instance makes the class reusable by other plugins
*
* @return object
* The sfapi object if it is authenticated (empty, otherwise)
*
*/
static public function get_instance() {
if ( null === self::$instance ) {
self::$instance = new Object_Sync_Salesforce();
}
return self::$instance;
}
/**
* Constructor that sets up the parameters to pass to all the other classes, and the methods that call the other classes
*
* @return void
*/
protected function __construct() {
global $wpdb;
$this->wpdb = $wpdb;
$this->version = '1.8.12';
$this->slug = 'object-sync-for-salesforce';
$this->option_prefix = 'object_sync_for_salesforce_';
$this->login_credentials = $this->get_login_credentials();
$this->schedulable_classes = array(
'salesforce_push' => array(
'label' => 'Push to Salesforce',
'class' => 'Object_Sync_Sf_Salesforce_Push',
'callback' => $this->option_prefix . 'push_record',
),
'salesforce_pull' => array(
'label' => 'Pull from Salesforce',
'class' => 'Object_Sync_Sf_Salesforce_Pull',
'initializer' => $this->option_prefix . 'pull_check_records',
'callback' => $this->option_prefix . 'pull_process_records',
),
);
// users can modify the list of schedulable classes
$this->schedulable_classes = apply_filters( $this->option_prefix . 'modify_schedulable_classes', $this->schedulable_classes );
/*
* example to modify the array of classes by adding one and removing one
* add_filter( 'object_sync_for_salesforce_modify_schedulable_classes', 'modify_schedulable_classes', 10, 1 );
* function modify_schedulable_classes( $schedulable_classes ) {
* $schedulable_classes = array(
* 'salesforce_push' => array(
* 'label' => 'Push to Salesforce',
* 'class' => 'Object_Sync_Sf_Salesforce_Push',
* 'callback' => 'salesforce_push_sync_rest',
* ),
* 'wordpress' => array( // WPCS: spelling ok.
* 'label' => 'WordPress',
* 'class' => 'Object_Sync_Sf_WordPress',
* ),
* 'salesforce' => array(
* 'label' => 'Salesforce Authorization',
* 'class' => 'Object_Sync_Sf_Salesforce',
* ),
* );
* return $schedulable_classes;
* }
*/
$this->queue = $this->queue( $this->wpdb, $this->version, $this->slug, $this->option_prefix, $this->schedulable_classes );
$this->activated = $this->activate( $this->wpdb, $this->version, $this->slug, $this->option_prefix, $this->schedulable_classes, $this->queue );
// Run non-activation things. We do this early because ActionScheduler has to have access to plugins_loaded with priority of zero.
add_action( 'plugins_loaded', array( $this, 'run' ), -10 );
}
/**
* run the plugin, independent of activation methods.
*
*/
public function run() {
$this->load = $this->load( $this->wpdb, $this->version, $this->slug, $this->option_prefix );
$this->deactivate( $this->wpdb, $this->version, $this->slug, $this->option_prefix, $this->schedulable_classes, $this->queue );
$this->logging = $this->logging( $this->wpdb, $this->version, $this->slug, $this->option_prefix );
$this->mappings = $this->mappings( $this->wpdb, $this->version, $this->slug, $this->option_prefix, $this->logging );
$this->wordpress = $this->wordpress( $this->wpdb, $this->version, $this->slug, $this->option_prefix, $this->mappings, $this->logging );
$this->salesforce = $this->salesforce_get_api();
$this->push = $this->push( $this->wpdb, $this->version, $this->login_credentials, $this->slug, $this->option_prefix, $this->wordpress, $this->salesforce, $this->mappings, $this->logging, $this->schedulable_classes, $this->queue );
$this->pull = $this->pull( $this->wpdb, $this->version, $this->login_credentials, $this->slug, $this->option_prefix, $this->wordpress, $this->salesforce, $this->mappings, $this->logging, $this->schedulable_classes, $this->queue );
$this->rest = $this->rest( $this->wpdb, $this->version, $this->slug, $this->option_prefix, $this->wordpress, $this->salesforce, $this->mappings, $this->push, $this->pull );
$this->load_admin( $this->wpdb, $this->version, $this->login_credentials, $this->slug, $this->option_prefix, $this->wordpress, $this->salesforce, $this->mappings, $this->push, $this->pull, $this->logging, $this->schedulable_classes, $this->queue );
}
/**
* Load immediately required things
*
* @param object $wpdb
* @param string $version
* @param string $slug
* @param string $option_prefix
* @return bool true
*
*/
private function load( $wpdb, $version, $slug, $option_prefix ) {
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
return true;
}
/**
* Get queue instance.
*
* @param object $wpdb
* @param string $version
* @param string $slug
* @param string $option_prefix
* @param array $schedulable_classes
* @return Object_Sync_Sf_Queue
*/
private function queue( $wpdb, $version, $slug, $option_prefix, $schedulable_classes ) {
require_once plugin_dir_path( __FILE__ ) . 'classes/class-object-sync-sf-queue.php';
$queue = new Object_Sync_Sf_Queue( $wpdb, $version, $slug, $option_prefix, $schedulable_classes );
return $queue;
}
/**
* Log events
*
* @param object $wpdb
* @param string $version
* @param string $slug
* @param string $option_prefix
*
* @return object
* Instance of Object_Sync_Sf_Logging
*/
private function logging( $wpdb, $version, $slug, $option_prefix ) {
require_once plugin_dir_path( __FILE__ ) . 'classes/logging.php';
$logging = new Object_Sync_Sf_Logging( $wpdb, $version, $slug, $option_prefix );
return $logging;
}
/**
* Map the Salesforce and WordPress objects and fields to each other
*
* @param object $wpdb
* @param string $version
* @param string $slug
* @param string $option_prefix
* @param object $logging
*
* @return object
* Instance of Object_Sync_Sf_Mapping
*/
private function mappings( $wpdb, $version, $slug, $option_prefix, $logging ) {
require_once( plugin_dir_path( __FILE__ ) . 'classes/salesforce_mapping.php' );
$mappings = new Object_Sync_Sf_Mapping( $wpdb, $version, $slug, $logging, $option_prefix );
return $mappings;
}
/**
* Private helper to load methods for manipulating core WordPress data across the plugin
*
* @param object $wpdb
* @param string $version
* @param string $slug
* @param string $option_prefix
* @param object $mappings
* @param object $logging
*
* @return object
* Instance of Object_Sync_Sf_WordPress
*/
private function wordpress( $wpdb, $version, $slug, $option_prefix, $mappings, $logging ) {
require_once plugin_dir_path( __FILE__ ) . 'classes/wordpress.php';
$wordpress = new Object_Sync_Sf_WordPress( $wpdb, $version, $slug, $mappings, $logging, $option_prefix );
return $wordpress;
}
/**
* Public helper to load the Salesforce API and see if it is authenticated.
* This is public so other plugins can access the same SF API instance
*
* @return array
* Whether Salesforce is authenticated (boolean)
* The sfapi object if it is authenticated (empty, otherwise)
*/
public function salesforce_get_api() {
require_once( plugin_dir_path( __FILE__ ) . 'classes/salesforce.php' );
require_once( plugin_dir_path( __FILE__ ) . 'classes/salesforce_query.php' ); // this can be used to generate soql queries, but we don't often need it so it gets initialized whenever it's needed
$soap_available = $this->is_soap_available();
$soap_loaded = $this->is_soap_loaded();
$consumer_key = $this->login_credentials['consumer_key'];
$consumer_secret = $this->login_credentials['consumer_secret'];
$login_url = $this->login_credentials['login_url'];
$callback_url = $this->login_credentials['callback_url'];
$authorize_path = $this->login_credentials['authorize_path'];
$token_path = $this->login_credentials['token_path'];
$rest_api_version = $this->login_credentials['rest_api_version'];
$slug = $this->slug;
$option_prefix = $this->option_prefix;
$wordpress = $this->wordpress;
$logging = $this->logging;
$schedulable_classes = $this->schedulable_classes;
$is_authorized = false;
$sfapi = '';
if ( $consumer_key && $consumer_secret ) {
$sfapi = new Object_Sync_Sf_Salesforce( $consumer_key, $consumer_secret, $login_url, $callback_url, $authorize_path, $token_path, $rest_api_version, $wordpress, $slug, $logging, $schedulable_classes, $option_prefix );
if ( true === $sfapi->is_authorized() ) {
$is_authorized = true;
}
}
return array(
'is_authorized' => $is_authorized,
'sfapi' => $sfapi,
'soap_available' => $soap_available,
'soap_loaded' => $soap_loaded,
);
}
/**
* What to do upon activation of the plugin
*
* @param object $wpdb
* @param string $version
* @param string $slug
* @param string $option_prefix
* @param array $schedulable_classes
* @param object $queue
*
* @return object
* Instance of Object_Sync_Sf_Activate
*/
private function activate( $wpdb, $version, $slug, $option_prefix, $schedulable_classes, $queue ) {
require_once plugin_dir_path( __FILE__ ) . 'classes/activate.php';
$activate = new Object_Sync_Sf_Activate( $wpdb, $version, $slug, $option_prefix, $schedulable_classes, $queue );
return $activate;
}
/**
* What to do upon deactivation of the plugin
*
* @param object $wpdb
* @param string $version
* @param string $slug
* @param string $option_prefix
* @param array $schedulable_classes
* @param object $queue
*
* @return object
* Instance of Object_Sync_Sf_Deactivate
*/
private function deactivate( $wpdb, $version, $slug, $option_prefix, $schedulable_classes, $queue ) {
require_once plugin_dir_path( __FILE__ ) . 'classes/deactivate.php';
$deactivate = new Object_Sync_Sf_Deactivate( $wpdb, $version, $slug, $schedulable_classes, $option_prefix, $queue );
}
/**
* Methods to push data from WordPress to Salesforce
*
* @param object $wpdb
* @param string $version
* @param array $login_credentials
* @param string $slug
* @param string $object_prefix
* @param object $wordpress
* @param object $salesforce
* @param object $mappings
* @param object $logging
* @param array $schedulable_classes
*
* @return object
* Instance of Object_Sync_Sf_Salesforce_Push
*/
private function push( $wpdb, $version, $login_credentials, $slug, $option_prefix, $wordpress, $salesforce, $mappings, $logging, $schedulable_classes, $queue ) {
require_once plugin_dir_path( __FILE__ ) . 'classes/salesforce_push.php';
$push = new Object_Sync_Sf_Salesforce_Push( $wpdb, $version, $login_credentials, $slug, $wordpress, $salesforce, $mappings, $logging, $schedulable_classes, $queue, $option_prefix );
return $push;
}
/**
* Methods to pull data from Salesforce to WordPress
*
* @param object $wpdb
* @param string $version
* @param array $login_credentials
* @param string $slug
* @param string $option_prefix
* @param object $wordpress
* @param object $salesforce
* @param object $mappings
* @param object $logging
* @param array $schedulable_classes
* @return object
* Instance of Object_Sync_Sf_Salesforce_Pull
*/
private function pull( $wpdb, $version, $login_credentials, $slug, $option_prefix, $wordpress, $salesforce, $mappings, $logging, $schedulable_classes, $queue ) {
require_once plugin_dir_path( __FILE__ ) . 'classes/salesforce_pull.php';
$pull = new Object_Sync_Sf_Salesforce_Pull( $wpdb, $version, $login_credentials, $slug, $wordpress, $salesforce, $mappings, $logging, $schedulable_classes, $queue, $option_prefix );
return $pull;
}
/**
* Load the rest class.
* This handles REST API methods
*
* @param object $wpdb
* @param string $version
* @param array $login_credentials
* @param string $slug
* @param string $option_prefix
* @param object $wordpress
* @param object $salesforce
* @param object $mappings
* @param object $push
* @param object $pull
* @param object $logging
* @param array $schedulable_classes
* @param object $queue
* @return object $admin
* Instance of Object_Sync_Sf_Rest
*
*/
private function rest( $wpdb, $version, $slug, $option_prefix, $wordpress, $salesforce, $mappings, $push, $pull ) {
require_once( plugin_dir_path( __FILE__ ) . 'classes/class-object-sync-sf-rest.php' );
$rest = new Object_Sync_Sf_Rest( $wpdb, $version, $slug, $option_prefix, $wordpress, $salesforce, $mappings, $push, $pull );
return $rest;
}
/**
* Load the admin class.
* This also creates admin menu, unless the plugin that calls this library has indicated that it has its own menu
*
* @param object $wpdb
* @param string $version
* @param array $login_credentials
* @param string $slug
* @param string $option_prefix
* @param object $wordpress
* @param object $salesforce
* @param object $mappings
* @param object $push
* @param object $pull
* @param object $logging
* @param array $schedulable_classes
* @param object $queue
* @return object $admin
* Instance of Object_Sync_Sf_Admin
*
*/
private function load_admin( $wpdb, $version, $login_credentials, $slug, $option_prefix, $wordpress, $salesforce, $mappings, $push, $pull, $logging, $schedulable_classes, $queue ) {
require_once( plugin_dir_path( __FILE__ ) . 'classes/admin.php' );
$admin = new Object_Sync_Sf_Admin( $wpdb, $version, $login_credentials, $slug, $wordpress, $salesforce, $mappings, $push, $pull, $logging, $schedulable_classes, $queue, $option_prefix );
add_action( 'admin_menu', array( $admin, 'create_admin_menu' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts_and_styles' ) );
add_action( 'plugins_loaded', array( $this, 'textdomain' ) );
add_filter( 'plugin_action_links', array( $this, 'plugin_action_links' ), 10, 5 );
return $admin;
}
/**
* Display a Settings link on the main Plugins page
*
* @param array $links
* @param string $file
* @return array $links
* These are the links that go with this plugin's entry
*/
public function plugin_action_links( $links, $file ) {
if ( plugin_basename( __FILE__ ) === $file ) {
$settings = '<a href="' . get_admin_url() . 'options-general.php?page=object-sync-salesforce-admin">' . __( 'Settings', 'object-sync-for-salesforce' ) . '</a>';
// make the 'Settings' link appear first
array_unshift( $links, $settings );
}
return $links;
}
/**
* Admin styles. Load the CSS and JavaScript for the plugin's settings
*
* @return void
*/
public function admin_scripts_and_styles() {
// I think some developers might not want to bother with select2 or selectwoo, so let's allow that to be changeable
$select_library = apply_filters( $this->option_prefix . 'select_library', 'selectwoo' );
/*
* example to modify the select library
* add_filter( 'object_sync_for_salesforce_select_library', 'select_library', 10, 1 );
* function select_library( $select_library ) {
* $select_library = 'select2';
* // this could also be empty; in that case we would just use default browser select
* return $select_library;
* }
*/
$javascript_dependencies = array( 'jquery' );
$css_dependencies = array();
if ( '' !== $select_library ) {
wp_enqueue_script( $select_library . 'js', plugins_url( 'assets/js/vendor/' . $select_library . '.min.js', __FILE__ ), array( 'jquery' ), filemtime( plugin_dir_path( __FILE__ ) . 'assets/js/vendor/' . $select_library . '.min.js' ), true );
$javascript_dependencies[] = $select_library . 'js';
wp_enqueue_style( $select_library . 'css', plugins_url( 'assets/css/vendor/' . $select_library . '.min.css', __FILE__ ), array(), filemtime( plugin_dir_path( __FILE__ ) . 'assets/css/vendor/' . $select_library . '.min.css' ), 'all' );
$css_dependencies[] = $select_library . 'css';
}
wp_enqueue_script( $this->slug . '-admin', plugins_url( 'assets/js/object-sync-for-salesforce-admin.min.js', __FILE__ ), $javascript_dependencies, filemtime( plugin_dir_path( __FILE__ ) . 'assets/js/object-sync-for-salesforce-admin.min.js' ), true );
wp_enqueue_style( $this->slug . '-admin', plugins_url( 'assets/css/object-sync-for-salesforce-admin.css', __FILE__ ), $css_dependencies, filemtime( plugin_dir_path( __FILE__ ) . 'assets/css/object-sync-for-salesforce-admin.css' ), 'all' );
}
/**
* Load textdomain
*
* @return void
*/
public function textdomain() {
load_plugin_textdomain( 'object-sync-for-salesforce', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
/**
* Get the pre-login Salesforce credentials.
* These depend on the plugin's settings or constants defined in wp-config.php.
*
* @return array $login_credentials
* Includes all settings necessary to log into the Salesforce API.
* Replaces settings options with wp-config.php values if they exist.
*/
private function get_login_credentials() {
$consumer_key = defined( 'OBJECT_SYNC_SF_SALESFORCE_CONSUMER_KEY' ) ? OBJECT_SYNC_SF_SALESFORCE_CONSUMER_KEY : get_option( $this->option_prefix . 'consumer_key', '' );
$consumer_secret = defined( 'OBJECT_SYNC_SF_SALESFORCE_CONSUMER_SECRET' ) ? OBJECT_SYNC_SF_SALESFORCE_CONSUMER_SECRET : get_option( $this->option_prefix . 'consumer_secret', '' );
$callback_url = defined( 'OBJECT_SYNC_SF_SALESFORCE_CALLBACK_URL' ) ? OBJECT_SYNC_SF_SALESFORCE_CALLBACK_URL : get_option( $this->option_prefix . 'callback_url', '' );
$login_base_url = defined( 'OBJECT_SYNC_SF_SALESFORCE_LOGIN_BASE_URL' ) ? OBJECT_SYNC_SF_SALESFORCE_LOGIN_BASE_URL : get_option( $this->option_prefix . 'login_base_url', '' );
$authorize_url_path = defined( 'OBJECT_SYNC_SF_SALESFORCE_AUTHORIZE_URL_PATH' ) ? OBJECT_SYNC_SF_SALESFORCE_AUTHORIZE_URL_PATH : get_option( $this->option_prefix . 'authorize_url_path', '' );
$token_url_path = defined( 'OBJECT_SYNC_SF_SALESFORCE_TOKEN_URL_PATH' ) ? OBJECT_SYNC_SF_SALESFORCE_TOKEN_URL_PATH : get_option( $this->option_prefix . 'token_url_path', '' );
$api_version = defined( 'OBJECT_SYNC_SF_SALESFORCE_API_VERSION' ) ? OBJECT_SYNC_SF_SALESFORCE_API_VERSION : get_option( $this->option_prefix . 'api_version', '' );
$login_credentials = array(
'consumer_key' => $consumer_key,
'consumer_secret' => $consumer_secret,
'callback_url' => $callback_url,
'login_url' => $login_base_url,
'authorize_path' => $authorize_url_path,
'token_path' => $token_url_path,
'rest_api_version' => $api_version,
);
return $login_credentials;
}
/**
* Check the server to see if Soap is available
*
* @return bool $is_soap_available
*/
private function is_soap_available() {
$is_soap_available = false;
if ( extension_loaded( 'soap' ) && class_exists( 'SoapClient' ) ) {
$is_soap_available = true;
}
return $is_soap_available;
}
/**
* Check the plugin to see if the Soap option has been enabled and the class has been loaded
*
* @return bool $is_soap_loaded
*/
private function is_soap_loaded() {
$is_soap_loaded = false;
if ( false === $this->is_soap_available() ) {
return $is_soap_loaded;
}
$use_soap = filter_var( get_option( 'object_sync_for_salesforce_use_soap', false ), FILTER_VALIDATE_BOOLEAN );
if ( false === $use_soap ) {
return $is_soap_loaded;
}
require_once( plugin_dir_path( __FILE__ ) . 'classes/salesforce_soap_partner.php' );
if ( class_exists( 'Object_Sync_Sf_Salesforce_Soap_Partner' ) ) {
$is_soap_loaded = true;
}
return $is_soap_loaded;
}
} // end class
// Instantiate our class.
$object_sync_salesforce = Object_Sync_Salesforce::get_instance();