78% gravityforms-html5-placeholders

Code Review | Gravity Forms HTML5 Placeholders

WordPress plugin Gravity Forms HTML5 Placeholders scored78%from 54 tests.

About plugin

  • Plugin page: gravityforms-html...
  • Plugin version: 2.8.1
  • 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 6, 2016
  • Number of updates: 37
  • Update frequency: every 15.8 days
  • Top authors: isoftware (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

700+ active /24,022 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.21MB] [CPU: ▼2.21ms] Passed 4 tests

This is a short check of server-side resources used by Gravity Forms HTML5 Placeholders
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2141.66 ▼6.47
Dashboard /wp-admin3.51 ▲0.2145.93 ▼3.29
Posts /wp-admin/edit.php3.63 ▲0.2749.85 ▲2.47
Add New Post /wp-admin/post-new.php6.10 ▲0.2186.92 ▲0.39
Media Library /wp-admin/upload.php3.44 ▲0.2036.08 ▲0.52

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Gravity Forms HTML5 Placeholders
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.67 ▼0.761.77 ▼0.4043.35 ▼0.00
Dashboard /wp-admin2,206 ▲184.85 ▼0.20105.30 ▼12.9339.83 ▼8.24
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0638.88 ▼1.1931.68 ▼3.43
Add New Post /wp-admin/post-new.php1,534 ▲123.54 ▲0.13662.86 ▲10.5359.08 ▲3.88
Media Library /wp-admin/upload.php1,382 ▼64.22 ▼0.0096.49 ▼1.6842.83 ▼0.69

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 detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/gravityforms-html5-placeholders/templates/gf-message.tmpl.php
  • 18× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to get property 'type' of non-object in wp-content/plugins/gravityforms-html5-placeholders/templates/gf-message.tmpl.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_js() in wp-content/plugins/gravityforms-html5-placeholders/templates/gf-address-label-setting.tmpl.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/gravityforms-html5-placeholders/templates/gf-email-label-setting.tmpl.php:3
    • > PHP Notice
      Trying to get property 'text' of non-object in wp-content/plugins/gravityforms-html5-placeholders/templates/gf-message.tmpl.php on line 2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/gravityforms-html5-placeholders/templates/gf-address-placeholder-setting.tmpl.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gravityforms-html5-placeholders/gravityforms-html5-placeholders.php:36
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/gravityforms-html5-placeholders/templates/gf-generic-placeholder-setting.tmpl.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/gravityforms-html5-placeholders/templates/gf-product-placeholder-setting.tmpl.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/gravityforms-html5-placeholders/templates/gf-time-placeholder-setting.tmpl.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/gravityforms-html5-placeholders/templates/gf-name-label-setting.tmpl.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% 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:
  • Plugin Name: You should set the name of your plugin on the first line ( === gravityforms-html5-placeholders === )
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Editing a Simple Name Field), #2 (Editing an Extended Name Field), #3 (Editing an Email Field with confirmation), #4 (Editing an International Address Field)
The official readme.txt is a good inspiration

gravityforms-html5-placeholders/gravityforms-html5-placeholders.php Passed 13 tests

"Gravity Forms HTML5 Placeholders" version 2.8.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
122 characters long description:
Adds native HTML5 placeholder support to Gravity Forms' fields with javascript fallback. Javascript & jQuery are required.

Code Analysis 97% from 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
Success! There were no dangerous files found in this plugin3,279 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP151871861,566
JavaScript42682021,392
CSS4471321

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 328)
Cyclomatic complexity
Average complexity per logical line of code1.03
Average class complexity387.00
▷ Minimum class complexity387.00
▷ Maximum class complexity387.00
Average method complexity17.08
▷ Minimum method complexity1.00
▷ Maximum method complexity328.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods1562.50%
▷ Protected methods520.83%
▷ Private methods416.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
4 PNG files occupy 0.21MB with 0.13MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png54.07KB21.65KB▼ 59.96%
screenshot-1.png49.02KB18.92KB▼ 61.40%
screenshot-2.png57.26KB22.74KB▼ 60.28%
screenshot-4.png52.57KB21.08KB▼ 59.90%