84% wc-stock-dependencies

Code Review | Stock Dependencies for WooCommerce

WordPress plugin Stock Dependencies for WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: wc-stock-dependen...
  • Plugin version: 1.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 6.3.1
  • First release: Apr 14, 2020
  • Latest release: Apr 30, 2022
  • Number of updates: 15
  • Update frequency: every 49.7 days
  • Top authors: KevinMcCall (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

200+ active / 1,948 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.06ms] Passed 4 tests

This is a short check of server-side resources used by Stock Dependencies for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.07 ▼5.29
Dashboard /wp-admin3.34 ▲0.0346.11 ▼5.83
Posts /wp-admin/edit.php3.39 ▲0.0349.94 ▲2.68
Add New Post /wp-admin/post-new.php5.92 ▲0.0384.10 ▼6.01
Media Library /wp-admin/upload.php3.26 ▲0.0334.72 ▼3.09

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Stock Dependencies for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.72 ▼0.941.65 ▼0.3142.21 ▼9.26
Dashboard /wp-admin2,206 ▲274.89 ▼0.9495.20 ▼16.7738.36 ▼6.63
Posts /wp-admin/edit.php2,086 ▼32.01 ▼0.0339.22 ▲1.6533.95 ▼0.56
Add New Post /wp-admin/post-new.php1,534 ▲123.65 ▲0.19670.16 ▼25.4952.32 ▼3.46
Media Library /wp-admin/upload.php1,382 ▼94.23 ▲0.02104.45 ▲2.6445.64 ▲1.75

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% 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 50% 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function StockDependenciesForWooCommerce\\add_action() in wp-content/plugins/wc-stock-dependencies/wc-stock-dependencies.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: woocommerce, product, stock, dependencies, variation...

wc-stock-dependencies/wc-stock-dependencies.php 85% from 13 tests

The main PHP script in "Stock Dependencies for WooCommerce" version 1.5 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 163 characters long)
  • Requires at least: Required version must match the one declared in readme.txt ("5.0" instead of "4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,263 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript159270724
PHP268316493
CSS110046

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity88.00
▷ Minimum class complexity88.00
▷ Maximum class complexity88.00
Average method complexity4.48
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin