78% ni-woocommerce-sales-report-by-user-role

Code Review | Ni WooCommerce Sales Report By User Role

WordPress plugin Ni WooCommerce Sales Report By User Role scored78%from 54 tests.

About plugin

  • Plugin page: ni-woocommerce-sa...
  • Plugin version: 2.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 9, 2017
  • Latest release: Nov 23, 2023
  • Number of updates: 54
  • Update frequency: every 46.3 days
  • Top authors: anzia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /8,933 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.88ms] Passed 4 tests

Server-side resources used by Ni WooCommerce Sales Report By User Role
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.58 ▲0.13
Dashboard /wp-admin3.40 ▲0.0547.91 ▼14.61
Posts /wp-admin/edit.php3.52 ▲0.1648.83 ▲0.43
Add New Post /wp-admin/post-new.php5.99 ▲0.10100.19 ▼1.45
Media Library /wp-admin/upload.php3.33 ▲0.0937.29 ▲2.33
Sales Product Report /wp-admin/admin.php?page=ni-sales-order-by-user-role3.3832.86
Dashboard /wp-admin/admin.php?page=ni-dashboard-user-role3.4038.56
Setting /wp-admin/admin.php?page=ni-user-role-setting3.3034.52
Agent Report /wp-admin/admin.php?page=ni-sales-agent-report3.3334.59

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

An overview of browser requirements for Ni WooCommerce Sales Report By User Role
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲7414.27 ▼0.431.63 ▼0.0146.27 ▲2.07
Dashboard /wp-admin2,223 ▲425.53 ▼0.1696.13 ▼8.1646.63 ▲1.75
Posts /wp-admin/edit.php2,134 ▲342.01 ▼0.0137.77 ▼2.5536.53 ▲0.60
Add New Post /wp-admin/post-new.php1,551 ▲2523.18 ▼0.04587.44 ▼74.7942.49 ▼10.57
Media Library /wp-admin/upload.php1,431 ▲314.18 ▲0.03100.39 ▲3.9543.23 ▲2.65
Sales Product Report /wp-admin/admin.php?page=ni-sales-order-by-user-role9321.8531.1737.43
Dashboard /wp-admin/admin.php?page=ni-dashboard-user-role8671.139.1459.37
Setting /wp-admin/admin.php?page=ni-user-role-setting8862.0127.3726.01
Agent Report /wp-admin/admin.php?page=ni-sales-agent-report9132.0932.0031.77

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% 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
    • > GET request to /wp-admin/admin.php?page=ni-dashboard-user-role
    • > Error in wp-content/plugins/ni-woocommerce-sales-report-by-user-role/include/ni-dashboard-user-role.php+63
    Uncaught Error: Call to undefined function wc_price() in wp-content/plugins/ni-woocommerce-sales-report-by-user-role/include/ni-dashboard-user-role.php:63
    Stack trace:
    #0 wp-content/plugins/ni-woocommerce-sales-report-by-user-role/include/ni-sales-report-by-user-role-init.php(49): Ni_Dashboard_User_Role->init()
    #1 wp-includes/class-wp-hook.php(310): Ni_Sales_Report_By_User_Role_Init->add_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ni-woocommerce-sales-report-by-user-role/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Create new user/sales agent and assign role Ni Sales Agent.), #2 (Set the role in "User Role Report" setting page.), #3 (Edit order and assign the sales agent.), #4 (Sales summary on dashboard.), #5 (Recent order list.), #6 (Sales order filter option.), #7 (Sales Agent Report.)
You can look at the official readme.txt

ni-woocommerce-sales-report-by-user-role/ni-woocommerce-sales-report-by-user-role.php Passed 13 tests

"Ni WooCommerce Sales Report By User Role" version 2.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
121 characters long description:
Ni WooCommerce Sales Report by user role provide the option to link the sales order with your sales agent or salesperson.

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
Success! There were no dangerous files found in this plugin7,528 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
CSS443713,592
SVG1002,671
PHP81861131,249
JavaScript24816

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity17.14
▷ Minimum class complexity2.00
▷ Maximum class complexity30.00
Average method complexity3.02
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods56
▷ Static methods00.00%
▷ Public methods56100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
7 PNG files occupy 0.16MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png13.24KB8.01KB▼ 39.53%
screenshot-4.png30.83KB16.53KB▼ 46.37%
screenshot-1.png28.18KB14.02KB▼ 50.25%
screenshot-2.png18.11KB9.31KB▼ 48.60%
screenshot-6.png12.74KB7.95KB▼ 37.63%