84% limit-cart-vendors-items

Code Review | Limit Cart Vendor Items

WordPress plugin Limit Cart Vendor Items scored84%from 54 tests.

About plugin

  • Plugin page: limit-cart-vendor...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0.3
  • WordPress version: 6.3.1
  • First release: Jan 26, 2019
  • Latest release: Jan 26, 2019
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: actuaryzask (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /521 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Limit Cart Vendor Items
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.45 ▲2.62
Dashboard /wp-admin3.31 ▲0.0144.06 ▼4.26
Posts /wp-admin/edit.php3.36 ▲0.0045.66 ▼8.51
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.24 ▼7.85
Media Library /wp-admin/upload.php3.24 ▲0.0036.74 ▲2.29

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Limit Cart Vendor Items
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.22 ▼1.161.68 ▼0.1945.52 ▲5.08
Dashboard /wp-admin2,206 ▲184.85 ▼0.08104.48 ▼9.4640.13 ▼0.87
Posts /wp-admin/edit.php2,089 ▼32.05 ▲0.0539.71 ▼2.1235.77 ▼0.54
Add New Post /wp-admin/post-new.php1,528 ▼523.14 ▲0.15671.97 ▲46.9650.44 ▼1.68
Media Library /wp-admin/upload.php1,388 ▼34.22 ▲0.0198.09 ▼10.8044.11 ▲1.19

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

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 everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/limit-cart-vendors-items/options.php:120
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/limit-cart-vendors-items/limit-cart-vendors-items.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: limit items, limit vendors, checkout, order control, limit cart

limit-cart-vendors-items/limit-cart-vendors-items.php Passed 13 tests

"Limit Cart Vendor Items" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
98 characters long description:
This plugin helps you limit the number of vendors/items per order on the cart page/during checkout

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
Success! There were no dangerous files found in this plugin275 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP9136449275

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity2.75
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.48
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2482.76%
▷ Protected methods00.00%
▷ Private methods517.24%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin