83% gravityforms-html5-validation

Code Review | Gravity Forms HTML5 Validation

WordPress plugin Gravity Forms HTML5 Validation scored 83% from 54 tests.

About plugin

  • Plugin page: gravityforms-html...
  • Plugin version: 2.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4.2
  • WordPress version: 6.3.1
  • First release: Aug 28, 2014
  • Latest release: Apr 4, 2016
  • Number of updates: 29
  • Update frequency: every 20.1 days
  • Top authors: isoftware (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active / 9,783 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.13MB] [CPU: ▼0.46ms] Passed 4 tests

An overview of server-side resources used by Gravity Forms HTML5 Validation
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1341.83 ▼0.39
Dashboard /wp-admin3.44 ▲0.1348.70 ▼1.13
Posts /wp-admin/edit.php3.55 ▲0.1947.63 ▼0.38
Add New Post /wp-admin/post-new.php6.02 ▲0.1398.20 ▲1.05
Media Library /wp-admin/upload.php3.36 ▲0.1334.27 ▲0.06

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gravity Forms HTML5 Validation
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.20 ▼1.091.69 ▼0.2942.74 ▼1.98
Dashboard /wp-admin2,209 ▲184.88 ▼0.04100.78 ▼6.8039.05 ▲3.15
Posts /wp-admin/edit.php2,092 ▲31.99 ▼0.0336.38 ▼4.3934.22 ▼3.26
Add New Post /wp-admin/post-new.php1,542 ▲2318.81 ▼4.28644.62 ▲20.9448.28 ▼7.83
Media Library /wp-admin/upload.php1,391 ▲64.20 ▲0.0199.06 ▲0.4441.23 ▼2.70

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function DevWorks\\add_action() in wp-content/plugins/gravityforms-html5-validation/gravityforms-html5-validation.php:90

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === gravityforms-html5-validation === )
The official readme.txt is a good inspiration

gravityforms-html5-validation/gravityforms-html5-validation.php 92% from 13 tests

The main PHP script in "Gravity Forms HTML5 Validation" version 2.4.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin782 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP1196265519
JavaScript25417164
PO File1101055
JSON10021
XML10015
YAML1008

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 132)
Cyclomatic complexity
Average complexity per logical line of code0.93
Average class complexity181.00
▷ Minimum class complexity181.00
▷ Maximum class complexity181.00
Average method complexity9.38
▷ Minimum method complexity1.00
▷ Maximum method complexity132.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods1460.87%
▷ Protected methods939.13%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin