83% woo-related-products-refresh-on-reload

Code Review | Related Products for WooCommerce

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

About plugin

  • Plugin page: woo-related-produ...
  • Plugin version: 3.3.15
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1
  • WordPress version: 6.3.1
  • First release: Sep 15, 2015
  • Latest release: Feb 8, 2023
  • Number of updates: 79
  • Update frequency: every 34.9 days
  • Top authors: eboxnet (84.81%)peachpay (16.46%)

Code review

54 tests

User reviews

46 reviews

Install metrics

7,000+ active /160,383 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.39ms] Passed 4 tests

Analyzing server-side resources used by Related Products for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.67 ▼1.60
Dashboard /wp-admin3.32 ▼0.0248.17 ▼12.39
Posts /wp-admin/edit.php3.38 ▲0.0246.40 ▼1.48
Add New Post /wp-admin/post-new.php5.92 ▲0.0489.34 ▼2.07
Media Library /wp-admin/upload.php3.25 ▲0.0233.47 ▲1.54
Woo Related Products /wp-admin/admin.php?page=woo-related-options3.2129.42

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Related Products for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.19 ▼1.091.78 ▲0.1750.65 ▲12.20
Dashboard /wp-admin2,223 ▲355.84 ▲0.9998.14 ▼3.7083.47 ▲40.68
Posts /wp-admin/edit.php2,112 ▲232.13 ▲0.1334.18 ▼6.9834.08 ▼5.47
Add New Post /wp-admin/post-new.php1,616 ▲9722.68 ▼0.51651.52 ▲48.8740.66 ▼11.78
Media Library /wp-admin/upload.php1,405 ▲174.22 ▼0.04101.02 ▲1.4747.88 ▲2.90
Woo Related Products /wp-admin/admin.php?page=woo-related-options9862.1825.4024.98

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/woo-related-products-refresh-on-reload/public/partials/woo-related-products-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === woo-related-products-refresh-on-reload === )
You can take inspiration from this readme.txt

woo-related-products-refresh-on-reload/woo-related-products.php 77% from 13 tests

This is the main PHP file of "Related Products for WooCommerce" version 3.3.15, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-related-products-refresh-on-reload.php" instead of "woo-related-products.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin2,469 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4214481,358
PHP12156588693
CSS51836293
PO File555125

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.26
Average class complexity1.57
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.14
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.32MB with 0.09MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/one-click-checkout.png330.97KB137.58KB▼ 58.43%
public/owl-carousel/grabbing.png0.11KB0.14KB0.00%