83% quantity-field-for-gravity-form

Code Review | Quantity Field for Gravity Form

WordPress plugin Quantity Field for Gravity Form scored 83% from 54 tests.

About plugin

  • Plugin page: quantity-field-fo...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.2
  • WordPress version: 6.3.1
  • First release: Nov 30, 2021
  • Latest release: Nov 30, 2021
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: dopetheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active / 487 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
Install script ran successfully

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

A check of server-side resources used by Quantity Field for Gravity Form
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.20 ▼7.50
Dashboard /wp-admin3.31 ▲0.0042.88 ▼2.04
Posts /wp-admin/edit.php3.36 ▲0.0043.01 ▼12.54
Add New Post /wp-admin/post-new.php5.89 ▲0.0078.82 ▼10.84
Media Library /wp-admin/upload.php3.23 ▲0.0053.19 ▲22.60

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Quantity Field for Gravity Form
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.36 ▼0.941.83 ▼0.0340.26 ▼8.22
Dashboard /wp-admin2,209 ▲245.86 ▲0.98114.88 ▼0.7143.39 ▼0.36
Posts /wp-admin/edit.php2,089 ▼32.00 ▼0.0539.16 ▲1.9736.52 ▲3.61
Add New Post /wp-admin/post-new.php1,397 ▼11717.94 ▼5.52695.62 ▲99.6158.36 ▲1.18
Media Library /wp-admin/upload.php1,385 ▼34.21 ▲0.03136.05 ▲37.8775.82 ▲29.04

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/quantity-field-for-gravity-form/class-qfg_fieldaddon.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/quantity-field-for-gravity-form/qfg_fieldaddon.php:16

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 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes: The official readme.txt might help

quantity-field-for-gravity-form/qfg_fieldaddon.php 77% from 13 tests

The entry point to "Quantity Field for Gravity Form" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("quantity-field-for-gravity-form.php" instead of "qfg_fieldaddon.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
Good job! No executable or dangerous file extensions detected217 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP34697165
CSS16237
JavaScript14615

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.00
▷ Minimum class complexity2.00
▷ Maximum class complexity8.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods15
▷ Static methods213.33%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin