84% datetime-fields-for-gravityforms

Code Review | Date/Time Fields for Gravity Forms

WordPress plugin Date/Time Fields for Gravity Forms scored84%from 54 tests.

About plugin

  • Plugin page: datetime-fields-f...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.2
  • WordPress version: 6.3.1
  • First release: Jan 15, 2018
  • Latest release: Aug 3, 2019
  • Number of updates: 13
  • Update frequency: every 43.5 days
  • Top authors: efetech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /3,480 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Date/Time Fields for Gravity Forms
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.05 ▼1.90
Dashboard /wp-admin3.31 ▲0.0051.99 ▼1.47
Posts /wp-admin/edit.php3.36 ▲0.0053.12 ▼1.61
Add New Post /wp-admin/post-new.php5.89 ▲0.00103.94 ▼9.29
Media Library /wp-admin/upload.php3.23 ▲0.0035.12 ▼2.44

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Date/Time Fields for Gravity Forms
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.71 ▲0.552.20 ▲0.5843.03 ▼0.83
Dashboard /wp-admin2,198 ▲215.61 ▼0.0691.03 ▲1.7737.71 ▼11.74
Posts /wp-admin/edit.php2,097 ▼61.99 ▼0.0238.56 ▼1.0536.18 ▼1.71
Add New Post /wp-admin/post-new.php1,526 ▼223.53 ▲2.32607.73 ▼70.7248.14 ▼16.28
Media Library /wp-admin/upload.php1,400 ▼34.22 ▲0.0099.31 ▼1.3443.40 ▼7.16

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/datetime-fields-for-gravityforms/datetimefield.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/datetime-fields-for-gravityforms/class-gfdatetimefield.php:3

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 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (You can easily find "Date/Time" field in Advanced Fields), #2 (View of the Forms that included in "Date/Time" field.), #3 (View of Form Entries's List), #4 (View of Form Entries's Item), #5 (Date/Time Field)
The official readme.txt is a good inspiration

datetime-fields-for-gravityforms/datetimefield.php 92% from 13 tests

The primary PHP file in "Date/Time Fields for Gravity Forms" version 1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("datetime-fields-for-gravityforms.php" instead of "datetimefield.php")

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
Good job! No executable or dangerous file extensions detected3,071 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript33452942,654
CSS15431254
PHP35390163

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.67
▷ Minimum class complexity2.00
▷ Maximum class complexity10.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods14
▷ Static methods214.29%
▷ Public methods14100.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

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png7.59KB5.15KB▼ 32.16%
screenshot-3.png21.65KB13.51KB▼ 37.61%
screenshot-5.png21.00KB8.46KB▼ 59.73%
screenshot-1.png7.39KB4.00KB▼ 45.91%
screenshot-2.png5.64KB3.62KB▼ 35.84%