88% stock-management-for-woocommerce

Code Review | Stock Manager for WooCommerce

WordPress plugin Stock Manager for WooCommerce scored 88% from 54 tests.

About plugin

  • Plugin page: stock-management-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.3-4.7.5
  • WordPress version: 5.8.1
  • First release: Jun 5, 2017
  • Latest release: Jun 5, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: maestroplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 425 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

This is a short check of server-side resources used by Stock Manager for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.0834.17 ▲0.17
Dashboard /wp-admin3.14 ▲0.0944.49 ▼3.81
Posts /wp-admin/edit.php3.25 ▲0.1440.35 ▼3.90
Add New Post /wp-admin/post-new.php5.50 ▲0.0797.23 ▼562.08
Media Library /wp-admin/upload.php3.08 ▲0.0832.08 ▼6.22

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 42 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Stock Manager for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,693 ▲9715.89 ▲0.209.61 ▼0.0544.43 ▼4.65
Dashboard /wp-admin2,974 ▲465.93 ▼0.13140.78 ▼12.70123.04 ▲9.52
Posts /wp-admin/edit.php2,768 ▲292.71 ▲0.0169.35 ▲2.3285.14 ▼3.79
Add New Post /wp-admin/post-new.php1,693 ▲1018.75 ▲0.27388.63 ▼27.66119.17 ▲16.41
Media Library /wp-admin/upload.php1,836 ▲295.00 ▼0.05138.43 ▼23.41139.29 ▲21.35

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 50% from 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 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
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/stock-management-for-woocommerce/pages/dashboard.php
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      include(): Failed opening 'mp_stoman_consts_pluginPath/controls/topmenu.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/stock-management-for-woocommerce/pages/dashboard.php on line 26
    • > PHP Warning
      include(mp_stoman_consts_pluginPath/controls/topmenu.php): failed to open stream: No such file or directory in wp-content/plugins/stock-management-for-woocommerce/pages/dashboard.php on line 26
    • > PHP Warning
      Use of undefined constant mp_stoman_consts_pluginUrl - assumed 'mp_stoman_consts_pluginUrl' (this will throw an Error in a future version of PHP) in wp-content/plugins/stock-management-for-woocommerce/pages/dashboard.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/stock-management-for-woocommerce/controls/topmenu.php:29
    • > PHP Warning
      Use of undefined constant mp_stoman_consts_pluginPath - assumed 'mp_stoman_consts_pluginPath' (this will throw an Error in a future version of PHP) in wp-content/plugins/stock-management-for-woocommerce/pages/dashboard.php on line 26

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 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: stock, woocommerce, manager, products, management

stock-management-for-woocommerce/maestroplugins-stock-manager-for-woocommerce.php 77% from 13 tests

The primary PHP file in "Stock Manager for WooCommerce" version 1.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 187 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("stock-management-for-woocommerce.php" instead of "maestroplugins-stock-manager-for-woocommerce.php")
  • 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

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 plugin13,346 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
CSS7662669,182
SVG1002,671
JavaScript8147116823
PHP15399231670

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity2.75
▷ Minimum class complexity1.00
▷ Maximum class complexity6.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods480.00%
▷ Protected methods00.00%
▷ Private methods120.00%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/wp-pluginlogo.png0.94KB0.87KB▼ 7.28%