77% dhl-for-woocommerce

Code Review | DHL Shipping Germany for WooCommerce

WordPress plugin DHL Shipping Germany for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: dhl-for-woocommerce
  • Plugin version: 3.5.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 28, 2017
  • Latest release: Oct 22, 2023
  • Number of updates: 1
  • Update frequency: every 365.0 days

Code review

54 tests

User reviews

41 reviews

Install metrics

6,000+ active /473,008 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
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼8.50ms] Passed 4 tests

Analyzing server-side resources used by DHL Shipping Germany for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.84 ▲1.86
Dashboard /wp-admin3.31 ▼0.0347.37 ▼12.82
Posts /wp-admin/edit.php3.43 ▲0.0743.83 ▼4.75
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.71 ▼13.87
Media Library /wp-admin/upload.php3.24 ▲0.0133.86 ▼2.54

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 212 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
dhl_permalinks_flushed

Browser metrics Passed 4 tests

An overview of browser requirements for DHL Shipping Germany for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.35 ▲0.161.74 ▼0.1842.78 ▲3.48
Dashboard /wp-admin2,201 ▲245.50 ▼0.1080.47 ▼10.9438.71 ▼3.21
Posts /wp-admin/edit.php2,107 ▲71.97 ▼0.0434.57 ▼3.4733.73 ▼0.44
Add New Post /wp-admin/post-new.php1,540 ▲1223.21 ▲0.17615.01 ▼70.5961.29 ▲3.64
Media Library /wp-admin/upload.php1,409 ▲94.18 ▼0.0595.80 ▼10.1744.19 ▲0.08

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • dhl_permalinks_flushed

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means 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
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/dhl-for-woocommerce/lib/PDFMerger/tcpdf/tools/tcpdf_addfont.php
    • > /wp-content/plugins/dhl-for-woocommerce/lib/barcode.php
  • 17× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      imagettftext(): Could not find/open font in wp-content/plugins/dhl-for-woocommerce/lib/barcode.php on line 111
    • > PHP Fatal error
      Uncaught Error: Interface 'PR\\DHL\\REST_API\\Interfaces\\API_Auth_Interface' not found in wp-content/plugins/dhl-for-woocommerce/includes/REST_API/Paket/Auth.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'TCPDF' not found in wp-content/plugins/dhl-for-woocommerce/lib/PDFMerger/tcpdf/tcpdi.php:26
    • > PHP Warning
      imagettfbbox(): Could not find/open font in wp-content/plugins/dhl-for-woocommerce/lib/barcode.php on line 97
    • > PHP Fatal error
      Uncaught Error: Interface 'PR\\DHL\\REST_API\\Interfaces\\API_Driver_Interface' not found in wp-content/plugins/dhl-for-woocommerce/includes/REST_API/Drivers/JSON_API_Driver.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'PR\\DHL\\REST_API\\API_Client' not found in wp-content/plugins/dhl-for-woocommerce/includes/REST_API/Deutsche_Post/Client.php:16
    • > PHP Notice
      Trying to access array offset on value of type bool in wp-content/plugins/dhl-for-woocommerce/lib/barcode.php on line 99
    • > PHP Notice
      Trying to access array offset on value of type bool in wp-content/plugins/dhl-for-woocommerce/lib/barcode.php on line 98
    • > PHP Fatal error
      Uncaught Error: Interface 'PR\\DHL\\REST_API\\Interfaces\\API_Driver_Interface' not found in wp-content/plugins/dhl-for-woocommerce/includes/REST_API/Drivers/Logging_Driver.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PR\\DHL\\REST_API\\API_Client' not found in wp-content/plugins/dhl-for-woocommerce/includes/REST_API/DHL_eCS_Asia/Client.php:17

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 on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (screenshot-3.(png|jpg|jpeg|gif)) image required
  • Donate link: Invalid url: ""
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

dhl-for-woocommerce/pr-dhl-woocommerce.php 85% from 13 tests

Analyzing the main PHP file in "DHL Shipping Germany for WooCommerce" version 3.5.8
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("dhl-for-woocommerce.php" instead of "pr-dhl-woocommerce.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.6" instead of "3.0")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin86,011 lines of code in 159 files:
LanguageFilesBlank linesComment linesLines of code
PHP1255,94117,82363,836
XSD65111714,449
PO File11,2612,1193,589
JavaScript143361161,303
CSS6208261,071
XML3091,011
Markdown22210707
JSON20045

PHP code 0% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 4,349)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 499)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity103.25
▷ Minimum class complexity1.00
▷ Maximum class complexity4,349.00
Average method complexity6.84
▷ Minimum method complexity1.00
▷ Maximum method complexity499.00
Code structure
Namespaces12
Interfaces3
Traits0
Classes84
▷ Abstract classes55.95%
▷ Concrete classes7994.05%
▷ Final classes00.00%
Methods1,544
▷ Static methods1368.81%
▷ Public methods99464.38%
▷ Protected methods51333.23%
▷ Private methods372.40%
Functions91
▷ Named functions55.49%
▷ Anonymous functions8694.51%
Constants200
▷ Global constants15175.50%
▷ Class constants4924.50%
▷ Public constants49100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
30 PNG files occupy 0.09MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/fancybox/fancy_shadow_se.png0.34KB0.48KB0.00%
assets/img/fancybox/fancy_shadow_n.png0.10KB0.19KB0.00%
assets/img/parcelshop.png5.41KB2.31KB▼ 57.31%
assets/img/fancybox/fancy_loading.png9.96KB6.30KB▼ 36.67%
assets/img/fancybox/fancy_shadow_e.png0.10KB0.18KB0.00%