94% gravity-forms-quantity-limits

Code Review | Gravity Forms Quantity Limiter

WordPress plugin Gravity Forms Quantity Limiter scored 94% from 54 tests.

About plugin

  • Plugin page: gravity-forms-qua...
  • Plugin version: 0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.9
  • WordPress version: 5.9.2
  • First release: Mar 17, 2013
  • Latest release: Apr 22, 2014
  • Number of updates: 23
  • Update frequency: every 17.5 days
  • Top authors: benhays (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

500+ active / 4,997 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼300.62ms] Passed 4 tests

Analyzing server-side resources used by Gravity Forms Quantity Limiter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2057.13 ▼3.40
Dashboard /wp-admin3.54 ▲0.1335.30 ▼1.06
Posts /wp-admin/edit.php3.77 ▲0.1341.93 ▼2.08
Add New Post /wp-admin/post-new.php7.01 ▲0.0495.37 ▼1,195.94
Media Library /wp-admin/upload.php3.42 ▲0.1329.95 ▲4.66

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gravity Forms Quantity Limiter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,749 ▲415.62 ▲0.415.83 ▼0.242.40 ▲0.15
Dashboard /wp-admin2,878 ▲176.02 ▼0.16125.87 ▼26.71159.51 ▼23.38
Posts /wp-admin/edit.php2,691 ▼33.24 ▲0.0086.89 ▲22.30142.86 ▲0.72
Add New Post /wp-admin/post-new.php1,690 ▼2120.70 ▲0.05452.12 ▼4.73166.77 ▼29.47
Media Library /wp-admin/upload.php1,698 ▼05.48 ▼0.03147.06 ▼5.08194.43 ▼40.07

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gravity-forms-quantity-limits/gravity-forms-limiter.php:45
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gravity-forms-quantity-limits/gravity-forms-limiter.php on line 43

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
You can take inspiration from this readme.txt

gravity-forms-quantity-limits/gravity-forms-limiter.php 92% from 13 tests

The primary PHP file in "Gravity Forms Quantity Limiter" version 0.8 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("gravity-forms-quantity-limits.php" instead of "gravity-forms-limiter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,052 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP3261881,009
Markdown122043

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity33.33
▷ Minimum class complexity11.00
▷ Maximum class complexity76.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods45
▷ Static methods3986.67%
▷ Public methods3475.56%
▷ Protected methods00.00%
▷ Private methods1124.44%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/active0.png0.65KB0.61KB▼ 5.56%
images/active1.png0.71KB0.63KB▼ 11.28%