10% a2z-dhl-express-shipping

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

WordPress plugin Automated DHL Express live/manual shipping rates, labels and pickup scored 10% from 54 tests.

About plugin

  • Plugin page: a2z-dhl-express-s...
  • Plugin version: 3.1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-5.9
  • WordPress version: 5.9.2
  • First release: Nov 8, 2018
  • Latest release: Jan 25, 2022
  • Number of updates: 126
  • Update frequency: every 9.3 days
  • Top authors: hitstacks (80.95%)a2zplugins (19.84%)

Code review

54 tests

User reviews

9 reviews

Install metrics

400+ active / 25,352 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > 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(309): hit_woo_dhl_express_plugin_activation()
    #1 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(474): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(716): do_action()

Server metrics [RAM: ▲0.40MB] [CPU: ▼298.56ms] Passed 4 tests

Server-side resources used by Automated DHL Express live/manual shipping rates, labels and pickup
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.4957.52 ▲7.68
Dashboard /wp-admin3.83 ▲0.4235.12 ▼3.98
Posts /wp-admin/edit.php4.06 ▲0.4244.48 ▲6.66
Add New Post /wp-admin/post-new.php7.30 ▲0.34110.16 ▼1,197.35
Media Library /wp-admin/upload.php3.71 ▲0.4127.93 ▲0.45

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Automated DHL Express live/manual shipping rates, labels and pickup
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲4115.79 ▲0.225.82 ▼0.482.57 ▲0.10
Dashboard /wp-admin2,895 ▲346.12 ▼0.05127.22 ▼21.07154.17 ▼9.79
Posts /wp-admin/edit.php2,685 ▼93.24 ▼0.0062.92 ▲0.68148.35 ▲3.60
Add New Post /wp-admin/post-new.php1,661 ▼2918.04 ▼0.26380.89 ▼17.02168.07 ▲10.54
Media Library /wp-admin/upload.php1,698 ▼35.55 ▲0.09151.13 ▲18.94191.04 ▲3.73

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 693× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WeightPackStrategy' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/weight_pack/class-hit-weight-strategy-descend.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Rpc\\RetryInfo' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/google/gax/src/Serializer.php:485
    • > 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/MessageOptions.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Psr7\\Request' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/guzzlehttp/psr7/src/ServerRequest.php:25
    • > 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/MetricRule.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\Handler' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/monolog/monolog/src/Monolog/Handler/NoopHandler.php:23
    • > 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/Duration.php:60
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/google/gax/tests/Tests/Unit/FixedSizeCollectionTest.php:43
    • > 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/Distribution/BucketOptions/Linear.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: dhl express, dhl, shipping label, dhl woocommerce, shipping rates...

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

The main PHP file in "Automated DHL Express live/manual shipping rates, labels and pickup" ver. 3.1.2 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Requires at least: Required version does not match the one declared in readme.txt ("4.0.1" instead of "2.6")
  • 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")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Please fix the following items
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/a2z-dhl-express-shipping/controllors/classes/gtrans/vendor/bin/google-cloud-batch.bat
83,076 lines of code in 1,293 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,18816,39671,37173,783
Markdown421,66805,164
JSON36403,250
XML715279
XSLT22320209
Bourne Shell94681172
YAML410098
Protocol Buffers2143862
Python1174346
make1409
DOS Batch1004

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 195)
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.86
▷ Minimum class complexity1.00
▷ Maximum class complexity620.00
Average method complexity1.87
▷ Minimum method complexity1.00
▷ Maximum method complexity195.00
Code structure
Namespaces165
Interfaces52
Traits58
Classes1,051
▷ Abstract classes181.71%
▷ Concrete classes1,03398.29%
▷ Final classes151.45%
Methods6,442
▷ Static methods5628.72%
▷ Public methods5,71188.65%
▷ Protected methods2353.65%
▷ Private methods4967.70%
Functions291
▷ Named functions7726.46%
▷ Anonymous functions21473.54%
Constants584
▷ Global constants30.51%
▷ Class constants58199.49%
▷ Public constants56196.56%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
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
dhl.png119.73KB45.66KB▼ 61.87%
controllors/views/hdhl.png6.93KB3.56KB▼ 48.66%
controllors/views/dhl.png27.25KB10.29KB▼ 62.23%