79% ni-woo-sales-commission

Code Review | Ni Sales Commission For WooCommerce

WordPress plugin Ni Sales Commission For WooCommerce scored79%from 54 tests.

About plugin

  • Plugin page: ni-woo-sales-comm...
  • Plugin version: 1.2.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Oct 28, 2019
  • Latest release: May 8, 2023
  • Number of updates: 29
  • Update frequency: every 44.5 days
  • Top authors: anzia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /3,226 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
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼1.61ms] Passed 4 tests

Server-side resources used by Ni Sales Commission For WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0944.34 ▲2.78
Dashboard /wp-admin3.40 ▲0.0950.24 ▼1.15
Posts /wp-admin/edit.php3.51 ▲0.1551.65 ▲0.05
Add New Post /wp-admin/post-new.php5.98 ▲0.0991.56 ▼7.29
Media Library /wp-admin/upload.php3.32 ▲0.0938.92 ▲1.96
User Role /wp-admin/admin.php?page=niwoosc-user-role3.3135.56
Other Plugins /wp-admin/admin.php?page=niwoosc-other-plugin3.3133.72
Order Report /wp-admin/admin.php?page=niwoosc-order-report3.3437.50
Dashboard /wp-admin/admin.php?page=niwoosc-dashboard3.3834.28
Commission Report /wp-admin/admin.php?page=niwoosc-commission-report3.3436.47

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 33 new files
Database: 1 new table, 6 new options
New tables
wp_niwoosc_user_role_commission
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Ni Sales Commission For WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.35 ▲0.351.85 ▲0.1946.47 ▲0.16
Dashboard /wp-admin2,233 ▲565.65 ▲0.0588.12 ▼1.6039.33 ▲0.68
Posts /wp-admin/edit.php2,135 ▲352.01 ▲0.0037.36 ▼2.8832.90 ▼5.71
Add New Post /wp-admin/post-new.php1,554 ▲2623.19 ▲0.16694.65 ▲37.9251.99 ▼10.79
Media Library /wp-admin/upload.php1,438 ▲384.20 ▲0.02101.62 ▼11.6344.32 ▼1.72
User Role /wp-admin/admin.php?page=niwoosc-user-role1,1261.9032.8741.71
Other Plugins /wp-admin/admin.php?page=niwoosc-other-plugin1,1431.9327.8437.73
Order Report /wp-admin/admin.php?page=niwoosc-order-report1,0061.8937.5128.31
Dashboard /wp-admin/admin.php?page=niwoosc-dashboard1,6332.0426.7340.32
Commission Report /wp-admin/admin.php?page=niwoosc-commission-report9561.8532.7524.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_niwoosc_user_role_commission
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Dashboard Sales count and amount), #2 (Order Report Information), #3 (Sales Commission report), #4 (Setting option to set the Commission), #5 (Commission detail in order)
The official readme.txt is a good inspiration

ni-woo-sales-commission/ni-sales-commission-for-woocommerce.php 85% from 13 tests

The principal PHP file in "Ni Sales Commission For WooCommerce" v. 1.2.3 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ni-woo-sales-commission.php" instead of "ni-sales-commission-for-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected4,656 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
SVG1002,671
PHP103121181,472
CSS35447303
PO File15871135
JavaScript3202166
HTML1109

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity12.90
▷ Minimum class complexity1.00
▷ Maximum class complexity24.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods61
▷ Static methods23.28%
▷ Public methods61100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.21MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png5.68KB3.69KB▼ 35.04%
screenshot-2.png42.35KB12.03KB▼ 71.60%
screenshot-1.png82.31KB14.48KB▼ 82.41%
screenshot-4.png45.23KB11.37KB▼ 74.86%
screenshot-3.png40.91KB11.61KB▼ 71.63%