84% max-spend-limit-per-user

Code Review | Max Spend Limit Per User For Woocommerce

WordPress plugin Max Spend Limit Per User For Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: max-spend-limit-p...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: Sep 20, 2023
  • Latest release: Sep 21, 2023
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: cheapwebdesigner (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /89 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Max Spend Limit Per User For Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.28 ▼3.58
Dashboard /wp-admin3.33 ▼0.0142.11 ▼22.13
Posts /wp-admin/edit.php3.38 ▲0.0246.58 ▲0.91
Add New Post /wp-admin/post-new.php5.91 ▲0.0279.49 ▼21.50
Media Library /wp-admin/upload.php3.26 ▲0.0235.99 ▼0.04

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Max Spend Limit Per User For Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.31 ▼0.981.75 ▼0.2147.37 ▲4.85
Dashboard /wp-admin2,206 ▲245.87 ▲0.99106.21 ▼0.3941.08 ▼5.54
Posts /wp-admin/edit.php2,092 ▲32.00 ▼0.0139.00 ▲1.3934.78 ▼4.10
Add New Post /wp-admin/post-new.php1,533 ▲1623.34 ▲5.78645.43 ▲0.7871.36 ▲16.31
Media Library /wp-admin/upload.php1,382 ▼34.20 ▲0.1099.29 ▼10.5640.88 ▼7.48

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
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/max-spend-limit-per-user/max-spend-limit-per-user.php:36

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: woocommerce spend limit, woo spending limits per period, control users spending, woo spending by rolling days

max-spend-limit-per-user/max-spend-limit-per-user.php Passed 13 tests

The principal PHP file in "Max Spend Limit Per User For Woocommerce" v. 1.0.0 is loaded by WordPress automatically on each request
66 characters long description:
Limits user spending on WooCommerce based on maximum spend amount.

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 plugin80 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1142180

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin