83% cart-notices-for-woocommerce

Code Review | Cart Notices for WooCommerce

WordPress plugin Cart Notices for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: cart-notices-for-...
  • Plugin version:
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 15, 2016
  • Latest release: Sep 21, 2023
  • Number of updates: 80
  • Update frequency: every 32.5 days
  • Top authors: RazyRx (62.5%)dholovnia (38.75%)

Code review

54 tests

User reviews

36 reviews

Install metrics

3,000+ active /66,459 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲1.50MB] [CPU: ▲15.10ms] Passed 4 tests

This is a short check of server-side resources used by Cart Notices for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.95 ▲1.4956.10 ▲8.86
Dashboard /wp-admin4.85 ▲1.5574.06 ▲23.60
Posts /wp-admin/edit.php4.90 ▲1.5472.61 ▲15.63
Add New Post /wp-admin/post-new.php7.37 ▲1.48118.32 ▲12.68
Media Library /wp-admin/upload.php4.71 ▲1.4860.27 ▲23.21

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 102 new files
Database: no new tables, 8 new options
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cart Notices for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲2014.25 ▼0.101.77 ▼0.1341.17 ▼6.12
Dashboard /wp-admin2,197 ▲175.57 ▼0.1094.29 ▼0.5082.51 ▲39.91
Posts /wp-admin/edit.php2,126 ▲262.00 ▼0.1337.35 ▼1.3132.63 ▼1.80
Add New Post /wp-admin/post-new.php1,556 ▲3023.31 ▲0.21719.32 ▲28.4556.94 ▼6.67
Media Library /wp-admin/upload.php1,420 ▲204.07 ▼0.1897.80 ▼13.7676.89 ▲29.86

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-posts
    • berocket_key_activated_plugins
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • berocket_admin_notices_rate_stars
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 items
  • 28× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cart-notices-for-woocommerce/berocket/sale/sale.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cart-notices-for-woocommerce/berocket/libraries/wpml_compatibility.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'BeRocket_plugin_variations' not found in wp-content/plugins/cart-notices-for-woocommerce/includes/paid.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ET_Builder_Module' not found in wp-content/plugins/cart-notices-for-woocommerce/divi/includes/modules/cartNotice/cartNotice.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'BeRocket_plugin_variations' not found in wp-content/plugins/cart-notices-for-woocommerce/includes/tripwire.php:2
    • > PHP Notice
      Undefined variable: framework_version in wp-content/plugins/cart-notices-for-woocommerce/berocket/framework_version.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cart-notices-for-woocommerce/berocket/libraries/popup.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cart-notices-for-woocommerce/berocket/libraries/tutorial.php:10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/cart-notices-for-woocommerce/berocket/templates/settings_footer.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cart-notices-for-woocommerce/berocket/includes/updater.php:5

User-side errors Passed 1 test

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


Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (24 tag instead of maximum 10)
  • Screenshots: These screenshots do not have images: #1 (General settings), #2 (Notices list), #3 (Notice creation)
Please take inspiration from this readme.txt

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

The entry point to "Cart Notices for WooCommerce" version is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist
  • Main file name: The principal plugin file should be the same as the plugin slug ("cart-notices-for-woocommerce.php" instead of "woocommerce-cart-notices.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected21,592 lines of code in 73 files:
LanguageFilesBlank linesComment linesLines of code
PO File2194216430

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity45.31
▷ Minimum class complexity1.00
▷ Maximum class complexity240.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes00.00%
▷ Static methods15137.56%
▷ Public methods402100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions32100.00%
▷ Anonymous functions00.00%
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
9 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/ad_white_on_orange.png20.67KB15.57KB▼ 24.67%
berocket/assets/css/mail.png2.59KB1.92KB▼ 26.02%
berocket/includes/ico.png1.90KB1.41KB▼ 25.89%
berocket/assets/images/submenu-icon.png0.62KB0.50KB▼ 20.13%
berocket/libraries/templates/default.png3.87KB2.63KB▼ 31.94%