84% simple-related-products-for-woocommerce

Code Review | Simple Related Products for WooCommerce

WordPress plugin Simple Related Products for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: simple-related-pr...
  • Plugin version: 1.5.1
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 3, 2019
  • Latest release: Nov 10, 2023
  • Number of updates: 7
  • Update frequency: every 209.7 days
  • Top authors: imemine (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /544 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.18ms] Passed 4 tests

An overview of server-side resources used by Simple Related Products for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0337.90 ▼0.56
Dashboard /wp-admin3.33 ▼0.0144.16 ▼17.68
Posts /wp-admin/edit.php3.38 ▲0.0344.98 ▼2.06
Add New Post /wp-admin/post-new.php5.91 ▲0.0390.49 ▲4.18
Media Library /wp-admin/upload.php3.25 ▲0.0332.54 ▼0.40

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Simple Related Products for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.37 ▲0.001.57 ▼0.1540.22 ▼2.54
Dashboard /wp-admin2,198 ▲205.60 ▼0.0190.06 ▼27.7938.08 ▼7.42
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0540.27 ▲1.3036.27 ▲2.38
Add New Post /wp-admin/post-new.php1,526 ▼023.47 ▲0.53681.08 ▲18.6850.10 ▼5.71
Media Library /wp-admin/upload.php1,400 ▲34.15 ▼0.0398.35 ▼2.3642.12 ▼3.24

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

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 | 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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-related-products-for-woocommerce/simple-related-products-for-woocommerce.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Contributors: The plugin contributors field is missing
You can look at the official readme.txt

simple-related-products-for-woocommerce/simple-related-products-for-woocommerce.php Passed 13 tests

The primary PHP file in "Simple Related Products for WooCommerce" version 1.5.1 is used by WordPress to initiate all plugin functionality
138 characters long description:
Simple Related Products for WooCommerce allows you to choose custom related products for your WooCommerce products, under Linked Products.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected95 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1181395

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.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
There are no PNG files in this plugin