83% products-compare-for-woocommerce

Code Review | Products Compare for WooCommerce

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

About plugin

  • Plugin page: products-compare-...
  • Plugin version: 3.5.7.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Aug 15, 2016
  • Latest release: Dec 13, 2022
  • Number of updates: 69
  • Update frequency: every 33.6 days
  • Top authors: RazyRx (59.42%)dholovnia (42.03%)

Code review

54 tests

User reviews

17 reviews

Install metrics

1,000+ active /36,477 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: ▲1.50MB] [CPU: ▲10.16ms] Passed 4 tests

A check of server-side resources used by Products Compare for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.97 ▲1.5151.20 ▲4.86
Dashboard /wp-admin4.80 ▲1.5068.54 ▲18.97
Posts /wp-admin/edit.php4.91 ▲1.5663.47 ▲12.23
Add New Post /wp-admin/post-new.php7.38 ▲1.50104.36 ▲4.56
Media Library /wp-admin/upload.php4.73 ▲1.5062.18 ▲22.02

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 114 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
br-compare-products-options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
berocket_admin_notices_rate_stars
widget_recent-posts

Browser metrics Passed 4 tests

Products Compare for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲8914.35 ▼0.051.80 ▲0.3440.63 ▼3.07
Dashboard /wp-admin2,219 ▲395.58 ▲0.0388.81 ▼4.2173.27 ▲31.24
Posts /wp-admin/edit.php2,136 ▲332.01 ▼0.0036.64 ▼5.5734.43 ▼3.87
Add New Post /wp-admin/post-new.php1,714 ▲17722.18 ▲3.96725.22 ▲92.0661.40 ▼5.23
Media Library /wp-admin/upload.php1,430 ▲334.24 ▼0.00104.59 ▲0.8084.08 ▲41.23

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • berocket_admin_notices_rate_stars
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • berocket_key_activated_plugins
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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 take a closer look at the following
  • 33× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/products-compare-for-woocommerce/templates/style_section.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/products-compare-for-woocommerce/berocket/sale/sale.php:4
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/products-compare-for-woocommerce/berocket/templates/widget.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'BeRocket_framework_template_lib' not found in wp-content/plugins/products-compare-for-woocommerce/style_templates/sweet-alert/sweet-alert.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/products-compare-for-woocommerce/berocket/libraries/tutorial.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/products-compare-for-woocommerce/berocket/templates/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/products-compare-for-woocommerce/berocket/framework.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/products-compare-for-woocommerce/berocket/includes/information_notices.php:259
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/products-compare-for-woocommerce/includes/widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/products-compare-for-woocommerce/berocket/includes/admin_notices.php:795

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 22 tag instead of maximum 10
  • Screenshots: These screenshots require images: #1 (General settings), #2 (Style settings), #3 (Text settings)
The official readme.txt might help

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

This is the main PHP file of "Products Compare for WooCommerce" version 3.5.7.8, 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:
  • Main file name: The principal plugin file should be the same as the plugin slug ("products-compare-for-woocommerce.php" instead of "products-compare.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin22,327 lines of code in 80 files:
LanguageFilesBlank linesComment linesLines of code
CSS222,5937610,609
PHP464682,2469,168
JavaScript866942,072
PO File2194216430
XML20048

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity40.03
▷ Minimum class complexity1.00
▷ Maximum class complexity240.00
Average method complexity4.69
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes35
▷ Abstract classes00.00%
▷ Concrete classes35100.00%
▷ Final classes00.00%
Methods370
▷ Static methods13837.30%
▷ Public methods370100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
style_templates/separate-footer/separate-footer.png6.37KB3.48KB▼ 45.36%
style_templates/sweet-alert/sweet-alert.png6.46KB3.34KB▼ 48.31%
style_templates/nice-green/nice-green.png7.53KB3.67KB▼ 51.22%
berocket/libraries/addons/default.png3.87KB2.63KB▼ 31.94%
berocket/libraries/templates/default.png3.87KB2.63KB▼ 31.94%