84% related-product-for-woo

Code Review | Related Products For WooCommerce

WordPress plugin Related Products For WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: related-product-f...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.2.4
  • WordPress version: 6.3.1
  • First release: Aug 31, 2019
  • Latest release: Nov 8, 2019
  • Number of updates: 13
  • Update frequency: every 5.4 days
  • Top authors: BharatKambariya (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /500 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼2.74ms] Passed 4 tests

An overview of server-side resources used by Related Products For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1036.47 ▼0.17
Dashboard /wp-admin3.40 ▲0.1047.19 ▼1.72
Posts /wp-admin/edit.php3.51 ▲0.1648.36 ▲2.31
Add New Post /wp-admin/post-new.php6.00 ▲0.1183.42 ▼9.79
Media Library /wp-admin/upload.php3.32 ▲0.0933.90 ▲0.71
Welcome To WooCommerce Related products /wp-admin/index.php?page=spfw-about3.2932.17

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Related Products For WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,905 ▲14413.71 ▼0.647.74 ▲6.2340.43 ▼3.53
Dashboard /wp-admin2,197 ▲205.54 ▼0.0484.04 ▼4.1438.03 ▼1.49
Posts /wp-admin/edit.php2,108 ▲82.03 ▲0.0633.48 ▼2.7331.68 ▼2.81
Add New Post /wp-admin/post-new.php1,533 ▲723.25 ▲0.15672.37 ▼12.0758.80 ▲7.36
Media Library /wp-admin/upload.php1,408 ▲54.21 ▲0.0194.34 ▼5.3141.00 ▼1.74
Welcome To WooCommerce Related products /wp-admin/index.php?page=spfw-about8031.9930.8537.78

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • spfw_version
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/related-product-for-woo/admin/partials/similar-product-for-woo-admin-display.php
    • > /wp-content/plugins/related-product-for-woo/public/partials/similar-product-for-woo-public-display.php

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 issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Please fix this invalid url: ""
The official readme.txt is a good inspiration

related-product-for-woo/similar-product-for-woo.php 92% from 13 tests

Analyzing the main PHP file in "Related Products For WooCommerce" version 1.0.0
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("related-product-for-woo.php" instead of "similar-product-for-woo.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin436 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13156569409
CSS20821
JavaScript24546

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.43
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods34
▷ Static methods25.88%
▷ Public methods2985.29%
▷ Protected methods00.00%
▷ Private methods514.71%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin