73% leads-crm

Code Review | Leads CRM for WordPress WooCommerce

WordPress plugin Leads CRM for WordPress WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: leads-crm
  • Plugin version: 2.0.13
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.4.0-5.8.0
  • WordPress version: 6.3.1
  • First release: Nov 4, 2019
  • Latest release: Aug 4, 2021
  • Number of updates: 31
  • Update frequency: every 21.2 days
  • Top authors: bizswoop (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,328 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.47MB] [CPU: ▼1.85ms] Passed 4 tests

Analyzing server-side resources used by Leads CRM for WordPress WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2939.89 ▼3.91
Dashboard /wp-admin3.87 ▲0.5648.23 ▼3.01
Posts /wp-admin/edit.php3.92 ▲0.5651.27 ▼1.64
Add New Post /wp-admin/post-new.php6.41 ▲0.5292.33 ▲1.18
Media Library /wp-admin/upload.php3.73 ▲0.5040.63 ▲6.80
Leads /wp-admin/admin.php?page=zleadscrm_bookmarks3.9041.71
Analytics /wp-admin/admin.php?page=zleadscrm_insights3.7438.00
Settings /wp-admin/admin.php?page=zleadscrm_settings3.7539.89
Add-ons /wp-admin/admin.php?page=zleadscrm_addons3.7234.91

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 46 new files
Database: 4 new tables, 7 new options
New tables
wp_zleadscrm_leads_bookmarks
wp_zleadscrm_leads_user_analytics
wp_zleadscrm_leads_edit_audit
wp_zleadscrm_leads_interactions
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
zleadscrm_statistics_date
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Leads CRM for WordPress WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,878 ▲10713.63 ▼0.561.67 ▼0.3238.32 ▼6.10
Dashboard /wp-admin2,284 ▲965.19 ▼0.68112.42 ▼3.8641.29 ▼2.30
Posts /wp-admin/edit.php2,167 ▲782.41 ▲0.4142.18 ▲4.1636.64 ▲0.89
Add New Post /wp-admin/post-new.php1,574 ▲3723.86 ▲5.60640.64 ▲1.5835.83 ▼10.36
Media Library /wp-admin/upload.php1,469 ▲784.59 ▲0.38101.46 ▼3.0343.70 ▼1.03
Leads /wp-admin/admin.php?page=zleadscrm_bookmarks9872.0828.0232.86
Analytics /wp-admin/admin.php?page=zleadscrm_insights9112.1129.0628.59
Settings /wp-admin/admin.php?page=zleadscrm_settings2,7422.2628.2848.39
Add-ons /wp-admin/admin.php?page=zleadscrm_addons1,1012.2626.6437.06

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure failed, leaving 4 tables in the database
    • wp_zleadscrm_leads_user_analytics
    • wp_zleadscrm_leads_interactions
    • wp_zleadscrm_leads_edit_audit
    • wp_zleadscrm_leads_bookmarks
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • zleadscrm_statistics_date
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function zleadscrm_display_interaction_form() in wp-content/plugins/leads-crm/template/lead/add-new-lead/interactions.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'ZLEADSCRM_BASIC_PLUGIN_DIRhelper/class-zleadscrm-core-lead-edit-audit.php' (include_path='.:/usr/share/php') in wp-content/plugins/leads-crm/template/lead/add-new-lead/audit.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/leads-crm/template/lead/interactions/form.php:1
    • > PHP Warning
      require_once(ZLEADSCRM_BASIC_PLUGIN_DIRhelper/class-zleadscrm-core-lead-edit-audit.php): failed to open stream: No such file or directory in wp-content/plugins/leads-crm/template/lead/add-new-lead/audit.php on line 7
    • > PHP Warning
      Use of undefined constant ZLEADSCRM_BASIC_PLUGIN_DIR - assumed 'ZLEADSCRM_BASIC_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/leads-crm/template/lead/add-new-lead/audit.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/leads-crm/template/interactions/form.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function zleadscrm_display_interaction_form() in wp-content/plugins/leads-crm/template/interactions/interactions.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/leads-crm/leads-basic-functions.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/leads-crm/template/lead/add-new-lead/general.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (32 tag instead of maximum 10)
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4, #5, #6 in leads-crm/assets to your readme.txt
You can take inspiration from this readme.txt

leads-crm/leads-basic.php 77% from 13 tests

The main PHP file in "Leads CRM for WordPress WooCommerce" ver. 2.0.13 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0" instead of "2.4.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("leads-crm.php" instead of "leads-basic.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin7,108 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP24689355,036
CSS3456481,912
JavaScript2381158
Markdown1002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity52.67
▷ Minimum class complexity8.00
▷ Maximum class complexity158.00
Average method complexity5.71
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods64
▷ Static methods1117.19%
▷ Public methods6195.31%
▷ Protected methods00.00%
▷ Private methods34.69%
Functions41
▷ Named functions3687.80%
▷ Anonymous functions512.20%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
12 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
asset/jQuery-ui/ui-bg_glass_65_ffffff_1x400.png0.26KB0.09KB▼ 66.79%
asset/jQuery-ui/ui-icons_888888_256x240.png6.94KB4.18KB▼ 39.78%
asset/google-logo.png2.08KB2.14KB0.00%
asset/jQuery-ui/ui-bg_glass_55_fbf9ee_1x400.png0.38KB0.12KB▼ 67.68%
asset/jQuery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png0.32KB0.18KB▼ 44.00%