84% rt-date-picker

Code Review | Royal Date Picker

WordPress plugin Royal Date Picker scored 84% from 54 tests.

About plugin

  • Plugin page: rt-date-picker
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.6
  • WordPress version: 5.9.2
  • First release: Aug 29, 2013
  • Latest release: Aug 30, 2013
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: royaltechbd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active / 2,299 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼2.51MB] [CPU: ▼357.89ms] Passed 4 tests

Analyzing server-side resources used by Royal Date Picker
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.85 ▼1.664.04 ▼45.83
Dashboard /wp-admin1.87 ▼1.534.20 ▼29.57
Posts /wp-admin/edit.php1.87 ▼1.773.49 ▼31.34
Add New Post /wp-admin/post-new.php1.87 ▼5.094.70 ▼1,324.82
Media Library /wp-admin/upload.php1.87 ▼1.433.60 ▼22.15

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 38 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Royal Date Picker
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,944 ▲19016.75 ▲0.7010.25 ▲4.542.71 ▼0.31
Dashboard /wp-admin2,907 ▲466.25 ▲0.06117.68 ▼16.80155.16 ▼7.45
Posts /wp-admin/edit.php2,703 ▲93.25 ▲0.0165.54 ▼0.31142.90 ▼0.25
Add New Post /wp-admin/post-new.php1,670 ▲916.13 ▼6.22416.46 ▲37.81155.67 ▲6.33
Media Library /wp-admin/upload.php1,713 ▲155.62 ▲0.09124.00 ▼12.99186.53 ▲1.38

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
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5768
    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the date-picker-js2 handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/rt-date-picker/rt-date-picker.php:13
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/rt-date-picker/rt-date-picker.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === rt-date-picker === )
  • Screenshots: Please add images for these screenshots: #1 (Royal Date Picket for Contact form 7.), #2 (Royal Date Picket in action.)
The official readme.txt is a good inspiration

rt-date-picker/rt-date-picker.php Passed 13 tests

"Royal Date Picker" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
95 characters long description:
Date Picker for WP7 or others When use specific IDs (#rtdate, #startdate, #enddate, #eventdate)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected4,074 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS18702632,204
JavaScript32232781,863
PHP17127

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
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
14 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png0.27KB0.14KB▼ 47.84%
lib/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png0.26KB0.12KB▼ 53.44%
lib/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png0.30KB0.15KB▼ 49.68%
lib/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png0.32KB0.18KB▼ 42.38%
lib/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png0.20KB0.08KB▼ 57.56%