10% woo-cart-limit

Code Review | Woocommerce Cart Limit

WordPress plugin Woocommerce Cart Limit scored10%from 54 tests.

About plugin

  • Plugin page: woo-cart-limit
  • Plugin version: 1.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.2.2
  • WordPress version: 6.3.1
  • First release: Jan 25, 2018
  • Latest release: Aug 12, 2019
  • Number of updates: 7
  • Update frequency: every 80.6 days
  • Top authors: oremtech (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active /13,259 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/woo-cart-limit/woocommerce_limit_cart.php+1243
    Non-static method WMAMC_wc_cartLimit::WMAMC_instance() should not be called statically

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.73ms] Passed 4 tests

An overview of server-side resources used by Woocommerce Cart Limit
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.18 ▼5.77
Dashboard /wp-admin3.31 ▲0.0050.98 ▲1.20
Posts /wp-admin/edit.php3.36 ▲0.0048.59 ▲1.61
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.88 ▼11.20
Media Library /wp-admin/upload.php3.23 ▲0.0034.05 ▲0.85

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Woocommerce Cart Limit
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▲0.091.79 ▼0.0144.82 ▼3.88
Dashboard /wp-admin2,209 ▲215.90 ▼0.0196.18 ▼5.6438.94 ▼2.82
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0441.61 ▲5.3334.05 ▼1.02
Add New Post /wp-admin/post-new.php1,534 ▲523.16 ▲4.75674.13 ▲35.5163.40 ▲11.22
Media Library /wp-admin/upload.php1,385 ▼64.17 ▼0.0495.79 ▼1.2541.43 ▼3.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, 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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woo-cart-limit/template/template_cart_limit.php:2

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

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4, #5 in woo-cart-limit/assets to your readme.txt
Please take inspiration from this readme.txt

woo-cart-limit/woocommerce_limit_cart.php 77% from 13 tests

"Woocommerce Cart Limit" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.7" instead of "4.4")
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-cart-limit.php" instead of "woocommerce_limit_cart.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected7,822 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31,8311,5106,818
PHP384039550
CSS31615454

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity40.50
▷ Minimum class complexity10.00
▷ Maximum class complexity71.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods36
▷ Static methods12.78%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin