68% object-sync-for-salesforce

Code Review | Object Sync for Salesforce

WordPress plugin Object Sync for Salesforce scored68%from 54 tests.

About plugin

  • Plugin page: object-sync-for-s...
  • Plugin version: 2.2.7
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1
  • WordPress version: 6.3.1
  • First release: May 30, 2017
  • Latest release: Feb 6, 2023
  • Number of updates: 166
  • Update frequency: every 12.5 days
  • Top authors: minnpost (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

900+ active /28,619 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.46MB] [CPU: ▲12.71ms] Passed 4 tests

Analyzing server-side resources used by Object Sync for Salesforce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4246.39 ▲2.66
Dashboard /wp-admin3.81 ▲0.5162.52 ▲10.02
Posts /wp-admin/edit.php3.86 ▲0.5065.04 ▲19.62
Add New Post /wp-admin/post-new.php6.35 ▲0.47112.88 ▲18.55
Media Library /wp-admin/upload.php3.67 ▲0.4453.55 ▲21.41
Scheduled Actions /wp-admin/tools.php?page=action-scheduler3.8358.47
Logs /wp-admin/edit.php?post_type=wp_log3.8051.06
Salesforce /wp-admin/options-general.php?page=object-sync-salesforce-admin3.6750.53
Add New /wp-admin/post-new.php?post_type=wp_log3.8865.18
Tags /wp-admin/edit-tags.php?taxonomy=wp_log_type&post_type=wp_log3.8157.80

Server storage [IO: ▲64.70MB] [DB: ▲0.01MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
It is recommended to fix the following issues
  • Try to limit filesystem usage to 25MB (currently using 64.70MB)
Filesystem: 1,244 new files
Database: 6 new tables, 12 new options
New tables
wp_actionscheduler_claims
wp_actionscheduler_logs
wp_actionscheduler_groups
wp_object_sync_sf_field_map
wp_object_sync_sf_object_map
wp_actionscheduler_actions
New WordPress options
action_scheduler_hybrid_store_demarkation
object_sync_for_salesforce_activate_time
can_compress_scripts
schema-ActionScheduler_LoggerSchema
action_scheduler_lock_async-request-runner
widget_recent-posts
schema-ActionScheduler_StoreSchema
theysaidso_admin_options
db_upgraded
object_sync_for_salesforce_db_version
...

Browser metrics Passed 4 tests

Object Sync for Salesforce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲11813.51 ▼1.241.79 ▼0.1636.97 ▼7.77
Dashboard /wp-admin2,253 ▲685.25 ▼0.57115.51 ▲15.4841.08 ▼2.25
Posts /wp-admin/edit.php2,139 ▲532.37 ▲0.3541.28 ▲4.0934.71 ▼2.13
Add New Post /wp-admin/post-new.php1,559 ▲2623.42 ▲0.20600.86 ▼85.3851.27 ▼7.68
Media Library /wp-admin/upload.php1,432 ▲504.58 ▲0.3799.29 ▼7.1546.29 ▲0.32
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,2812.1527.4227.80
Logs /wp-admin/edit.php?post_type=wp_log1,1002.4834.6127.59
Salesforce /wp-admin/options-general.php?page=object-sync-salesforce-admin1,0282.0527.6637.22
Add New /wp-admin/post-new.php?post_type=wp_log2,2607.98179.5462.25
Tags /wp-admin/edit-tags.php?taxonomy=wp_log_type&post_type=wp_log1,4352.1129.3531.11

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure failed, leaving 6 tables in the database
    • wp_actionscheduler_claims
    • wp_actionscheduler_groups
    • wp_object_sync_sf_field_map
    • wp_actionscheduler_logs
    • wp_actionscheduler_actions
    • wp_object_sync_sf_object_map
  • This plugin did not uninstall successfully, leaving 12 options in the database
    • object_sync_for_salesforce_db_version
    • schema-ActionScheduler_StoreSchema
    • can_compress_scripts
    • schema-ActionScheduler_LoggerSchema
    • object_sync_for_salesforce_activate_time
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • action_scheduler_hybrid_store_demarkation
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/object-sync-for-salesforce/templates/admin/error.php
  • 92× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'CronExpression_FieldInterface' not found in wp-content/plugins/object-sync-for-salesforce/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_AbstractField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/object-sync-for-salesforce/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_HoursField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/object-sync-for-salesforce/vendor/messageagency/force.com-toolkit-for-php/soapclient/SforcePartnerClient.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/object-sync-for-salesforce/vendor/woocommerce/action-scheduler/tests/phpunit/jobstore/AbstractStoreTest.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/object-sync-for-salesforce/templates/admin/mapping-errors-delete.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/object-sync-for-salesforce/vendor/woocommerce/action-scheduler/tests/phpunit/lock/ActionScheduler_OptionLock_Test.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/object-sync-for-salesforce/vendor/woocommerce/action-scheduler/tests/phpunit/helpers/ActionScheduler_Compatibility_Test.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_RecurringSchedule' not found in wp-content/plugins/object-sync-for-salesforce/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_CronSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/object-sync-for-salesforce/vendor/woocommerce/action-scheduler/tests/phpunit/logging/ActionScheduler_wpCommentLogger_Test.php:7
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/object-sync-for-salesforce/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: crm, salesforce, sync

object-sync-for-salesforce/object-sync-for-salesforce.php Passed 13 tests

The main PHP file in "Object Sync for Salesforce" ver. 2.2.7 adds more information about the plugin and also serves as the entry point for this plugin
96 characters long description:
Object Sync for Salesforce maps and syncs data between Salesforce objects and WordPress objects.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin330,615 lines of code in 809 files:
LanguageFilesBlank linesComment linesLines of code
HTML52679,831206281,594
PHP1764,64411,74721,609
XML666610712,099
JavaScript193215564,733
CSS143552013,566
Markdown481,21903,170
JSON7002,583
SVG94321,049
Bourne Shell12311147
Sass110047
YAML22018

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity16.33
▷ Minimum class complexity1.00
▷ Maximum class complexity313.00
Average method complexity2.90
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces5
Interfaces3
Traits0
Classes160
▷ Abstract classes1710.62%
▷ Concrete classes14389.38%
▷ Final classes00.00%
Methods1,344
▷ Static methods1007.44%
▷ Public methods1,04978.05%
▷ Protected methods16212.05%
▷ Private methods1339.90%
Functions49
▷ Named functions1938.78%
▷ Anonymous functions3061.22%
Constants59
▷ Global constants2338.98%
▷ Class constants3661.02%
▷ Public constants36100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
29 PNG files occupy 0.53MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
docs/code/images/hierarchy-item.png0.23KB0.20KB▼ 13.14%
docs/code/images/iviewer/iviewer.zoom_fit.png1.22KB0.30KB▼ 75.72%
vendor/woocommerce/action-scheduler/docs/favicon-32x32.png1.16KB0.71KB▼ 39.02%
docs/code/images/apple-touch-icon-72x72.png12.45KB5.26KB▼ 57.74%
docs/code/images/apple-touch-icon-114x114.png27.67KB10.58KB▼ 61.78%