83% ni-one-page-inventory-management-system-for-woocommerce

Code Review | Ni One Page Inventory Management System For WooCommerce

WordPress plugin Ni One Page Inventory Management System For WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: ni-one-page-inven...
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 4, 2020
  • Latest release: Feb 19, 2023
  • Number of updates: 14
  • Update frequency: every 75.1 days
  • Top authors: anzia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,319 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.92ms] Passed 4 tests

This is a short check of server-side resources used by Ni One Page Inventory Management System For WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.71 ▲0.75
Dashboard /wp-admin3.34 ▼0.0147.36 ▼11.42
Posts /wp-admin/edit.php3.45 ▲0.1045.56 ▼3.23
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.07 ▼16.25
Media Library /wp-admin/upload.php3.26 ▲0.0333.97 ▼0.76
Stock Center /wp-admin/admin.php?page=niwopims-stock-center3.4032.25
Location /wp-admin/admin.php?page=niwopims-location3.3330.36
Dashboard /wp-admin/admin.php?page=niwopims-dashboard3.7030.58
Settings /wp-admin/admin.php?page=niwopims-settings3.2931.92
Product List /wp-admin/admin.php?page=niwopims-stock-list3.4035.60

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 44 new files
Database: 3 new tables, 7 new options
New tables
wp_niwopims_stock
wp_niwopims_purchase_header
wp_niwopims_purchase_detail
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
recovery_mode_email_last_sent
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ni One Page Inventory Management System For WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲7814.33 ▼0.221.75 ▲0.2243.50 ▲4.12
Dashboard /wp-admin2,230 ▲535.65 ▲0.0395.01 ▲3.8942.56 ▲2.35
Posts /wp-admin/edit.php2,132 ▲321.95 ▼0.0734.06 ▼5.4530.81 ▼5.22
Add New Post /wp-admin/post-new.php1,563 ▲2818.38 ▲0.16591.44 ▼52.4061.77 ▼3.91
Media Library /wp-admin/upload.php1,438 ▲414.39 ▲0.2299.09 ▲1.3041.74 ▲0.60
Stock Center /wp-admin/admin.php?page=niwopims-stock-center1,0522.3338.2468.68
Location /wp-admin/admin.php?page=niwopims-location1,0922.1234.7839.01
Dashboard /wp-admin/admin.php?page=niwopims-dashboard1,3901.6012.6075.35
Settings /wp-admin/admin.php?page=niwopims-settings9472.0627.5434.36
Product List /wp-admin/admin.php?page=niwopims-stock-list1,5902.8656.3940.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=niwopims-dashboard
    • > Error in wp-content/plugins/ni-one-page-inventory-management-system-for-woocommerce/includes/niwopims-dashboard.php+270
    Uncaught Error: Call to undefined function wc_price() in wp-content/plugins/ni-one-page-inventory-management-system-for-woocommerce/includes/niwopims-dashboard.php:270
    Stack trace:
    #0 wp-content/plugins/ni-one-page-inventory-management-system-for-woocommerce/includes/niwopims-core.php(213): NIWOPIMS_Dashboard->page_init()
    #1 wp-includes/class-wp-hook.php(310): NIWOPIMS_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 Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Dashboard show stock analysis summary), #2 (Product list, option to add stock, view purchase history and edit product), #3 (Add new purchase order.), #4 (View purchase product history, filter by date range.), #5 (Edit product.), #6 (Change number of record display on per page.), #7 (Stock center), #8 (Manage location), #9 (Setting page)
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
Please take inspiration from this readme.txt

ni-one-page-inventory-management-system-for-woocommerce/ni-one-page-inventory-management-system-for-woocommerce.php 92% from 13 tests

The primary PHP file in "Ni One Page Inventory Management System For WooCommerce" version 1.1.2 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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 plugin8,295 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP136821013,332
SVG1002,671
CSS51031181,661
JavaScript7212142622
HTML1109

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity25.58
▷ Minimum class complexity3.00
▷ Maximum class complexity54.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods101
▷ Static methods10.99%
▷ Public methods101100.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 PNG files occupy 0.40MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-8.png22.58KB12.93KB▼ 42.74%
screenshot-5.png80.53KB33.22KB▼ 58.75%
screenshot-4.png83.45KB34.70KB▼ 58.42%
screenshot-9.png6.34KB3.93KB▼ 38.04%
screenshot-3.png82.88KB34.41KB▼ 58.48%