77% dhl-for-woocommerce

Code Review | DHL for WooCommerce

WordPress plugin DHL for WooCommerce scored 77% from 54 tests.

About plugin

  • Plugin page: dhl-for-woocommerce
  • Plugin version: 2.7.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.6
  • WordPress version: 5.8.1
  • First release: Nov 28, 2017
  • Latest release: Nov 11, 2021
  • Number of updates: 156
  • Update frequency: every 9.3 days
  • Top authors: shadim (64.1%)shindhl (36.54%)

Code review

54 tests

User reviews

33 reviews

Install metrics

9,000+ active / 267,324 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: ▼174.05ms] Passed 4 tests

Analyzing server-side resources used by DHL for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0134.78 ▲0.14
Dashboard /wp-admin3.07 ▲0.0145.91 ▼3.37
Posts /wp-admin/edit.php3.18 ▲0.0745.81 ▼0.02
Add New Post /wp-admin/post-new.php5.42 ▼0.0188.21 ▼690.83
Media Library /wp-admin/upload.php3.01 ▲0.0132.38 ▼1.96

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 435 new files
Database: no new tables, 1 new option
New WordPress options
dhl_permalinks_flushed

Browser metrics Passed 4 tests

An overview of browser requirements for DHL for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,689 ▲9315.92 ▲0.2712.08 ▲2.7845.11 ▼1.26
Dashboard /wp-admin2,977 ▲435.89 ▼0.12162.71 ▲14.41108.02 ▼3.41
Posts /wp-admin/edit.php2,751 ▲122.72 ▲0.0073.70 ▲1.6193.17 ▲5.76
Add New Post /wp-admin/post-new.php1,678 ▲6318.84 ▼2.65409.83 ▲106.05111.30 ▲9.74
Media Library /wp-admin/upload.php1,817 ▲105.03 ▲0.03158.56 ▼4.19113.54 ▲1.23

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 1 option in the database
    • 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
  • 9× PHP files output text when accessed directly:
    • > /wp-content/plugins/dhl-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto6.php
    • > /wp-content/plugins/dhl-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto2.php
    • > /wp-content/plugins/dhl-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto4.php
    • > /wp-content/plugins/dhl-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto7.php
    • > /wp-content/plugins/dhl-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto3.php
    • > /wp-content/plugins/dhl-for-woocommerce/lib/barcode.php
    • > /wp-content/plugins/dhl-for-woocommerce/lib/PDFMerger/fpdf/tutorial/makefont.php
    • > /wp-content/plugins/dhl-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto1.php
    • > /wp-content/plugins/dhl-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto5.php
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > 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/WP_API_Driver.php:23
    • > 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: Class 'FPDF' not found in wp-content/plugins/dhl-for-woocommerce/lib/PDFMerger/fpdi/fpdi_bridge.php:23
    • > 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/DHL_eCS_Asia/Auth.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/dhl-for-woocommerce/lib/PDFMerger/fpdi/fpdi_bridge.php:23
    • > PHP Warning
      imagettfbbox(): Could not find/open font in wp-content/plugins/dhl-for-woocommerce/lib/barcode.php on line 97
    • > 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 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
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/dhl-for-woocommerce/dhlpwoocommerce/includes/view/admin/multi-select.php:2
    • > 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

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:
  • Tags: Too many tags (18 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Donate link: Invalid url: ""
  • Screenshots: Screenshot #1 (screenshot-3.(png|jpg|jpeg|gif)) image required
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 for WooCommerce" version 2.7.2
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 Passed 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 plugin39,723 lines of code in 356 files:
LanguageFilesBlank linesComment linesLines of code
PHP2376,3646,46127,169
PO File31,9573,1444,992
HTML607203,364
JavaScript235851962,319
CSS10275351,526
Markdown2770265
SVG211088

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity24.96
▷ Minimum class complexity1.00
▷ Maximum class complexity338.00
Average method complexity3.96
▷ Minimum method complexity1.00
▷ Maximum method complexity70.00
Code structure
Namespaces10
Interfaces3
Traits0
Classes156
▷ Abstract classes106.41%
▷ Concrete classes14693.59%
▷ Final classes00.00%
Methods1,282
▷ Static methods120.94%
▷ Public methods89769.97%
▷ Protected methods35727.85%
▷ Private methods282.18%
Functions77
▷ Named functions1722.08%
▷ Anonymous functions6077.92%
Constants211
▷ Global constants3315.64%
▷ Class constants17884.36%
▷ Public constants178100.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
27 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/fancybox/fancy_shadow_ne.png0.34KB0.48KB0.00%
dhlpwoocommerce/assets/images/dhlpwc_sprites.png8.53KB3.96KB▼ 53.61%
dhlpwoocommerce/assets/images/dhlpwc_logo_mini.png0.86KB1.07KB0.00%
assets/img/fancybox/fancy_nav_right.png1.42KB1.66KB0.00%
assets/img/fancybox/fancy_nav_left.png1.41KB1.64KB0.00%