84% real-time-validation-for-gravity-forms

Code Review | Real Time Validation for Gravity Forms

WordPress plugin Real Time Validation for Gravity Forms scored84%from 54 tests.

About plugin

  • Plugin page: real-time-validat...
  • Plugin version: 1.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.1-4.9.6
  • WordPress version: 6.3.1
  • First release: Apr 12, 2016
  • Latest release: Oct 2, 2018
  • Number of updates: 65
  • Update frequency: every 14.0 days
  • Top authors: djeet (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

7,000+ active /48,483 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Server-side resources used by Real Time Validation for Gravity Forms
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.91 ▲0.67
Dashboard /wp-admin3.31 ▼0.0444.63 ▼15.04
Posts /wp-admin/edit.php3.36 ▲0.0043.07 ▼1.07
Add New Post /wp-admin/post-new.php5.89 ▲0.0077.60 ▼18.60
Media Library /wp-admin/upload.php3.23 ▲0.0033.93 ▼4.10

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Real Time Validation for Gravity Forms
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.03 ▼0.591.73 ▲0.1743.76 ▲1.53
Dashboard /wp-admin2,198 ▲275.59 ▼0.0186.08 ▼0.3438.18 ▼8.33
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0536.91 ▲2.5232.59 ▼4.68
Add New Post /wp-admin/post-new.php1,526 ▼223.63 ▲0.52681.61 ▲34.7949.93 ▼5.92
Media Library /wp-admin/upload.php1,400 ▲34.17 ▼0.02102.10 ▼6.9644.04 ▼9.11

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • 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
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
Please fix the following
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/real-time-validation-for-gravity-forms/admin/includes/class-lv-pointers.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/real-time-validation-for-gravity-forms/public/includes/default_messages.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/real-time-validation-for-gravity-forms/admin/includes/show-lv-on-form-list.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/real-time-validation-for-gravity-forms/admin/views/gravity-form-date-fields.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/real-time-validation-for-gravity-forms/admin/views/gravity-form-time-fields.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/real-time-validation-for-gravity-forms/public/includes/lv-all-ajax.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/real-time-validation-for-gravity-forms/admin/views/gravity-form-address-fields.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/real-time-validation-for-gravity-forms/admin/views/gravity-form-name-fields.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Gravity_Forms_Live_Validation' not found in wp-content/plugins/real-time-validation-for-gravity-forms/admin/includes/class-lv-dashboard.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: client side validation, gravity forms, gravity forms fields validation, jquery validation, live validation...

real-time-validation-for-gravity-forms/real-time-validation-for-gravity-form.php 85% from 13 tests

The main PHP script in "Real Time Validation for Gravity Forms" version 1.7.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("real-time-validation-for-gravity-forms.php" instead of "real-time-validation-for-gravity-form.php")
  • Description: The description should be shorter than 140 characters (currently 187 characters long)

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
Everything looks great! No dangerous files found in this plugin4,776 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP318723742,100
JavaScript78414091,921
CSS48743755

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity33.17
▷ Minimum class complexity2.00
▷ Maximum class complexity120.00
Average method complexity3.97
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods65
▷ Static methods46.15%
▷ Public methods6295.38%
▷ Protected methods00.00%
▷ Private methods34.62%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/assets/images/warning.png1.32KB0.52KB▼ 60.44%
admin/assets/img/pro-banner.png25.56KB12.17KB▼ 52.41%
public/assets/images/check.png1.50KB0.64KB▼ 57.19%
admin/assets/img/logo_wisetr.png2.37KB1.97KB▼ 16.91%