72% 1crm-customer-connection

Code Review | 1CRM Customer Connection for Wordpress

WordPress plugin 1CRM Customer Connection for Wordpress scored 72% from 54 tests.

About plugin

  • Plugin page: 1crm-customer-con...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.5-5.4.1
  • WordPress version: 5.9.2
  • First release: Feb 27, 2020
  • Latest release: Nov 16, 2020
  • Number of updates: 10
  • Update frequency: every 26.4 days
  • Top authors: 1crmcorp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 501 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.37MB] [CPU: ▼306.12ms] Passed 4 tests

Server-side resources used by 1CRM Customer Connection for Wordpress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.08 ▼0.449.26 ▼43.86
Dashboard /wp-admin4.03 ▲0.6336.38 ▲3.41
Posts /wp-admin/edit.php4.32 ▲0.6845.74 ▲9.96
Add New Post /wp-admin/post-new.php7.56 ▲0.5998.28 ▼1,187.88
Media Library /wp-admin/upload.php3.98 ▲0.6927.77 ▲3.84
1CRM Customer Connection /wp-admin/admin.php?page=onecrm_p3.9526.55
Usage Guide /wp-admin/admin.php?page=onecrm_p_shortcodes3.9524.96
Dashboard Settings /wp-admin/admin.php?page=onecrm_p_dashboard4.0526.62
Booking Calendar /wp-admin/admin.php?page=onecrm_p_booking4.0530.31

Server storage [IO: ▲4.06MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 248 new files
Database: no new tables, 2 new options
New WordPress options
onecrm_p_bc_sync_running
widget_onecrm_customer_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for 1CRM Customer Connection for Wordpress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,846 ▲8816.09 ▲0.117.03 ▲0.072.29 ▼0.60
Dashboard /wp-admin2,945 ▲876.27 ▲0.07122.54 ▼11.46163.97 ▲0.99
Posts /wp-admin/edit.php2,754 ▲663.28 ▲0.0464.32 ▲0.27191.38 ▲47.20
Add New Post /wp-admin/post-new.php1,695 ▲3416.28 ▲0.14417.33 ▼26.09161.98 ▲5.75
Media Library /wp-admin/upload.php1,757 ▲565.57 ▲0.06141.13 ▲5.63188.89 ▲7.28
1CRM Customer Connection /wp-admin/admin.php?page=onecrm_p1,1082.7858.13117.38
Usage Guide /wp-admin/admin.php?page=onecrm_p_shortcodes1,2832.7856.17142.64
Dashboard Settings /wp-admin/admin.php?page=onecrm_p_dashboard1,0612.7656.81100.93
Booking Calendar /wp-admin/admin.php?page=onecrm_p_booking8712.1838.7680.82

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 2 options
    • onecrm_p_bc_sync_running
    • widget_onecrm_customer_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=onecrm_p_booking
    • > Notice in wp-content/plugins/1crm-customer-connection/include/class/Auth/OneCrm.php+53
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 92× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      fwrite() expects parameter 1 to be resource, string given in wp-content/plugins/1crm-customer-connection/vendor/guzzlehttp/guzzle/build/Burgomaster.php on line 115
    • > PHP Fatal error
      Uncaught InvalidArgumentException: vendor/guzzlehttp/promises/src not found in wp-content/plugins/1crm-customer-connection/vendor/guzzlehttp/guzzle/build/Burgomaster.php:166
    • > PHP Warning
      Use of undefined constant STDERR - assumed 'STDERR' (this will throw an Error in a future version of PHP) in wp-content/plugins/1crm-customer-connection/vendor/guzzlehttp/guzzle/build/Burgomaster.php on line 115
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/1crm-customer-connection/vendor/guzzlehttp/psr7/src/BufferStream.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/1crm-customer-connection/vendor/guzzlehttp/psr7/src/CachingStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'OneCRM\\APIClient\\Authentication' not found in wp-content/plugins/1crm-customer-connection/vendor/onecrm/api/src/APIClient/Authentication/Basic.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/1crm-customer-connection/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\TaskQueueInterface' not found in wp-content/plugins/1crm-customer-connection/vendor/guzzlehttp/promises/src/TaskQueue.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'OneCRM\\Portal\\Booking\\CrmEntry' not found in wp-content/plugins/1crm-customer-connection/include/class/Booking/CrmPayment.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/1crm-customer-connection/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=onecrm_p_booking
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.9.2 1:31592 "jQuery.Deferred exception: $(...).sortable is not a function" "TypeError: $(...).sortable is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/1crm-customer-connection/js/admin.js?ver=5.9.2:41:26)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.9.2:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.9.2:2:30340)" undefined
    • > GET request to /wp-admin/admin.php?page=onecrm_p_booking
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.9.2 1:31702 Uncaught TypeError: $(...).sortable is not a function

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Contributors: Plugin contributors not specified
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt is a good inspiration

1crm-customer-connection/onecrm_portal.php 85% from 13 tests

The main file in "1CRM Customer Connection for Wordpress" v. 1.0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("1crm-customer-connection.php" instead of "onecrm_portal.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin30,281 lines of code in 216 files:
LanguageFilesBlank linesComment linesLines of code
PHP1683,0987,61516,661
SVG30124,482
JavaScript72191012,478
CSS8173302,330
Markdown1184602,260
PO File2298354914
JSON1000745
HTML2292233
make219069
XML10068
YAML13031
Dockerfile18010

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity14.62
▷ Minimum class complexity1.00
▷ Maximum class complexity214.00
Average method complexity2.82
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces18
Interfaces17
Traits2
Classes121
▷ Abstract classes10.83%
▷ Concrete classes12099.17%
▷ Final classes108.33%
Methods990
▷ Static methods10010.10%
▷ Public methods77478.18%
▷ Protected methods555.56%
▷ Private methods16116.26%
Functions284
▷ Named functions13146.13%
▷ Anonymous functions15353.87%
Constants81
▷ Global constants1113.58%
▷ Class constants7086.42%
▷ Public constants70100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/grid.png0.69KB0.42KB▼ 39.55%
css/images/paypal_button.png2.24KB1.15KB▼ 48.50%
css/images/list.png0.33KB0.24KB▼ 27.30%