77% delivery-date-time-picker-for-woocommerce

Code Review | Delivery Date Time Picker for WooCommerce

WordPress plugin Delivery Date Time Picker for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: delivery-date-tim...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.1-5.9
  • WordPress version: 6.3.1
  • First release: Jan 29, 2022
  • Latest release: Jan 29, 2022
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: ravikhadka (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /377 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.15MB] [CPU: ▼27.13ms] Passed 4 tests

This is a short check of server-side resources used by Delivery Date Time Picker for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0626.65 ▼15.66
Dashboard /wp-admin3.20 ▼0.1530.65 ▼39.51
Posts /wp-admin/edit.php3.28 ▼0.0935.17 ▼20.22
Add New Post /wp-admin/post-new.php5.52 ▼0.3780.56 ▼33.11
Media Library /wp-admin/upload.php3.22 ▼0.0130.11 ▼5.30

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Delivery Date Time Picker for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,457 ▼30414.30 ▼0.050.48 ▼1.3220.18 ▼22.80
Dashboard /wp-admin2,195 ▲185.66 ▲0.0591.16 ▲4.5942.43 ▲7.09
Posts /wp-admin/edit.php2,106 ▲92.01 ▲0.0138.88 ▲0.8736.07 ▲2.30
Add New Post /wp-admin/post-new.php1,532 ▲623.30 ▲0.44598.12 ▼100.5357.29 ▼4.19
Media Library /wp-admin/upload.php1,400 ▲34.20 ▼0.0398.31 ▼24.1545.01 ▼3.76

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/delivery-date-time-picker-for-woocommerce/public/partials/ddtp-public-display.php
    • > /wp-content/plugins/delivery-date-time-picker-for-woocommerce/admin/partials/ddtp-admin-display.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/delivery-date-time-picker-for-woocommerce/admin/ddtp-submenu-page.php:15
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/delivery-date-time-picker-for-woocommerce/admin/class-ddtp-date-blocker.php on line 3
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/delivery-date-time-picker-for-woocommerce/admin/class-ddtp-date-blocker.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/delivery-date-time-picker-for-woocommerce/admin/class-ddtp-date-blocker.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/delivery-date-time-picker-for-woocommerce/admin/class-ddtp-date-blocker.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/delivery-date-time-picker-for-woocommerce/public/ddtp-datepicker-public.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots lack descriptions #4, #5, #6 in delivery-date-time-picker-for-woocommerce/assets to your readme.txt
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === delivery-date-time-picker-for-woocommerce === )
The official readme.txt might help

delivery-date-time-picker-for-woocommerce/ddtp.php 85% from 13 tests

The main PHP script in "Delivery Date Time Picker for WooCommerce" version 1.0.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("delivery-date-time-picker-for-woocommerce.php" instead of "ddtp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected9,405 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript91,1868897,076
CSS102771042,009
PHP15157548320

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity2.86
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.57
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
No PNG images were found in this plugin