78% wt-woocommerce-related-products

Code Review | Related Products for WooCommerce

WordPress plugin Related Products for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: wt-woocommerce-re...
  • Plugin version: 1.5.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 7, 2018
  • Latest release: Nov 16, 2023
  • Number of updates: 69
  • Update frequency: every 28.8 days
  • Top authors: webtoffee (95.65%)markhf (5.8%)

Code review

54 tests

User reviews

62 reviews

Install metrics

10,000+ active /123,514 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼8.99ms] Passed 4 tests

Server-side resources used by Related Products for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1135.12 ▼7.16
Dashboard /wp-admin3.41 ▲0.0646.14 ▼11.28
Posts /wp-admin/edit.php3.52 ▲0.1647.79 ▼9.86
Add New Post /wp-admin/post-new.php5.99 ▲0.1093.38 ▼7.66
Media Library /wp-admin/upload.php3.33 ▲0.1038.18 ▲7.18

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 80 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
crp_version
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Related Products for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3614.24 ▼0.041.92 ▲0.1436.26 ▼8.35
Dashboard /wp-admin2,206 ▲325.56 ▼0.0992.61 ▼1.9744.12 ▲1.47
Posts /wp-admin/edit.php2,108 ▲51.98 ▼0.1140.26 ▼3.4937.73 ▲1.06
Add New Post /wp-admin/post-new.php1,534 ▲823.12 ▼0.39612.44 ▼12.0558.14 ▼2.09
Media Library /wp-admin/upload.php1,408 ▲114.20 ▲0.05100.98 ▼1.7543.53 ▲0.17

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • can_compress_scripts
    • crp_version
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wt-woocommerce-related-products/admin/partials/admin-settings-other-solutions.php
  • 5× 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/wt-woocommerce-related-products/includes/class-wt-relatedproducts-uninstall-feedback.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_product() in wp-content/plugins/wt-woocommerce-related-products/public/partials/wt-custom-related.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/wt-woocommerce-related-products/admin/partials/custom-related-products-admin-display.php:17
    • > PHP Warning
      Use of undefined constant CRP_PLUGIN_URL - assumed 'CRP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wt-woocommerce-related-products/admin/partials/custom-related-products-admin-display.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wt-woocommerce-related-products/admin/partials/custom-related-products-admin-tab-view.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: linked products, related products for woocommerce, custom related products, product tags, related products...

wt-woocommerce-related-products/custom-related-products.php 92% from 13 tests

The main PHP file in "Related Products for WooCommerce" ver. 1.5.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wt-woocommerce-related-products.php" instead of "custom-related-products.php")

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
Everything looks great! No dangerous files found in this plugin12,529 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript67751,4806,412
PHP238248063,905
PO File56058111,707
SVG1700313
CSS51625187
XML1005

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.44
Average class complexity25.58
▷ Minimum class complexity1.00
▷ Maximum class complexity106.00
Average method complexity3.63
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods112
▷ Static methods98.04%
▷ Public methods10190.18%
▷ Protected methods00.00%
▷ Private methods119.82%
Functions14
▷ Named functions1392.86%
▷ Anonymous functions17.14%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.56MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/other_solutions/best-seller.png294.86KB77.67KB▼ 73.66%
admin/img/other_solutions/frequently-bought-together.png115.75KB43.56KB▼ 62.36%
public/images/controls.png1.17KB1.42KB0.00%
admin/img/other_solutions/product-recommendations.png151.32KB45.97KB▼ 69.62%
admin/img/wt_logo.png2.02KB1.08KB▼ 46.55%