73% date-time-picker-field

Code Review | Availability datepicker - Integrate with Contact Form 7 and Divi

WordPress plugin Availability datepicker - Integrate with Contact Form 7 and Divi scored73%from 54 tests.

About plugin

  • Plugin page: date-time-picker-...
  • Plugin version: 2.3
  • PHP compatiblity: 5.6.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jun 25, 2018
  • Latest release: Sep 7, 2023
  • Number of updates: 64
  • Update frequency: every 29.7 days
  • Top authors: carlosmoreirapt (73.44%)nirjhar_lo (18.75%)inputwp (10.94%)

Code review

54 tests

User reviews

40 reviews

Install metrics

30,000+ active /224,012 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲5.49MB] [CPU: ▲30.90ms] 75% from 4 tests

A check of server-side resources used by Availability datepicker - Integrate with Contact Form 7 and Divi
It is recommended to improve the following
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.49MB on /wp-admin/admin.php?page=date-time-picker)
PageMemory (MB)CPU Time (ms)
Home /9.19 ▲5.7372.86 ▲33.26
Dashboard /wp-admin9.21 ▲5.9185.44 ▲19.41
Posts /wp-admin/edit.php9.21 ▲5.8581.94 ▲29.18
Add New Post /wp-admin/post-new.php10.36 ▲4.47134.00 ▲41.75
Media Library /wp-admin/upload.php9.21 ▲5.9877.16 ▲43.60
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius9.2165.32
Settings /wp-admin/admin.php?page=dtpicker9.2163.06
Integration /wp-admin/admin.php?page=dtp_integration9.2163.45
Availability datepicker - InputWP /wp-admin/admin.php?page=date-time-picker9.2162.25

Server storage [IO: ▲4.42MB] [DB: ▲0.06MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 227 new files
Database: no new tables, 13 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
dtpicker_advanced
fs_debug_mode
_dtpicker_new_integration
theysaidso_admin_options
can_compress_scripts
db_upgraded
fs_accounts
_dtpicker_lite_imported_integration
...

Browser metrics Passed 4 tests

Availability datepicker - Integrate with Contact Form 7 and Divi: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,885 ▲12414.62 ▲0.271.88 ▼0.1131.88 ▼10.84
Dashboard /wp-admin2,288 ▲1115.83 ▲0.2289.32 ▼0.4845.80 ▲5.84
Posts /wp-admin/edit.php2,199 ▲992.26 ▲0.2638.41 ▼3.0438.33 ▲2.77
Add New Post /wp-admin/post-new.php1,571 ▲4523.42 ▲0.41626.05 ▲8.0237.19 ▼11.82
Media Library /wp-admin/upload.php1,499 ▲1054.47 ▲0.33100.24 ▼0.2744.22 ▲3.70
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,1561.9538.5128.13
Settings /wp-admin/admin.php?page=dtpicker1,6671.9336.1147.79
Integration /wp-admin/admin.php?page=dtp_integration1,3301.9028.2043.51
Availability datepicker - InputWP /wp-admin/admin.php?page=date-time-picker1,0582.0627.4151.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/date-time-picker-field/vendor/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 13 options
    • _dtpicker_new_integration
    • can_compress_scripts
    • dtpicker
    • widget_theysaidso_widget
    • dtpicker_advanced
    • widget_recent-posts
    • fs_debug_mode
    • widget_recent-comments
    • _dtpicker_lite_imported_integration
    • fs_accounts
    • ...

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dtp_integration
    • > Notice in wp-content/plugins/date-time-picker-field/includes/Admin/IntegrationAPI.php+186
    Undefined index: picker
    • > GET request to /wp-admin/admin.php?page=dtp_integration
    • > Notice in wp-content/plugins/date-time-picker-field/includes/Admin/IntegrationAPI.php+169
    Undefined index: plugin

SRP Passed 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
The SRP test was a success

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)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: date time picker, datepicker, date range, date field, jquery ui

date-time-picker-field/date-time-picker-field.php 92% from 13 tests

The main PHP file in "Availability datepicker - Integrate with Contact Form 7 and Divi" ver. 2.3 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 189 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin58,050 lines of code in 170 files:
LanguageFilesBlank linesComment linesLines of code
PHP1388,66418,00135,448
JavaScript122,4791,12021,512
CSS161259838
Markdown1680214
JSON20022
XML13016

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity78.95
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.52
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes61
▷ Abstract classes23.28%
▷ Concrete classes5996.72%
▷ Final classes00.00%
Methods1,373
▷ Static methods21415.59%
▷ Public methods97771.16%
▷ Protected methods211.53%
▷ Private methods37527.31%
Functions104
▷ Named functions10298.08%
▷ Anonymous functions21.92%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.10MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/freemius/assets/img/date-time-picker.png9.16KB5.26KB▼ 42.58%
assets/img/date-picker.png8.86KB9.25KB0.00%
assets/img/date-and-time-picker.png12.86KB13.35KB0.00%
assets/img/date-range.png53.62KB56.65KB0.00%
vendor/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%