89% woo-inventory-count

Code Review | WooCommerce POS Inventory Count

WordPress plugin WooCommerce POS Inventory Count scored89%from 54 tests.

About plugin

  • Plugin page: woo-inventory-count
  • Plugin version: 21.11.08
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Jul 24, 2017
  • Latest release: Nov 9, 2021
  • Number of updates: 92
  • Update frequency: every 17.1 days
  • Top authors: woopos (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /8,396 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.11MB] [CPU: ▼7.60ms] Passed 4 tests

Server-side resources used by WooCommerce POS Inventory Count
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1239.57 ▼2.30
Dashboard /wp-admin3.43 ▲0.0849.92 ▼19.39
Posts /wp-admin/edit.php3.48 ▲0.1252.77 ▲3.69
Add New Post /wp-admin/post-new.php6.03 ▲0.1499.74 ▼11.23
Media Library /wp-admin/upload.php3.35 ▲0.1237.46 ▲2.52

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce POS Inventory Count
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.26 ▼0.191.72 ▲0.1141.83 ▼1.21
Dashboard /wp-admin2,193 ▲195.62 ▼0.0285.16 ▼7.8138.88 ▼8.99
Posts /wp-admin/edit.php2,104 ▲42.03 ▼0.0342.71 ▲3.7136.74 ▲2.83
Add New Post /wp-admin/post-new.php1,535 ▼1023.27 ▲0.09675.97 ▼3.9259.05 ▲10.77
Media Library /wp-admin/upload.php1,407 ▲74.25 ▲0.01106.60 ▲5.2146.49 ▲1.90

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 does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
The official readme.txt might help

woo-inventory-count/woopos-wcic.php 92% from 13 tests

The entry point to "WooCommerce POS Inventory Count" version 21.11.08 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-inventory-count.php" instead of "woopos-wcic.php")

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
There were no executable files found in this plugin744 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP33158652
CSS10064
JavaScript15128

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions1794.44%
▷ Anonymous functions15.56%
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
5 PNG files occupy 0.29MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png65.73KB22.69KB▼ 65.48%
assets/screenshot-1.png96.79KB34.06KB▼ 64.81%
assets/woopos-logo-150px.png9.49KB3.73KB▼ 60.65%
assets/banner-772x250.png102.45KB39.22KB▼ 61.71%
assets/icon-128x128.png24.11KB8.40KB▼ 65.17%