67% delhivery-logistics-courier

Code Review | Delhivery Logistics Courier

WordPress plugin Delhivery Logistics Courier scored67%from 54 tests.

About plugin

  • Plugin page: delhivery-logisti...
  • Plugin version: 1.0.107
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.1.1
  • WordPress version: 6.3.1
  • First release: Aug 27, 2020
  • Latest release: Dec 1, 2022
  • Number of updates: 181
  • Update frequency: every 4.8 days
  • Top authors: delhiveryadmin (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active /29,476 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.34MB] [CPU: ▼3.96ms] Passed 4 tests

An overview of server-side resources used by Delhivery Logistics Courier
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3338.86 ▼6.36
Dashboard /wp-admin3.64 ▲0.3449.63 ▼2.25
Posts /wp-admin/edit.php3.75 ▲0.4051.24 ▲5.71
Add New Post /wp-admin/post-new.php6.24 ▲0.35100.58 ▼8.72
Media Library /wp-admin/upload.php3.56 ▲0.3337.68 ▲1.49

Server storage [IO: ▲2.01MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 75 new files
Database: 5 new tables, 6 new options
New tables
wp_dv_logs
wp_dv_assign_awb
wp_dv_settings
wp_dv_my_warehouse
wp_dv_awb_no_details
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Delhivery Logistics Courier
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲9213.28 ▼1.101.79 ▲0.0439.09 ▼4.85
Dashboard /wp-admin2,216 ▲285.95 ▲1.06105.76 ▼1.4442.69 ▲0.69
Posts /wp-admin/edit.php2,105 ▲162.09 ▲0.0740.41 ▼0.7035.14 ▼2.34
Add New Post /wp-admin/post-new.php1,529 ▼322.24 ▲4.04674.55 ▲72.8760.39 ▲1.76
Media Library /wp-admin/upload.php1,392 ▲14.32 ▲0.09100.52 ▲0.8943.19 ▼0.66

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 5 tables in the database
    • wp_dv_settings
    • wp_dv_awb_no_details
    • wp_dv_assign_awb
    • wp_dv_my_warehouse
    • wp_dv_logs
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/delhivery-logistics-courier/admin/config.php
    • > /wp-content/plugins/delhivery-logistics-courier/delhivery-logistics-courier.php
  • 15× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/delhivery-logistics-courier/admin/create_pickup_request.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/delhivery-logistics-courier/admin/invoice.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/delhivery-logistics-courier/admin/edit_order.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/delhivery-logistics-courier/admin/refresh_token.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/delhivery-logistics-courier/admin/awb_no_detail.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/delhivery-logistics-courier/admin/home.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/delhivery-logistics-courier/admin/track_order.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/delhivery-logistics-courier/admin/refresh_token.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/delhivery-logistics-courier/admin/wallet.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/delhivery-logistics-courier/admin/refresh_token.php:8

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Donate link: Invalid URI ("www.delhivery.com")
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Login.png), #2 (RateCalculator.png), #3 (WaybillList.png), #4 (AddWarehouse.png), #5 (WarehousesList.png), #6 (OrdersList.png), #7 (CreatePickupRequest.png), #8 (FAQ.png)
The official readme.txt is a good inspiration

delhivery-logistics-courier/delhivery-logistics-courier.php 77% from 13 tests

The principal PHP file in "Delhivery Logistics Courier" v. 1.0.107 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: The plugin description must be longer than 10 characters (currently 9 characters long)
  • Requires at least: Required version does not match the one declared in readme.txt ("4.9" instead of "4.8")
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin16,278 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
CSS112,3212337,522
PHP176652857,090
JavaScript6193791,644
SVG10022

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity163.00
▷ Minimum class complexity163.00
▷ Maximum class complexity163.00
Average method complexity7.19
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods27
▷ Static methods00.00%
▷ Public methods27100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
11 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/warehouse.png9.86KB3.39KB▼ 65.62%
images/delivery_icon.png0.53KB0.13KB▼ 74.73%
images/checked.png0.61KB0.48KB▼ 20.13%
images/Logo_Black.png5.79KB3.11KB▼ 46.24%
images/shape.png1.04KB0.86KB▼ 17.79%