72% dwp-courier-delivery-management

Code Review | DWP Courier & Delivery Management

WordPress plugin DWP Courier & Delivery Management scored 72% from 54 tests.

About plugin

  • Plugin page: dwp-courier-deliv...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8.1
  • WordPress version: 5.8.1
  • First release: Nov 9, 2021
  • Latest release: Nov 9, 2021
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: dragwp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

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

Server metrics [RAM: ▲0.14MB] [CPU: ▼139.67ms] Passed 4 tests

Server-side resources used by DWP Courier & Delivery Management
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.96 ▲0.2433.70 ▲15.23
Dashboard /wp-admin3.19 ▲0.1352.33 ▲4.16
Posts /wp-admin/edit.php3.30 ▲0.1948.87 ▲12.18
Add New Post /wp-admin/post-new.php5.55 ▲0.1189.49 ▼573.90
Media Library /wp-admin/upload.php3.13 ▲0.1333.09 ▼1.11
Merchant Registration /wp-admin/admin.php?page=dwp-merchant-registration3.1633.94
Dashboard /wp-admin/admin.php?page=dwp-courier-management3.1437.98
Submit Delivery Request /wp-admin/admin.php?page=dwp-submit-delivery-request3.0929.76
Merchant List /wp-admin/admin.php?page=dwp-merchant-list3.0929.94
Delivery List /wp-admin/admin.php?page=dwp-delivery-list3.0925.32

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 1,454 new files
Database: 2 new tables, no new options
New tables
wp_dwp_delivery_request_submit
wp_dwp_merchant_registration

Browser metrics Passed 4 tests

An overview of browser requirements for DWP Courier & Delivery Management
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,832 ▲23716.26 ▲0.2814.02 ▲4.6246.05 ▲1.83
Dashboard /wp-admin3,017 ▲865.92 ▼0.26141.30 ▼40.85111.24 ▼7.72
Posts /wp-admin/edit.php2,783 ▲442.72 ▲0.0168.12 ▲1.1389.30 ▲1.47
Add New Post /wp-admin/post-new.php1,711 ▲21118.49 ▼0.07378.33 ▼19.73108.55 ▲0.56
Media Library /wp-admin/upload.php1,854 ▲475.01 ▼0.02156.18 ▲0.21119.19 ▼1.11
Merchant Registration /wp-admin/admin.php?page=dwp-merchant-registration1,7184.3882.0085.56
Dashboard /wp-admin/admin.php?page=dwp-courier-management1,2832.8670.3248.25
Submit Delivery Request /wp-admin/admin.php?page=dwp-submit-delivery-request1,4662.6865.7960.16
Merchant List /wp-admin/admin.php?page=dwp-merchant-list1,3653.0886.6856.28
Delivery List /wp-admin/admin.php?page=dwp-delivery-list1,3573.0982.8954.87

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 2 tables
    • wp_dwp_merchant_registration
    • wp_dwp_delivery_request_submit

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dwp-delivery-list
    • > User notice in wp-includes/functions.php+5663
    wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dwp-delivery-list
    • > User notice in wp-includes/functions.php+5663
    wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)

SRP 0% 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
Please fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/dwp-courier-delivery-management/public/partials/dwp-courier-management-public-display.php
    • > /wp-content/plugins/dwp-courier-delivery-management/admin/partials/dwp-courier-management-admin-display.php
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/dwp-courier-delivery-management/admin/partials/tmpl-merchant-list.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/dwp-courier-delivery-management/admin/partials/tmpl-submit-delivery-request.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_media() in wp-content/plugins/dwp-courier-delivery-management/admin/partials/tmpl-merchant-registration.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/dwp-courier-delivery-management/admin/partials/tmpl-delivery-list.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/dwp-courier-delivery-management/admin/partials/tmpl-admin-dashboard.php:6

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, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 18 tag instead of maximum 10
Please take inspiration from this readme.txt

dwp-courier-delivery-management/dwp-courier-management.php 92% from 13 tests

The principal PHP file in "DWP Courier & Delivery Management" v. 1.0.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("dwp-courier-delivery-management.php" instead of "dwp-courier-management.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin17,476 lines of code in 1,439 files:
LanguageFilesBlank linesComment linesLines of code
HTML1505,666
SVG1,407004,810
Sass1402,835
CSS613141,478
JSON1001,408
PHP172985861,007
JavaScript66654272

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity10.14
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods2985.29%
▷ Protected methods00.00%
▷ Private methods514.71%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 compressed PNG files occupy 0.10MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/sort_both.png0.20KB0.29KB0.00%
assets/images/sort_asc.png0.16KB0.25KB0.00%
assets/images/placeholder.png100.24KB73.05KB▼ 27.12%