80% woocommerce-stock-manager

Code Review | Stock Manager for WooCommerce

WordPress plugin Stock Manager for WooCommerce scored80%from 54 tests.

About plugin

  • Plugin page: woocommerce-stock...
  • Plugin version: 3.0.0
  • PHP compatiblity: 5.6++
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Apr 21, 2015
  • Latest release: Aug 1, 2023
  • Number of updates: 104
  • Update frequency: every 29.1 days
  • Top authors: storeapps (53.85%)Musilda (47.12%)

Code review

54 tests

User reviews

122 reviews

Install metrics

30,000+ active /655,539 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.30MB] [CPU: ▼7.29ms] Passed 4 tests

This is a short check of server-side resources used by Stock Manager for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3549.84 ▲6.25
Dashboard /wp-admin3.58 ▲0.2453.66 ▼15.75
Posts /wp-admin/edit.php3.68 ▲0.3255.21 ▲3.24
Add New Post /wp-admin/post-new.php6.26 ▲0.3789.54 ▼21.09
Media Library /wp-admin/upload.php3.52 ▲0.2939.91 ▲4.45

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Stock Manager for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.36 ▲0.072.04 ▲0.2442.72 ▼3.08
Dashboard /wp-admin2,198 ▲215.58 ▼0.0984.84 ▼9.2238.68 ▼10.35
Posts /wp-admin/edit.php2,103 ▲32.00 ▲0.0339.50 ▲1.6134.23 ▼2.84
Add New Post /wp-admin/post-new.php1,526 ▼723.27 ▲0.22631.31 ▼26.2260.65 ▲5.68
Media Library /wp-admin/upload.php1,397 ▼04.17 ▼0.2199.97 ▼1.6545.22 ▼0.53

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_stock_log
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
The SRP test was a success

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)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: woocommerce stock management, woocommerce stock management free, woocommerce inventory management, woocommerce stock manager, woocommerce product stock manager

woocommerce-stock-manager/woocommerce-stock-manager.php 92% from 13 tests

Analyzing the main PHP file in "Stock Manager for WooCommerce" version 3.0.0
Please make the necessary changes and fix the following:
  • Requires PHP: Required version number should use periods and dots only (ex. "7.0" instead of "5.6+")

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
Everything looks great! No dangerous files found in this plugin19,621 lines of code in 60 files:
LanguageFilesBlank linesComment linesLines of code
JSON30015,205
JavaScript32270411,943
PHP183435371,845
CSS34736561
Sass411067

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity23.00
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods50
▷ Static methods1428.00%
▷ Public methods4284.00%
▷ Protected methods00.00%
▷ Private methods816.00%
Functions15
▷ Named functions1066.67%
▷ Anonymous functions533.33%
Constants4
▷ Global constants4100.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
1 compressed PNG file occupies 0.05MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
sa-includes/images/bfcm-2022.png54.96KB57.55KB0.00%