72% ni-woocommerce-customer-product-report

Code Review | Ni WooCommerce Customer Product Report

WordPress plugin Ni WooCommerce Customer Product Report scored72%from 54 tests.

About plugin

  • Plugin page: ni-woocommerce-cu...
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Jul 12, 2018
  • Latest release: May 12, 2023
  • Number of updates: 21
  • Update frequency: every 84.1 days
  • Top authors: anzia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,386 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
This plugin's installer ran successfully

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

An overview of server-side resources used by Ni WooCommerce Customer Product Report
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.17 ▼4.93
Dashboard /wp-admin3.41 ▲0.1145.16 ▼3.41
Posts /wp-admin/edit.php3.52 ▲0.1742.30 ▼7.29
Add New Post /wp-admin/post-new.php5.30 ▼0.5865.91 ▼31.85
Media Library /wp-admin/upload.php3.33 ▲0.1037.67 ▼0.82
Setting /wp-admin/admin.php?page=ni-woocpr-setting3.3130.67
Dashboard /wp-admin/admin.php?page=ni-woocpr3.5935.50

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 41 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
recovery_mode_email_last_sent
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ni WooCommerce Customer Product Report
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5114.24 ▼0.121.63 ▼0.1140.22 ▼1.79
Dashboard /wp-admin2,221 ▲415.64 ▼0.0183.18 ▼4.1741.24 ▼1.99
Posts /wp-admin/edit.php2,123 ▲441.95 ▼0.0837.93 ▲2.3934.20 ▲1.17
Add New Post /wp-admin/post-new.php45 ▼1,4810.42 ▼22.500.10 ▼696.419.37 ▼65.73
Media Library /wp-admin/upload.php1,423 ▲264.21 ▲0.00107.62 ▼3.6266.75 ▲17.20
Setting /wp-admin/admin.php?page=ni-woocpr-setting9091.8512.9638.44
Dashboard /wp-admin/admin.php?page=ni-woocpr1,3862.1617.2659.51

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • db_upgraded

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
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=ni-woocpr
    • > Error in wp-content/plugins/ni-woocommerce-customer-product-report/include/ni-woocpr-dashboard.php+267
    Uncaught Error: Call to undefined function wc_price() in wp-content/plugins/ni-woocommerce-customer-product-report/include/ni-woocpr-dashboard.php:267
    Stack trace:
    #0 wp-content/plugins/ni-woocommerce-customer-product-report/include/ni-woocpr-core.php(119): Ni_WooCPR_Dashboard->page_init()
    #1 wp-includes/class-wp-hook.php(310): Ni_WooCPR_Core->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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ni-woocommerce-customer-product-report/ni-woocommerce-product-customer-report.php:24

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ni-woocpr
    • > Network (severe)
    wp-content/plugins/ni-woocommerce-customer-product-report/admin/css/font-awesome.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 86% 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
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Dashboard analysis), #2 (Product customer report), #3 (Product customer report columns setting)
Please take inspiration from this readme.txt

ni-woocommerce-customer-product-report/ni-woocommerce-product-customer-report.php 77% from 13 tests

Analyzing the main PHP file in "Ni WooCommerce Customer Product Report" version 1.2.2
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ni-woocommerce-customer-product-report.php" instead of "ni-woocommerce-product-customer-report.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected18,025 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
CSS81,63816915,906
PHP63231021,736
JavaScript17637376
SVG1007

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity17.67
▷ Minimum class complexity3.00
▷ Maximum class complexity48.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods53
▷ Static methods23.77%
▷ Public methods53100.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

PNG files should be compressed to save space and minimize bandwidth usage
7 compressed PNG files occupy 0.31MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png8.99KB4.98KB▼ 44.62%
admin/css/images/sort_desc.png0.15KB0.25KB0.00%
admin/css/lib/images/ui-icons_444444_256x240.png3.19KB3.49KB0.00%
admin/css/images/sort_both.png0.20KB0.29KB0.00%
admin/css/images/sort_asc.png0.16KB0.25KB0.00%