78% woocommerce-inventory-management

Code Review | Scanventory

WordPress plugin Scanventory scored 78% from 54 tests.

About plugin

  • Plugin page: woocommerce-inven...
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-4.9
  • WordPress version: 5.8.1
  • First release: Mar 13, 2014
  • Latest release: Oct 24, 2018
  • Number of updates: 25
  • Update frequency: every 67.8 days
  • Top authors: digdan (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

100+ active / 11,565 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
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Scanventory
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0339.12 ▲7.18
Dashboard /wp-admin3.14 ▲0.0941.24 ▼4.21
Posts /wp-admin/edit.php3.19 ▲0.0948.57 ▼0.45
Add New Post /wp-admin/post-new.php5.72 ▲0.2991.68 ▼589.30
Media Library /wp-admin/upload.php3.10 ▲0.1034.70 ▼0.54

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 73 new files
Database: no new tables, 2 new options
New WordPress options
scanventory_secret
scanventory_log

Browser metrics Passed 4 tests

A check of browser resources used by Scanventory
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲13115.80 ▲0.2010.86 ▲1.9759.76 ▲3.43
Dashboard /wp-admin2,967 ▲335.91 ▼0.04142.77 ▼17.09122.44 ▼3.21
Posts /wp-admin/edit.php2,739 ▼02.71 ▼0.0077.71 ▲5.3794.37 ▼2.67
Add New Post /wp-admin/post-new.php1,683 ▼018.34 ▼0.46413.80 ▲37.07115.42 ▲4.56
Media Library /wp-admin/upload.php1,807 ▼05.04 ▼0.00158.74 ▲0.05119.74 ▼5.44

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 were found after uninstall: 2 options
    • scanventory_secret
    • scanventory_log

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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 output text when accessed directly:
    • > /wp-content/plugins/woocommerce-inventory-management/classes/log.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function submit_button() in wp-content/plugins/woocommerce-inventory-management/templates/support.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed: Please take inspiration from this readme.txt

woocommerce-inventory-management/woocommerce-scanventory-light.php 92% from 13 tests

The primary PHP file in "Scanventory" version 1.1.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("woocommerce-inventory-management.php" instead of "woocommerce-scanventory-light.php")

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
There were no executable files found in this plugin13,666 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
CSS131,086306,718
SVG4004,293
PHP183122121,468
JavaScript24953231,187

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity26.65
▷ Minimum class complexity1.00
▷ Maximum class complexity71.00
Average method complexity4.02
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods170
▷ Static methods6840.00%
▷ Public methods16798.24%
▷ Protected methods00.00%
▷ Private methods31.76%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants36
▷ Global constants36100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/scanventory-logo-no-slogan.png8.75KB4.27KB▼ 51.18%
images/print.png0.96KB1.13KB0.00%