78% flexible-shipping-dhl-express

Code Review | DHL Express Shipping for WooCommerce - Live Rates

WordPress plugin DHL Express Shipping for WooCommerce - Live Rates scored78%from 54 tests.

About plugin

  • Plugin page: flexible-shipping...
  • Plugin version: 3.0.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Apr 8, 2020
  • Latest release: Nov 30, 2023
  • Number of updates: 140
  • Update frequency: every 9.6 days
  • Top authors: wpdesk (60%)octolize (40.71%)

Code review

54 tests

User reviews

5 reviews

Install metrics

700+ active /35,419 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.73MB] [CPU: ▼4.33ms] Passed 4 tests

A check of server-side resources used by DHL Express Shipping for WooCommerce - Live Rates
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.21 ▲0.7441.98 ▼0.42
Dashboard /wp-admin4.05 ▲0.7051.57 ▼10.99
Posts /wp-admin/edit.php4.10 ▲0.7452.14 ▲4.86
Add New Post /wp-admin/post-new.php6.63 ▲0.7491.63 ▼10.76
Media Library /wp-admin/upload.php3.97 ▲0.7441.75 ▲9.26

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 1,249 new files
Database: no new tables, 8 new options
New WordPress options
plugin_activation_flexible-shipping-dhl-express/flexible-shipping-dhl-express.php
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
wpdesk_requirements_plugins_data
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for DHL Express Shipping for WooCommerce - Live Rates
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲2314.67 ▲0.331.78 ▼0.3238.89 ▼4.16
Dashboard /wp-admin2,200 ▲205.60 ▼0.2697.05 ▼2.5744.29 ▼2.73
Posts /wp-admin/edit.php2,105 ▲22.01 ▲0.0636.65 ▼4.1336.30 ▲1.04
Add New Post /wp-admin/post-new.php1,531 ▲523.22 ▼0.30669.21 ▲33.0252.04 ▲4.39
Media Library /wp-admin/upload.php1,402 ▲54.22 ▲0.03109.17 ▲6.9349.26 ▲4.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-posts
    • theysaidso_admin_options
    • plugin_activation_flexible-shipping-dhl-express/flexible-shipping-dhl-express.php
    • wpdesk_requirements_plugins_data
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Please fix the following
  • 6× PHP files output text when accessed directly:
    • > /wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/wpdesk/wp-dhl-express-shipping-method/src/WooCommerceShipping/DhlExpress/views/html-payment-account-number.php
    • > /wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-custom-services.php
    • > /wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-fallback.php
    • > /wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-free-shipping.php
    • > /wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/wpdesk/wp-dhl-express-shipping-method/src/WooCommerceShipping/DhlExpress/views/settings-scrips.php
    • > /wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingMethod/Traits/view/shipping-method-java-script-custom-origin.php
  • 740× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'DhlVendor\\DHL\\Datatype\\Base' not found in wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/alfallouji/dhl_api/DHL/Datatype/AP/Billing.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'DhlVendor\\DHL\\Datatype\\Base' not found in wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/alfallouji/dhl_api/DHL/Datatype/AP/ChargeCard.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/CustomFields/ApiStatus/views/api-status.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'DhlVendor\\DHL\\Datatype\\Base' not found in wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/alfallouji/dhl_api/DHL/Datatype/GB/BarCodes.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'DhlVendor\\Psr\\Http\\Message\\ResponseInterface' not found in wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/guzzlehttp/psr7/src/Response.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'DhlVendor\\Ramsey\\Collection\\AbstractArray' not found in wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/ramsey/collection/src/Queue.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'DhlVendor\\Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'DhlVendor\\GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/guzzlehttp/promises/src/FulfilledPromise.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'DhlVendor\\WPDesk\\WooCommerceShipping\\ShippingBuilder\\AddressProvider' not found in wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/wpdesk/wp-woocommerce-shipping/src/WooCommerceShipping/ShippingBuilder/WooCommerceAddressSender.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'DhlVendor\\Ramsey\\Uuid\\UuidInterface' not found in wp-content/plugins/flexible-shipping-dhl-express/vendor_prefixed/ramsey/uuid/src/Rfc4122/UuidInterface.php:24

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: dhl express rates, woocommerce shipping, dhl rates, live rates, shipping rates

flexible-shipping-dhl-express/flexible-shipping-dhl-express.php 92% from 13 tests

This is the main PHP file of "DHL Express Shipping for WooCommerce - Live Rates" version 3.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.5" instead of "5.8")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected46,850 lines of code in 1,222 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,1342,50940,25444,084
JSON42002,190
CSS8372201
SVG2200179
JavaScript142325171
Markdown25025

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 issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity5.16
▷ Minimum class complexity1.00
▷ Maximum class complexity99.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces163
Interfaces149
Traits35
Classes892
▷ Abstract classes262.91%
▷ Concrete classes86697.09%
▷ Final classes869.93%
Methods3,864
▷ Static methods2967.66%
▷ Public methods3,10780.41%
▷ Protected methods2586.68%
▷ Private methods49912.91%
Functions178
▷ Named functions3117.42%
▷ Anonymous functions14782.58%
Constants488
▷ Global constants81.64%
▷ Class constants48098.36%
▷ Public constants40985.21%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.12MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/octolize.com.png88.91KB39.07KB▼ 56.06%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/flexibleshipping.com.png5.63KB3.68KB▼ 34.58%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/wpdesk.net.png2.36KB2.43KB0.00%
assets/images/beacon-better-transparent.png9.82KB0.71KB▼ 92.75%