84% woocommerce-product-dependencies

Code Review | WooCommerce Product Dependencies

WordPress plugin WooCommerce Product Dependencies scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-produ...
  • Plugin version: 1.2.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.3
  • WordPress version: 6.3.1
  • First release: Jan 13, 2014
  • Latest release: Aug 16, 2023
  • Number of updates: 30
  • Update frequency: every 116.7 days
  • Top authors: franticpsyx (83.33%)jasonkytros (16.67%)SomewhereWarm (6.67%)

Code review

54 tests

User reviews

16 reviews

Install metrics

4,000+ active /44,638 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼3.04ms] Passed 4 tests

Server-side resources used by WooCommerce Product Dependencies
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1440.70 ▲2.45
Dashboard /wp-admin3.44 ▲0.1465.98 ▲18.56
Posts /wp-admin/edit.php3.56 ▲0.2046.15 ▼4.09
Add New Post /wp-admin/post-new.php6.02 ▲0.1480.20 ▼10.13
Media Library /wp-admin/upload.php3.36 ▲0.1432.79 ▼0.38

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
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

This is an overview of browser requirements for WooCommerce Product Dependencies
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.13 ▼1.551.70 ▲0.0145.54 ▲3.03
Dashboard /wp-admin2,206 ▲215.95 ▲0.07111.39 ▲10.8942.52 ▼1.69
Posts /wp-admin/edit.php2,092 ▲32.02 ▲0.0034.54 ▼4.2132.52 ▼4.24
Add New Post /wp-admin/post-new.php1,513 ▼2017.78 ▼5.40661.75 ▼16.9554.24 ▼11.63
Media Library /wp-admin/upload.php1,385 ▼64.19 ▼0.0399.56 ▼1.4542.89 ▼1.37

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-product-dependencies/woocommerce-product-dependencies.php:99

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
10 plugin tags: prerequisite, products, together, woocommerce, purchase...

woocommerce-product-dependencies/woocommerce-product-dependencies.php Passed 13 tests

Analyzing the main PHP file in "WooCommerce Product Dependencies" version 1.2.8
112 characters long description:
Restrict access to WooCommerce products, depending on the ownership and/or purchase of other, required products.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin758 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP3295380739
JavaScript26019

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity55.67
▷ Minimum class complexity17.00
▷ Maximum class complexity123.00
Average method complexity4.73
▷ Minimum method complexity1.00
▷ Maximum method complexity55.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods44
▷ Static methods1943.18%
▷ Public methods4090.91%
▷ Protected methods00.00%
▷ Private methods49.09%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin