78% related-products-manager-woocommerce

Code Review | Related Products Manager for WooCommerce

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

About plugin

  • Plugin page: related-products-...
  • Plugin version: 1.5.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3.1
  • WordPress version: 6.3.1
  • First release: Feb 23, 2017
  • Latest release: Sep 5, 2023
  • Number of updates: 43
  • Update frequency: every 55.4 days
  • Top authors: algoritmika (65.12%)prowcplugins (37.21%)

Code review

54 tests

User reviews

17 reviews

Install metrics

1,000+ active /28,687 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
Install script ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼1.19ms] Passed 4 tests

Analyzing server-side resources used by Related Products Manager for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1643.56 ▲5.47
Dashboard /wp-admin3.57 ▲0.2251.69 ▼5.45
Posts /wp-admin/edit.php3.69 ▲0.3351.04 ▲1.03
Add New Post /wp-admin/post-new.php6.17 ▲0.2885.42 ▼5.82
Media Library /wp-admin/upload.php3.50 ▲0.2641.01 ▲8.76

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, 10 new options
New WordPress options
prowc_related_products_manager_plugin_reviewtrack
prowc_related_products_manager_plugin_notice_remindlater
can_compress_scripts
widget_theysaidso_widget
prowc_rpmw_activation_time
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
prowc_related_products_manager_version

Browser metrics Passed 4 tests

Related Products Manager for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲4914.33 ▼0.021.74 ▲0.2344.52 ▲3.04
Dashboard /wp-admin2,205 ▲345.78 ▲0.2489.65 ▲3.4240.08 ▼0.40
Posts /wp-admin/edit.php2,122 ▲222.42 ▲0.4738.20 ▲1.1432.50 ▼4.94
Add New Post /wp-admin/post-new.php1,557 ▲3123.37 ▼0.18662.88 ▼16.1656.55 ▼2.79
Media Library /wp-admin/upload.php1,413 ▲134.39 ▲0.2198.29 ▲3.2241.16 ▼4.06

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 10 options in the database
    • db_upgraded
    • prowc_related_products_manager_version
    • prowc_related_products_manager_plugin_notice_remindlater
    • widget_recent-comments
    • prowc_rpmw_activation_time
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • prowc_related_products_manager_plugin_reviewtrack

Smoke tests 50% 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 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/related-products-manager-woocommerce/widgets/related-product-manager-wpbakery-widget.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Elementor\\add_action() in wp-content/plugins/related-products-manager-woocommerce/widgets/elementor-helper.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
6 plugin tags: woocommerce, manager, related, products, woo commerce...

related-products-manager-woocommerce/related-products-manager-for-woocommerce.php 92% from 13 tests

The entry point to "Related Products Manager for WooCommerce" version 1.5.7 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("related-products-manager-woocommerce.php" instead of "related-products-manager-for-woocommerce.php")

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
No dangerous file extensions were detected3,564 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP102194863,313
CSS233218
JavaScript26233

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity24.38
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity4.12
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes112.50%
Methods60
▷ Static methods11.67%
▷ Public methods5896.67%
▷ Protected methods23.33%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/img/admin-rating-rpmw.png0.82KB0.56KB▼ 31.62%
includes/img/prowc_logo.png38.75KB12.41KB▼ 67.98%