72% ni-woocommerce-product-vendor

Code Review | Ni WooCommerce Product Vendor

WordPress plugin Ni WooCommerce Product Vendor scored72%from 54 tests.

About plugin

  • Plugin page: ni-woocommerce-pr...
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 3, 2018
  • Latest release: Feb 19, 2023
  • Number of updates: 14
  • Update frequency: every 114.3 days
  • Top authors: anzia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /934 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

This is a short check of server-side resources used by Ni WooCommerce Product Vendor
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0739.20 ▼3.09
Dashboard /wp-admin3.38 ▲0.0850.67 ▲3.01
Posts /wp-admin/edit.php3.50 ▲0.1448.69 ▼0.64
Add New Post /wp-admin/post-new.php5.99 ▲0.1079.63 ▼7.96
Media Library /wp-admin/upload.php3.31 ▲0.0733.98 ▼0.29
Order Product Report /wp-admin/admin.php?page=niwoopv-order-product-report3.3331.43
Stock Report /wp-admin/admin.php?page=niwoopv-stock-report3.3132.75
Dashboard /wp-admin/admin.php?page=niwoopv-dashboard3.5631.68
Setting /wp-admin/admin.php?page=niwoopv-setting3.2831.29

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 32 new files
Database: no new tables, 7 new options
New WordPress options
recovery_mode_email_last_sent
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ni WooCommerce Product Vendor
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6414.35 ▼0.201.78 ▲0.0346.99 ▲4.37
Dashboard /wp-admin2,234 ▲575.63 ▼0.0593.77 ▼0.1742.05 ▼8.23
Posts /wp-admin/edit.php2,136 ▲332.13 ▲0.1334.00 ▼6.0532.65 ▼3.68
Add New Post /wp-admin/post-new.php1,556 ▲2823.32 ▲0.26650.20 ▲72.6451.83 ▼1.75
Media Library /wp-admin/upload.php1,430 ▲364.19 ▼0.0199.67 ▲2.8643.10 ▲1.78
Order Product Report /wp-admin/admin.php?page=niwoopv-order-product-report1,0621.7130.1571.23
Stock Report /wp-admin/admin.php?page=niwoopv-stock-report9721.8431.6933.52
Dashboard /wp-admin/admin.php?page=niwoopv-dashboard1,3962.1513.7649.61
Setting /wp-admin/admin.php?page=niwoopv-setting8671.6825.5424.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • 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 shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=niwoopv-dashboard
    • > Error in wp-content/plugins/ni-woocommerce-product-vendor/includes/niwoopv-dashboard.php+258
    Uncaught Error: Call to undefined function wc_price() in wp-content/plugins/ni-woocommerce-product-vendor/includes/niwoopv-dashboard.php:258
    Stack trace:
    #0 wp-content/plugins/ni-woocommerce-product-vendor/includes/niwoopv-core.php(26): NIWooPV_Dashboard->get_page_init()
    #1 wp-includes/class-wp-hook.php(310): NIWooPV_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 | 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/ni-woocommerce-product-vendor/ni-woocommerce-product-vendor.php:23

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=niwoopv-dashboard
    • > Network (severe)
    wp-content/plugins/ni-woocommerce-product-vendor/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 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Dashboard show last 30 days order count and order total), #2 (Order product report), #3 (Stock report.), #4 (Setting page select user role), #5 (Product edit - Select product vendor.), #6 (Add new product vendor and select role "Ni Product vendor")
You can look at the official readme.txt

ni-woocommerce-product-vendor/ni-woocommerce-product-vendor.php 85% from 13 tests

"Ni WooCommerce Product Vendor" version 1.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: The domain path folder does not exist ("/languages/")

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
No dangerous file extensions were detected3,771 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP9334952,030
CSS3113841,599
JavaScript11924135
SVG1007

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity15.67
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity3.06
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods64
▷ Static methods00.00%
▷ Public methods64100.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 PNG files occupy 0.43MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png37.17KB12.31KB▼ 66.89%
screenshot-1.png258.74KB102.04KB▼ 60.56%
screenshot-2.png32.86KB10.55KB▼ 67.89%
screenshot-5.png75.49KB31.58KB▼ 58.18%
screenshot-4.png2.69KB1.92KB▼ 28.70%