84% wp-datepicker

Code Review | WP Datepicker

WordPress plugin WP Datepicker scored 84% from 54 tests.

About plugin

  • Plugin page: wp-datepicker
  • Plugin version: 2.0.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Aug 28, 2015
  • Latest release: Oct 2, 2023
  • Number of updates: 140
  • Update frequency: every 21.1 days
  • Top authors: fahadmahmood (100%)

Code review

54 tests

User reviews

36 reviews

Install metrics

10,000+ active / 207,081 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.80MB] [CPU: ▲0.99ms] Passed 4 tests

A check of server-side resources used by WP Datepicker
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.40 ▲0.9445.70 ▲4.67
Dashboard /wp-admin4.10 ▲0.7951.32 ▲0.56
Posts /wp-admin/edit.php4.15 ▲0.7952.81 ▲3.35
Add New Post /wp-admin/post-new.php6.71 ▲0.8298.27 ▼4.64
Media Library /wp-admin/upload.php4.02 ▲0.7945.37 ▲11.42
WP Datepicker /wp-admin/options-general.php?page=wp_dp4.3048.43

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 155 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
wp_datepicker_option-1
can_compress_scripts
theysaidso_admin_options
wpdp_previous_version_compatible

Browser metrics Passed 4 tests

An overview of browser requirements for WP Datepicker
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,911 ▲15414.12 ▼0.288.93 ▲6.5436.92 ▼9.85
Dashboard /wp-admin2,218 ▲275.90 ▲0.02104.42 ▼5.2141.72 ▲0.74
Posts /wp-admin/edit.php2,098 ▲62.05 ▼0.0142.29 ▲1.9535.06 ▼1.01
Add New Post /wp-admin/post-new.php1,536 ▲322.63 ▼0.56626.60 ▼61.4353.71 ▼6.48
Media Library /wp-admin/upload.php1,400 ▲124.23 ▼0.00102.44 ▲0.8845.94 ▼1.79
WP Datepicker /wp-admin/options-general.php?page=wp_dp3,80726.06710.6075.09

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • wp_datepicker_option-1
    • widget_recent-posts
    • wpdp_previous_version_compatible
    • 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
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-datepicker/inc/functions_inner.php:230
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpdp_get_datepicker_list() in wp-content/plugins/wp-datepicker/inc/date_range.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-datepicker/inc/speed_opt_template.php:33

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
4 plugin tags: date selection, datepicker, jquery-ui, html datepicker

wp-datepicker/index.php 85% from 13 tests

The principal PHP file in "WP Datepicker" v. 2.0.8 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 152 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-datepicker.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin18,980 lines of code in 103 files:
LanguageFilesBlank linesComment linesLines of code
SVG4019,601
PHP81,9421,1963,712
JavaScript815633682,905
CSS698721,821
PO File4368396941

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity21.05
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity3.49
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods169
▷ Static methods6136.09%
▷ Public methods16396.45%
▷ Protected methods00.00%
▷ Private methods63.55%
Functions30
▷ Named functions2893.33%
▷ Anonymous functions26.67%
Constants32
▷ Global constants32100.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
31 PNG files occupy 0.34MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_glass_100_f6f6f6_1x400.png0.26KB0.12KB▼ 53.44%
css/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
css/images/ui-icons_777777_256x240.png6.94KB4.18KB▼ 39.78%
css/images/ui-bg_gloss-wave_35_f6a828_500x100.png5.68KB1.83KB▼ 67.77%
css/images/ui-icons_ef8c08_256x240.png4.44KB4.17KB▼ 6.02%