89% limit-quantity-for-woocommerce

Code Review | Limit quantity for WooCommerce

WordPress plugin Limit quantity for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: limit-quantity-fo...
  • Plugin version: 1.4.2
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 23, 2017
  • Latest release: Nov 10, 2023
  • Number of updates: 10
  • Update frequency: every 217.9 days
  • Top authors: imemine (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /984 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.48ms] Passed 4 tests

A check of server-side resources used by Limit quantity for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.18 ▼1.92
Dashboard /wp-admin3.32 ▼0.0245.56 ▼13.13
Posts /wp-admin/edit.php3.37 ▲0.0244.62 ▼1.52
Add New Post /wp-admin/post-new.php5.92 ▲0.0491.88 ▼3.87
Media Library /wp-admin/upload.php3.25 ▲0.0231.94 ▼2.98

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Limit quantity for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3014.29 ▼0.081.81 ▲0.1242.69 ▼1.53
Dashboard /wp-admin2,200 ▲195.63 ▼0.0791.97 ▼15.1242.56 ▼4.34
Posts /wp-admin/edit.php2,102 ▲21.96 ▼0.0640.29 ▲1.7037.57 ▲2.24
Add New Post /wp-admin/post-new.php1,528 ▲223.22 ▲0.14615.79 ▲13.0550.33 ▲2.41
Media Library /wp-admin/upload.php1,396 ▼14.27 ▲0.1096.32 ▼3.1843.16 ▼0.10

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Contributors: The plugin contributors field is not present
You can look at the official readme.txt

limit-quantity-for-woocommerce/limit-qty-woocommerce.php 92% from 13 tests

The main file in "Limit quantity for WooCommerce" v. 1.4.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("limit-quantity-for-woocommerce.php" instead of "limit-qty-woocommerce.php")

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 detected74 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1412959
JavaScript15015

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin