77% cart-products-suggestions-for-woocommerce

Code Review | Products Suggestions for WooCommerce

WordPress plugin Products Suggestions for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: cart-products-sug...
  • Plugin version: 3.5.7.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 6, 2016
  • Latest release: Sep 21, 2023
  • Number of updates: 62
  • Update frequency: every 43.8 days
  • Top authors: RazyRx (53.23%)dholovnia (48.39%)

Code review

54 tests

User reviews

10 reviews

Install metrics

1,000+ active /28,071 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.42MB] [CPU: ▲7.05ms] Passed 4 tests

An overview of server-side resources used by Products Suggestions for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.88 ▲1.4248.74 ▲4.80
Dashboard /wp-admin4.74 ▲1.4360.12 ▲8.99
Posts /wp-admin/edit.php4.83 ▲1.4768.84 ▲19.69
Add New Post /wp-admin/post-new.php7.29 ▲1.41101.52 ▼3.99
Media Library /wp-admin/upload.php4.64 ▲1.4153.07 ▲18.40

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 96 new files
Database: no new tables, 8 new options
New WordPress options
berocket_admin_notices_rate_stars
widget_recent-posts
db_upgraded
widget_recent-comments
br-cart_suggestion-options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Products Suggestions for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7114.45 ▲0.071.59 ▼0.6139.27 ▼3.97
Dashboard /wp-admin2,226 ▲385.84 ▲0.93108.43 ▼10.1780.56 ▲37.10
Posts /wp-admin/edit.php2,110 ▲211.97 ▼0.0337.40 ▼1.4634.02 ▲0.58
Add New Post /wp-admin/post-new.php1,530 ▼317.63 ▼5.62749.62 ▲59.4653.49 ▲5.26
Media Library /wp-admin/upload.php1,396 ▲84.27 ▲0.0497.65 ▼10.1359.69 ▲15.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • berocket_key_activated_plugins
    • theysaidso_admin_options
    • berocket_admin_notices_rate_stars
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

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
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
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/cart-products-suggestions-for-woocommerce/templates/settings_footer.php
    • > /wp-content/plugins/cart-products-suggestions-for-woocommerce/templates/settings_head.php
  • 32× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cart-products-suggestions-for-woocommerce/berocket/includes/widget.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cart-products-suggestions-for-woocommerce/berocket/framework.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'BeRocket_cart_suggestion' not found in wp-content/plugins/cart-products-suggestions-for-woocommerce/templates/widget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'BeRocket_plugin_variations' not found in wp-content/plugins/cart-products-suggestions-for-woocommerce/includes/paid.php:2
    • > PHP Notice
      Undefined variable: plugin_info in wp-content/plugins/cart-products-suggestions-for-woocommerce/templates/settings_head.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cart-products-suggestions-for-woocommerce/berocket/libraries/tutorial.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cart-products-suggestions-for-woocommerce/berocket/includes/updater.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cart-products-suggestions-for-woocommerce/berocket/libraries/wpml_compatibility.php:2
    • > PHP Notice
      Undefined variable: dplugin_link in wp-content/plugins/cart-products-suggestions-for-woocommerce/templates/settings_footer.php on line 29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/cart-products-suggestions-for-woocommerce/berocket/includes/settings_fields.php:5

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 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: Screenshot #1 (General settings) image required
  • Tags: Please delete some tags, you are using 23 tag instead of maximum 10
The official readme.txt is a good inspiration

cart-products-suggestions-for-woocommerce/woocommerce-cart-suggestions.php 85% from 13 tests

Analyzing the main PHP file in "Products Suggestions for WooCommerce" version 3.5.7.8
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("cart-products-suggestions-for-woocommerce.php" instead of "woocommerce-cart-suggestions.php")
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist

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 plugin20,622 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
CSS152,512769,476
PHP414371,5658,973
JavaScript743581,699
PO File2194216430
XML20044

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity47.67
▷ Minimum class complexity1.00
▷ Maximum class complexity240.00
Average method complexity4.66
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes30
▷ Abstract classes00.00%
▷ Concrete classes30100.00%
▷ Final classes00.00%
Methods382
▷ Static methods15039.27%
▷ Public methods382100.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

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/submenu-icon-a.png0.54KB0.48KB▼ 10.20%
berocket/assets/css/mail.png2.59KB1.92KB▼ 26.02%
berocket/assets/images/submenu-icon-a.png0.54KB0.48KB▼ 10.20%
berocket/libraries/templates/default.png3.87KB2.63KB▼ 31.94%
berocket/assets/images/submenu-icon.png0.62KB0.50KB▼ 20.13%