78% dhl-ecommerce-asia-for-woocommerce

Code Review | DHL for WooCommerce eCS Asia

WordPress plugin DHL for WooCommerce eCS Asia scored78%from 54 tests.

About plugin

  • Plugin page: dhl-ecommerce-asi...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0+
  • WordPress version: 6.3.1
  • First release: Sep 27, 2022
  • Latest release: Jul 20, 2023
  • Number of updates: 7
  • Update frequency: every 43.1 days
  • Top authors: abdalsalaam (71.43%)aralle (42.86%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /561 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.64ms] Passed 4 tests

Analyzing server-side resources used by DHL for WooCommerce eCS Asia
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.21 ▼2.10
Dashboard /wp-admin3.31 ▲0.0145.41 ▼4.73
Posts /wp-admin/edit.php3.43 ▲0.0747.32 ▲2.49
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.96 ▼18.23
Media Library /wp-admin/upload.php3.23 ▲0.0137.08 ▲2.98

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 211 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
can_compress_scripts
dhl_permalinks_flushed
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for DHL for WooCommerce eCS Asia
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲914.38 ▼0.071.70 ▼0.3138.22 ▼8.31
Dashboard /wp-admin2,204 ▲245.59 ▼0.0890.81 ▼0.0539.69 ▼3.06
Posts /wp-admin/edit.php2,107 ▲72.03 ▲0.0040.83 ▲3.7538.39 ▲4.56
Add New Post /wp-admin/post-new.php1,532 ▲621.55 ▼1.60688.45 ▲7.6560.90 ▲9.37
Media Library /wp-admin/upload.php1,406 ▲64.23 ▲0.03112.25 ▲13.4947.32 ▲1.24

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • dhl_permalinks_flushed
    • widget_theysaidso_widget
    • db_upgraded

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 everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 9× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto5.php
    • > /wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto6.php
    • > /wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto3.php
    • > /wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/PDFMerger/fpdf/tutorial/makefont.php
    • > /wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto7.php
    • > /wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/barcode.php
    • > /wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto1.php
    • > /wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto2.php
    • > /wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/PDFMerger/fpdf/tutorial/tuto4.php
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/PDFMerger/fpdi/fpdi_bridge.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'PR\\DHL\\REST_API\\Interfaces\\API_Driver_Interface' not found in wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/includes/REST_API/Drivers/WP_API_Driver.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'TCPDF' not found in wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/PDFMerger/fpdi/fpdi2tcpdf_bridge.php:29
    • > PHP Warning
      imagettftext(): Could not find/open font in wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/barcode.php on line 111
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/PDFMerger/fpdi/fpdi_bridge.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'PR\\DHL\\REST_API\\Interfaces\\API_Driver_Interface' not found in wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/includes/REST_API/Drivers/Logging_Driver.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'PR\\DHL\\REST_API\\Interfaces\\API_Driver_Interface' not found in wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/includes/REST_API/Drivers/JSON_API_Driver.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'PR\\DHL\\REST_API\\Interfaces\\API_Auth_Interface' not found in wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/includes/REST_API/DHL_eCS_Asia/Auth.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'PR\\DHL\\REST_API\\API_Client' not found in wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/includes/REST_API/DHL_eCS_Asia/Client.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'FPDF' not found in wp-content/plugins/dhl-ecommerce-asia-for-woocommerce/lib/PDFMerger/fpdi/fpdi_bridge.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Contributors: Contributors not specified
The official readme.txt is a good inspiration

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

The primary PHP file in "DHL for WooCommerce eCS Asia" version 1.0.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("dhl-ecommerce-asia-for-woocommerce.php" instead of "pr-dhl-woocommerce.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
There were no executable files found in this plugin18,202 lines of code in 150 files:
LanguageFilesBlank linesComment linesLines of code
PHP762,1813,53810,447
HTML597203,242
PO File11,0931,8043,142
CSS613126691
JavaScript616655629
Markdown119038
JSON10013

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity32.85
▷ Minimum class complexity1.00
▷ Maximum class complexity339.00
Average method complexity4.02
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces8
Interfaces2
Traits0
Classes46
▷ Abstract classes36.52%
▷ Concrete classes4393.48%
▷ Final classes00.00%
Methods513
▷ Static methods112.14%
▷ Public methods37072.12%
▷ Protected methods13325.93%
▷ Private methods101.95%
Functions45
▷ Named functions1737.78%
▷ Anonymous functions2862.22%
Constants45
▷ Global constants1328.89%
▷ Class constants3271.11%
▷ Public constants32100.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
24 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_title_main.png0.09KB0.14KB0.00%
assets/img/parcelshop.png5.41KB2.31KB▼ 57.31%
assets/img/fancybox/fancy_title_over.png0.07KB0.09KB0.00%
assets/img/packstation.png6.13KB2.57KB▼ 58.07%
assets/img/fancybox/fancy_shadow_nw.png0.32KB0.47KB0.00%