10% a2z-dhl-express-shipping

Code Review | Automated DHL Express live/manual shipping rates, labels and pickup – HPOS supported

WordPress plugin Automated DHL Express live/manual shipping rates, labels and pickup – HPOS supported scored10%from 54 tests.

About plugin

  • Plugin page: a2z-dhl-express-s...
  • Plugin version: 5.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-6.4
  • WordPress version: 6.3.1
  • First release: Nov 8, 2018
  • Latest release: Nov 22, 2023
  • Number of updates: 198
  • Update frequency: every 9.3 days
  • Top authors: hitstacks (87.88%)a2zplugins (12.63%)

Code review

54 tests

User reviews

11 reviews

Install metrics

300+ active /43,068 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/a2z-dhl-express-shipping/a2zdhlexpress_basic.php+32
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/a2z-dhl-express-shipping/a2zdhlexpress_basic.php:32
    Stack trace:
    #0 wp-includes/class-wp-hook.php(312): hit_woo_dhl_express_plugin_activation()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(720): do_action()

Server metrics [RAM: ▲0.82MB] [CPU: ▼0.66ms] Passed 4 tests

A check of server-side resources used by Automated DHL Express live/manual shipping rates, labels and pickup – HPOS supported
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.24 ▲0.7742.95 ▲1.40
Dashboard /wp-admin4.23 ▲0.8846.65 ▼15.73
Posts /wp-admin/edit.php4.23 ▲0.8753.93 ▲5.19
Add New Post /wp-admin/post-new.php6.67 ▲0.77100.30 ▲6.50
Media Library /wp-admin/upload.php4.23 ▲0.9941.63 ▲7.28

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Automated DHL Express live/manual shipping rates, labels and pickup – HPOS supported
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.21 ▼0.071.65 ▼0.0938.20 ▼7.37
Dashboard /wp-admin2,195 ▲185.59 ▼0.0396.87 ▼1.3242.75 ▼5.77
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0439.72 ▲0.1137.57 ▲4.14
Add New Post /wp-admin/post-new.php1,526 ▼023.42 ▲0.28674.41 ▲55.5049.43 ▲1.62
Media Library /wp-admin/upload.php1,400 ▲34.32 ▲0.1295.24 ▼5.3342.38 ▲0.05

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

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 | 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
  • 693× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/google/protobuf/src/Google/Protobuf/Method.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/google/common-protos/src/Type/TimeOfDay.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/google/protobuf/src/Google/Protobuf/Internal/OneofOptions.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/google/common-protos/src/Api/Servicecontrol/V1/CheckResponse.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/google/common-protos/src/Cloud/ServiceManagement/V1/ListServicesResponse.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/psr/log/Psr/Log/Test/TestLogger.php:57
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\MailHandler' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php:22
    • > PHP Fatal error
      Trait 'Google\\Cloud\\Core\\Iterator\\ItemIteratorTrait' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/google/cloud-core/src/Iterator/ItemIterator.php on line 23

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: dhl, shipping label, dhl express, shipping rates, automated...

a2z-dhl-express-shipping/a2zdhlexpress_basic.php 77% from 13 tests

The primary PHP file in "Automated DHL Express live/manual shipping rates, labels and pickup – HPOS supported" version 5.1.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("a2z-dhl-express-shipping.php" instead of "a2zdhlexpress_basic.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0.1" instead of "2.6")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis 0% from 3 tests

File types 0% from 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
Please fix the following items
  • Do not distribute dangerous files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/bin/google-cloud-batch.bat
85,508 lines of code in 1,295 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,18916,49571,40276,097
Markdown421,66805,164
JSON36403,250
XML705281
XSLT22320209
Bourne Shell94681172
JavaScript120116
YAML410098
Protocol Buffers2143862
Python1174346
make1409
DOS Batch1004

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 1,286)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 340)
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.51
▷ Minimum class complexity1.00
▷ Maximum class complexity1,286.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity340.00
Code structure
Namespaces165
Interfaces52
Traits58
Classes1,052
▷ Abstract classes181.71%
▷ Concrete classes1,03498.29%
▷ Final classes151.45%
Methods6,466
▷ Static methods5628.69%
▷ Public methods5,72288.49%
▷ Protected methods2353.63%
▷ Private methods5097.87%
Functions292
▷ Named functions7726.37%
▷ Anonymous functions21573.63%
Constants584
▷ Global constants30.51%
▷ Class constants58199.49%
▷ Public constants56196.56%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.15MB with 0.09MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
controllors/views/dhl.png27.25KB10.29KB▼ 62.23%
controllors/views/hdhl.png6.93KB3.56KB▼ 48.66%
dhl.png119.73KB45.66KB▼ 61.87%