77% elex-woo-dhl-express-shipping

Code Review | ELEX WooCommerce DHL Express Shipping Method

WordPress plugin ELEX WooCommerce DHL Express Shipping Method scored77%from 54 tests.

About plugin

  • Plugin page: elex-woo-dhl-expr...
  • Plugin version: 2.2.9
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-6.2
  • WordPress version: 6.3.1
  • First release: Jan 21, 2022
  • Latest release: Jul 1, 2023
  • Number of updates: 10
  • Update frequency: every 52.7 days
  • Top authors: elextensions (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /3,401 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼7.43ms] Passed 4 tests

A check of server-side resources used by ELEX WooCommerce DHL Express Shipping Method
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0440.95 ▲3.45
Dashboard /wp-admin3.35 ▲0.0442.62 ▼8.14
Posts /wp-admin/edit.php3.46 ▲0.1041.30 ▼8.79
Add New Post /wp-admin/post-new.php5.93 ▲0.0479.76 ▼16.22
Media Library /wp-admin/upload.php3.27 ▲0.0435.47 ▲3.89

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 43 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for ELEX WooCommerce DHL Express Shipping Method
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.33 ▼0.291.74 ▲0.1644.58 ▲4.77
Dashboard /wp-admin2,189 ▲85.51 ▼0.2180.83 ▼20.9937.55 ▼6.60
Posts /wp-admin/edit.php2,100 ▼32.01 ▲0.0534.37 ▼0.8834.14 ▼1.23
Add New Post /wp-admin/post-new.php1,526 ▼023.11 ▼0.28660.78 ▲31.7552.10 ▼4.53
Media Library /wp-admin/upload.php1,400 ▼04.18 ▼0.03105.58 ▲7.1245.76 ▲0.04

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% 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)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/elex-woo-dhl-express-shipping/review_and_troubleshoot_notify/resources/logo.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/elex-woo-dhl-express-shipping/dhl_express/includes/html-wf-services.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/elex-woo-dhl-express-shipping/dhl_express/includes/settings/dhl_general_settings.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/elex-woo-dhl-express-shipping/dhl_express/includes/dhl-extra-fields-show.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/elex-woo-dhl-express-shipping/review_and_troubleshoot_notify/resources/review.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/elex-woo-dhl-express-shipping/dhl_express/includes/data-wf-default-values.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/elex-woo-dhl-express-shipping/elex-woo-dhl-express-shipping.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/elex-woo-dhl-express-shipping/review_and_troubleshoot_notify/resources/troubleshoot.php:59
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/elex-woo-dhl-express-shipping/dhl_express/includes/settings/dhl_rates_settings.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/elex-woo-dhl-express-shipping/dhl-deprecated-functions.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/elex-woo-dhl-express-shipping/dhl_express/includes/settings/dhl_premium.php:86

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Donate link: Invalid URI found ("")
You can take inspiration from this readme.txt

elex-woo-dhl-express-shipping/elex-woo-dhl-express-shipping.php 85% from 13 tests

The primary PHP file in "ELEX WooCommerce DHL Express Shipping Method" version 2.2.9 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.1" instead of "2.6.0")
  • 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 glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected18,353 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS21,711219,111
PO File42,0643,2995,793
PHP165031473,449

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity68.33
▷ Minimum class complexity1.00
▷ Maximum class complexity320.00
Average method complexity7.31
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods64
▷ Static methods00.00%
▷ Public methods5281.25%
▷ Protected methods00.00%
▷ Private methods1218.75%
Functions42
▷ Named functions42100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
16 PNG files occupy 1.20MB with 0.81MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dhl_express/resources/images/address_validation_2.png92.01KB25.03KB▼ 72.79%
dhl_express/resources/images/USPS.png86.83KB21.30KB▼ 75.47%
dhl_express/resources/images/Stamps.com.png145.14KB39.72KB▼ 72.64%
dhl_express/resources/images/delivery.png1.85KB1.13KB▼ 39.06%
dhl_express/resources/images/Australia%20Post.png70.21KB15.76KB▼ 77.55%