83% cart-limiter

Code Review | Cart Limiter For WooCommerce, Min - Max Quantity Limits

WordPress plugin Cart Limiter For WooCommerce, Min - Max Quantity Limits scored83%from 54 tests.

About plugin

  • Plugin page: cart-limiter
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 31, 2022
  • Latest release: Sep 12, 2023
  • Number of updates: 7
  • Update frequency: every 36.7 days
  • Top authors: grandplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /244 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: ▲0.00MB] [CPU: ▼2.53ms] Passed 4 tests

Analyzing server-side resources used by Cart Limiter For WooCommerce, Min - Max Quantity Limits
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.80 ▼7.40
Dashboard /wp-admin3.31 ▲0.0045.68 ▼1.20
Posts /wp-admin/edit.php3.36 ▲0.0045.76 ▼1.79
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.42 ▲3.59
Media Library /wp-admin/upload.php3.23 ▲0.0034.09 ▲0.28

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 58 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Cart Limiter For WooCommerce, Min - Max Quantity Limits
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.26 ▼1.491.57 ▼0.7338.17 ▼11.44
Dashboard /wp-admin2,209 ▲215.85 ▲0.9499.29 ▼16.8039.88 ▼3.04
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0234.27 ▼5.5134.07 ▼0.59
Add New Post /wp-admin/post-new.php1,542 ▲918.46 ▼4.77606.61 ▼66.1659.16 ▲2.88
Media Library /wp-admin/upload.php1,382 ▼34.25 ▲0.0599.19 ▼4.9741.59 ▼1.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Parse error
      syntax error, unexpected '=>' (T_DOUBLE_ARROW) in wp-content/plugins/cart-limiter/includes/utils/LimiterUtils.php on line 77
    • > PHP Fatal error
      Uncaught Error: Class 'GPLSCore\\GPLS_PLUGIN_WWCLR\\Base' not found in wp-content/plugins/cart-limiter/includes/settings/settingsFields/FieldBase.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3 in cart-limiter/assets to your readme.txt
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
The official readme.txt might help

cart-limiter/gpls-wwclr-woo-cart-limiter.php 92% from 13 tests

This is the main PHP file of "Cart Limiter For WooCommerce, Min - Max Quantity Limits" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cart-limiter.php" instead of "gpls-wwclr-woo-cart-limiter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin4,025 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP406752,0514,016
CSS5055
JavaScript4064

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity19.34
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity3.06
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces9
Interfaces1
Traits5
Classes23
▷ Abstract classes313.04%
▷ Concrete classes2086.96%
▷ Final classes00.00%
Methods264
▷ Static methods4215.91%
▷ Public methods16763.26%
▷ Protected methods3111.74%
▷ Private methods6625.00%
Functions6
▷ Named functions350.00%
▷ Anonymous functions350.00%
Constants2
▷ Global constants2100.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
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/assets/dist/images/logo-icon-lg.png3.56KB2.72KB▼ 23.62%
core/assets/dist/images/logo-icon-md.png0.91KB0.96KB0.00%
core/assets/dist/images/logo-icon-sm.png0.62KB0.72KB0.00%
core/assets/dist/images/full-logo.png6.58KB3.86KB▼ 41.28%