67% dx-sales-crm

Code Review | DX Sales CRM

WordPress plugin DX Sales CRM scored67%from 54 tests.

About plugin

  • Plugin page: dx-sales-crm
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4.2
  • WordPress version: 6.3.1
  • First release: Nov 26, 2016
  • Latest release: Jun 24, 2020
  • Number of updates: 9
  • Update frequency: every 143.9 days
  • Top authors: devrix (88.89%)metodiew (22.22%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /4,746 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.37MB] [CPU: ▼2.99ms] Passed 4 tests

An overview of server-side resources used by DX Sales CRM
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.78 ▲1.3146.26 ▲3.86
Dashboard /wp-admin4.62 ▲1.2758.68 ▼6.04
Posts /wp-admin/edit.php4.99 ▲1.6366.94 ▲23.22
Add New Post /wp-admin/post-new.php7.46 ▲1.57107.22 ▼20.54
Media Library /wp-admin/upload.php4.54 ▲1.3146.67 ▲10.76
Skills /wp-admin/edit-tags.php?taxonomy=dxcrm_emp_skill&post_type=dxcrm_customers4.5345.30
Customers /wp-admin/edit.php?post_type=dxcrm_customers4.9052.28
Report /wp-admin/admin.php?page=dx-crm-stat-setting4.5744.46
Projects /wp-admin/edit.php?post_type=dxcrm_projects4.9152.65
Companies /wp-admin/edit.php?post_type=dxcrm_company4.9148.97
Project Type /wp-admin/edit-tags.php?taxonomy=dxcrm_pro_type&post_type=dxcrm_projects4.5342.35
Add New /wp-admin/post-new.php?post_type=dxcrm_customers4.9061.21
Activity Log /wp-admin/admin.php?page=dx-crm-activity-log4.5145.47
Add New /wp-admin/post-new.php?post_type=dxcrm_company5.0365.68
Sales CRM /wp-admin/admin.php?page=dxcrm_dashboard4.5654.04

Server storage [IO: ▲2.58MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 182 new files
Database: 4 new tables, 6 new options
New tables
wp_crm_customer
wp_crm_roadmap
wp_crm_company
wp_crm_project
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for DX Sales CRM
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲17913.27 ▼1.101.71 ▼0.1739.65 ▼3.26
Dashboard /wp-admin2,322 ▲1345.89 ▲0.87103.76 ▼15.1773.70 ▲29.77
Posts /wp-admin/edit.php2,239 ▲1502.44 ▲0.4143.76 ▼1.8851.23 ▲14.40
Add New Post /wp-admin/post-new.php1,614 ▲9222.67 ▼0.55671.66 ▲38.7940.73 ▼23.90
Media Library /wp-admin/upload.php1,504 ▲1164.15 ▼0.06119.20 ▲19.3451.88 ▲11.08
Skills /wp-admin/edit-tags.php?taxonomy=dxcrm_emp_skill&post_type=dxcrm_customers1,3842.1829.3330.52
Customers /wp-admin/edit.php?post_type=dxcrm_customers1,4342.4035.1948.78
Report /wp-admin/admin.php?page=dx-crm-stat-setting1,0922.4336.6634.46
Projects /wp-admin/edit.php?post_type=dxcrm_projects1,3512.2434.8733.98
Companies /wp-admin/edit.php?post_type=dxcrm_company1,3332.4137.3639.37
Project Type /wp-admin/edit-tags.php?taxonomy=dxcrm_pro_type&post_type=dxcrm_projects1,3782.4228.0631.95
Add New /wp-admin/post-new.php?post_type=dxcrm_customers2,0803.3772.6394.18
Activity Log /wp-admin/admin.php?page=dx-crm-activity-log9562.0922.8927.95
Add New /wp-admin/post-new.php?post_type=dxcrm_company2,7608.43196.70156.04
Sales CRM /wp-admin/admin.php?page=dxcrm_dashboard1,5112.5042.7693.25

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie tables detected upon uninstall: 4 tables
    • wp_crm_project
    • wp_crm_customer
    • wp_crm_company
    • wp_crm_roadmap
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/dx-sales-crm/includes/admin/dx-crm-download-verifier.php
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/dx-sales-crm/includes/admin/forms/crm-user-profile-metabox.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_terms() in wp-content/plugins/dx-sales-crm/templates/depreciated/crm-project-template.php:19
    • > PHP Warning
      Use of undefined constant DX_CRM_META_PREFIX - assumed 'DX_CRM_META_PREFIX' (this will throw an Error in a future version of PHP) in wp-content/plugins/dx-sales-crm/templates/depreciated/crm-project-template.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_terms() in wp-content/plugins/dx-sales-crm/templates/depreciated/crm-customer-template.php:27
    • > PHP Notice
      Undefined variable: user_role in wp-content/plugins/dx-sales-crm/includes/admin/forms/crm-user-profile-metabox.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_posts() in wp-content/plugins/dx-sales-crm/templates/depreciated/crm-company-template.php:19
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/dx-sales-crm/includes/admin/forms/crm-user-profile-metabox.php on line 17
    • > PHP Warning
      Use of undefined constant DX_CRM_META_PREFIX - assumed 'DX_CRM_META_PREFIX' (this will throw an Error in a future version of PHP) in wp-content/plugins/dx-sales-crm/templates/depreciated/crm-customer-template.php on line 10
    • > PHP Warning
      Use of undefined constant DX_CRM_CUSTOMER_ROLE - assumed 'DX_CRM_CUSTOMER_ROLE' (this will throw an Error in a future version of PHP) in wp-content/plugins/dx-sales-crm/includes/admin/forms/crm-user-profile-metabox.php on line 4
    • > PHP Warning
      Use of undefined constant DX_CRM_META_PREFIX - assumed 'DX_CRM_META_PREFIX' (this will throw an Error in a future version of PHP) in wp-content/plugins/dx-sales-crm/templates/depreciated/crm-company-template.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (DX Sales CRM Dashboard), #2 (All of the activities are listed in the Activity Log), #3 (The most important information from the Projects and the Customers is listed and easily reached), #4 (You can create Reports and export them as CSV)
The official readme.txt might help

dx-sales-crm/crm-system.php 77% from 13 tests

The primary PHP file in "DX Sales CRM" version 1.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("dx-sales-crm.php" instead of "crm-system.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
  • Description: Keep the plugin description shorter than 140 characters (currently 201 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected22,640 lines of code in 114 files:
LanguageFilesBlank linesComment linesLines of code
PHP603,0725,43910,010
CSS262141767,849
JavaScript269049024,188
SVG100565
JSON10028

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 116)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity95.31
▷ Minimum class complexity1.00
▷ Maximum class complexity286.00
Average method complexity5.30
▷ Minimum method complexity1.00
▷ Maximum method complexity116.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods285
▷ Static methods20.70%
▷ Public methods26693.33%
▷ Protected methods00.00%
▷ Private methods196.67%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants34
▷ Global constants34100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
58 PNG files occupy 0.51MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/scripts/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
assets/images/tb-close.png0.49KB0.42KB▼ 14.62%
assets/images/add.png1.02KB1.03KB0.00%
assets/images/Sales_CRM_hover.png1.30KB1.13KB▼ 13.29%
screenshot-2.png63.59KB29.02KB▼ 54.37%