77% products-stock-manager-with-excel

Code Review | Products Stock Manager with Excel for WooCommerce Inventory

WordPress plugin Products Stock Manager with Excel for WooCommerce Inventory scored77%from 54 tests.

About plugin

  • Plugin page: products-stock-ma...
  • Plugin version: 1.8
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.2-6.2
  • WordPress version: 6.3.1
  • First release: Jul 8, 2020
  • Latest release: Jul 13, 2023
  • Number of updates: 24
  • Update frequency: every 45.8 days
  • Top authors: taz_bambu (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /2,519 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.52MB] [CPU: ▼2.55ms] Passed 4 tests

Analyzing server-side resources used by Products Stock Manager with Excel for WooCommerce Inventory
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.02 ▲0.5538.73 ▲0.44
Dashboard /wp-admin3.87 ▲0.5648.96 ▲3.05
Posts /wp-admin/edit.php3.92 ▲0.5650.37 ▼0.23
Add New Post /wp-admin/post-new.php6.38 ▲0.4982.22 ▼13.45
Media Library /wp-admin/upload.php3.73 ▲0.4938.30 ▲7.31
Stock Manager /wp-admin/admin.php?page=stock-manager-woocommerce3.6934.09

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 400 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Products Stock Manager with Excel for WooCommerce Inventory
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲11313.21 ▼1.424.00 ▲2.4239.82 ▲2.70
Dashboard /wp-admin2,265 ▲744.97 ▲0.11109.56 ▲5.2278.50 ▲34.51
Posts /wp-admin/edit.php2,151 ▲621.97 ▼0.0738.24 ▲2.0235.82 ▲5.54
Add New Post /wp-admin/post-new.php1,582 ▲6018.47 ▼4.70635.16 ▼40.8769.73 ▲14.24
Media Library /wp-admin/upload.php1,444 ▲564.23 ▲0.0695.01 ▲1.9373.68 ▲31.47
Stock Manager /wp-admin/admin.php?page=stock-manager-woocommerce9102.0625.6240.18

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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 fix the following items
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/products-stock-manager-with-excel/Classes/markbaker/complex/examples/testFunctions.php
    • > /wp-content/plugins/products-stock-manager-with-excel/Classes/markbaker/matrix/examples/test.php
    • > /wp-content/plugins/products-stock-manager-with-excel/Classes/markbaker/complex/examples/complexTest.php
    • > /wp-content/plugins/products-stock-manager-with-excel/Classes/markbaker/matrix/buildPhar.php
    • > /wp-content/plugins/products-stock-manager-with-excel/Classes/markbaker/complex/examples/testOperations.php
  • 97× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Writer\\Ods\\WriterPart' not found in wp-content/plugins/products-stock-manager-with-excel/Classes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Reader\\Xlsx\\BaseParserClass' not found in wp-content/plugins/products-stock-manager-with-excel/Classes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/SheetViewOptions.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Matrix\\Operators\\Operator' not found in wp-content/plugins/products-stock-manager-with-excel/Classes/markbaker/matrix/classes/src/Operators/Subtraction.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Reader\\BaseReader' not found in wp-content/plugins/products-stock-manager-with-excel/Classes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Writer\\BaseWriter' not found in wp-content/plugins/products-stock-manager-with-excel/Classes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Html.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Shared\\Trend\\BestFit' not found in wp-content/plugins/products-stock-manager-with-excel/Classes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Style\\Supervisor' not found in wp-content/plugins/products-stock-manager-with-excel/Classes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'PhpOffice\\PhpSpreadsheet\\IComparable' not found in wp-content/plugins/products-stock-manager-with-excel/Classes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/BaseDrawing.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Reader\\BaseReader' not found in wp-content/plugins/products-stock-manager-with-excel/Classes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\WriterPart' not found in wp-content/plugins/products-stock-manager-with-excel/Classes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Style.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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
8 plugin tags: update stock, woocommerce, excel, inventory, stock manager...

products-stock-manager-with-excel/products-stock-manager-excel.php 77% from 13 tests

The primary PHP file in "Products Stock Manager with Excel for WooCommerce Inventory" version 1.8 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.1" instead of "2.2")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("products-stock-manager-with-excel.php" instead of "products-stock-manager-excel.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin64,505 lines of code in 342 files:
LanguageFilesBlank linesComment linesLines of code
PHP31413,28231,44860,445
Markdown942302,002
SVG100685
JSON600684
CSS25915321
JavaScript44915216
YAML314182
Bourne Again Shell16324
PO File13523
XML10023

PHP code 0% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 1,011)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 387)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity42.97
▷ Minimum class complexity1.00
▷ Maximum class complexity1,011.00
Average method complexity4.39
▷ Minimum method complexity1.00
▷ Maximum method complexity387.00
Code structure
Namespaces45
Interfaces10
Traits0
Classes232
▷ Abstract classes166.90%
▷ Concrete classes21693.10%
▷ Final classes00.00%
Methods3,023
▷ Static methods69022.83%
▷ Public methods2,33077.08%
▷ Protected methods852.81%
▷ Private methods60820.11%
Functions76
▷ Named functions6281.58%
▷ Anonymous functions1418.42%
Constants779
▷ Global constants20.26%
▷ Class constants77799.74%
▷ Public constants777100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/extendwp.png5.75KB3.37KB▼ 41.46%
images/default.png14.13KB5.96KB▼ 57.80%
images/stock-manager-woocommerce-pro.png27.63KB11.89KB▼ 56.97%