83% date-time-picker-for-wpforms

Code Review | Date Time Picker for WPForms

WordPress plugin Date Time Picker for WPForms scored83%from 54 tests.

About plugin

  • Plugin page: date-time-picker-...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.3
  • WordPress version: 6.3.1
  • First release: Oct 3, 2020
  • Latest release: Aug 9, 2023
  • Number of updates: 23
  • Update frequency: every 45.3 days
  • Top authors: ruhul080 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /8,782 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.01MB] [CPU: ▼8.66ms] Passed 4 tests

Server-side resources used by Date Time Picker for WPForms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.0143.23 ▼1.29
Dashboard /wp-admin3.58 ▼0.0651.54 ▼15.28
Posts /wp-admin/edit.php3.69 ▲0.0150.91 ▲1.88
Add New Post /wp-admin/post-new.php6.16 ▲0.0189.57 ▼18.66
Media Library /wp-admin/upload.php3.50 ▲0.0138.04 ▲0.60

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Date Time Picker for WPForms
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲11313.86 ▼0.589.91 ▲8.1041.40 ▲3.11
Dashboard /wp-admin2,195 ▲145.62 ▼0.1091.69 ▼8.5638.62 ▼4.23
Posts /wp-admin/edit.php2,100 ▼02.06 ▲0.0639.69 ▲5.3835.58 ▼4.37
Add New Post /wp-admin/post-new.php1,532 ▲623.27 ▲5.51703.30 ▲13.8154.24 ▼7.48
Media Library /wp-admin/upload.php1,403 ▲94.25 ▲0.0296.33 ▼4.9144.37 ▼2.70

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • 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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/date-time-picker-for-wpforms/wpforms-datetimepicker.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: A description for screenshot #4 is missing in date-time-picker-for-wpforms/assets to your readme.txt
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === date-time-picker-for-wpforms === )
You can look at the official readme.txt

date-time-picker-for-wpforms/wpforms-datetimepicker.php 77% from 13 tests

The main PHP script in "Date Time Picker for WPForms" version 1.1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("date-time-picker-for-wpforms.php" instead of "wpforms-datetimepicker.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 196 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin2,789 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript42792652,745
PHP1101243
CSS1101

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
PNG images were not found in this plugin