72% 1crm-customer-connection

Code Review | 1CRM Customer Connection for Wordpress

WordPress plugin 1CRM Customer Connection for Wordpress scored72%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: 6.3.1
  • 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 /821 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.45MB] [CPU: ▼5.58ms] Passed 4 tests

This is a short check of server-side resources used by 1CRM Customer Connection for Wordpress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.27 ▼0.1914.09 ▼32.98
Dashboard /wp-admin3.99 ▲0.6852.88 ▲0.63
Posts /wp-admin/edit.php4.04 ▲0.6858.31 ▼0.46
Add New Post /wp-admin/post-new.php6.52 ▲0.64118.68 ▲17.60
Media Library /wp-admin/upload.php3.91 ▲0.6850.04 ▲10.51
Usage Guide /wp-admin/admin.php?page=onecrm_p_shortcodes3.8154.38
Dashboard Settings /wp-admin/admin.php?page=onecrm_p_dashboard3.9140.85
Booking Calendar /wp-admin/admin.php?page=onecrm_p_booking3.9140.63
1CRM Customer Connection /wp-admin/admin.php?page=onecrm_p3.8142.75

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 248 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
onecrm_p_bc_sync_running
can_compress_scripts
widget_onecrm_customer_widget
widget_recent-posts

Browser metrics Passed 4 tests

1CRM Customer Connection for Wordpress: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲7814.37 ▼0.282.98 ▲1.1845.25 ▼7.88
Dashboard /wp-admin2,240 ▲635.77 ▲0.1193.49 ▼9.9143.65 ▼0.67
Posts /wp-admin/edit.php2,148 ▲482.23 ▲0.2337.89 ▼3.7533.42 ▼6.72
Add New Post /wp-admin/post-new.php1,561 ▲1617.57 ▼5.84661.71 ▼89.4050.13 ▼20.72
Media Library /wp-admin/upload.php1,444 ▲504.19 ▼0.07121.94 ▼2.1552.56 ▼3.60
Usage Guide /wp-admin/admin.php?page=onecrm_p_shortcodes9841.8636.8852.64
Dashboard Settings /wp-admin/admin.php?page=onecrm_p_dashboard8471.8631.4930.71
Booking Calendar /wp-admin/admin.php?page=onecrm_p_booking7171.3810.9425.58
1CRM Customer Connection /wp-admin/admin.php?page=onecrm_p8861.8430.3626.77

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_onecrm_customer_widget
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • onecrm_p_bc_sync_running

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
Smoke test failed, please fix the following
  • 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
Please fix the following
  • 92× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'OneCRM\\APIClient\\Client' not found in wp-content/plugins/1crm-customer-connection/include/class/API/Client.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'OneCRM\\Portal\\Renderer\\HTML' not found in wp-content/plugins/1crm-customer-connection/include/class/Renderer/ListView.php:12
    • > 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 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/1crm-customer-connection/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'OneCRM\\APIClient\\Authentication' not found in wp-content/plugins/1crm-customer-connection/vendor/onecrm/api/src/APIClient/Authentication/OAuth.php:10
    • > 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\\UploadedFileInterface' not found in wp-content/plugins/1crm-customer-connection/vendor/guzzlehttp/psr7/src/UploadedFile.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/1crm-customer-connection/vendor/guzzlehttp/psr7/src/DroppingStream.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'OneCRM\\Portal\\Renderer\\DetailView' not found in wp-content/plugins/1crm-customer-connection/include/class/Renderer/EditView.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/1crm-customer-connection/vendor/psr/http-message/src/ServerRequestInterface.php:43

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > 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=6.3.1 1:28609 "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=6.3.1:41:26)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" 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=6.3.1 1:28721 Uncaught TypeError: $(...).sortable is not a function

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Contributors: The plugin contributors field is missing
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

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

"1CRM Customer Connection for Wordpress" version 1.0.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and 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: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous 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

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No 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

It is recommended to compress PNG files in your plugin to 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/paypal_button.png2.24KB1.15KB▼ 48.50%
css/images/list.png0.33KB0.24KB▼ 27.30%
css/images/grid.png0.69KB0.42KB▼ 39.55%