74% woo-shipping-dpd-baltic

Code Review | DPD Baltic Shipping

WordPress plugin DPD Baltic Shipping scored74%from 54 tests.

About plugin

  • Plugin page: woo-shipping-dpd-...
  • Plugin version: 1.2.68
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3.0
  • WordPress version: 6.3.1
  • First release: May 6, 2019
  • Latest release: Nov 23, 2023
  • Number of updates: 48
  • Update frequency: every 34.7 days
  • Top authors: dpdbaltics (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /28,319 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.58MB] [CPU: ▲3.50ms] Passed 4 tests

Analyzing server-side resources used by DPD Baltic Shipping
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.20 ▲0.7466.54 ▲27.56
Dashboard /wp-admin3.93 ▲0.5973.95 ▲11.76
Posts /wp-admin/edit.php3.97 ▲0.6149.22 ▲1.33
Add New Post /wp-admin/post-new.php6.45 ▲0.5786.49 ▼6.04
Media Library /wp-admin/upload.php3.78 ▲0.5540.72 ▲6.96

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 59 new files
Database: 3 new tables, 7 new options
New tables
wp_dpd_barcodes
wp_dpd_terminals
wp_dpd_manifests
New WordPress options
can_compress_scripts
wc_shipping_dpd_baltic_db_version
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for DPD Baltic Shipping
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,635 ▼12714.42 ▲0.160.50 ▼1.1418.44 ▼24.18
Dashboard /wp-admin2,379 ▲2055.83 ▲0.2395.50 ▲3.4542.94 ▼0.68
Posts /wp-admin/edit.php2,292 ▲1922.30 ▲0.3442.36 ▲0.1335.27 ▼0.56
Add New Post /wp-admin/post-new.php1,705 ▲17923.55 ▲0.36672.92 ▲70.8272.40 ▲22.20
Media Library /wp-admin/upload.php1,592 ▲1924.43 ▲0.24101.29 ▼3.5343.71 ▼2.07

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_dpd_barcodes
    • wp_dpd_terminals
    • wp_dpd_manifests
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • wc_shipping_dpd_baltic_db_version
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please fix the following
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/woo-shipping-dpd-baltic/admin/class-dpd-same-day-parcels.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/woo-shipping-dpd-baltic/admin/partials/dpd-admin-collect-display.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/woo-shipping-dpd-baltic/admin/partials/dpd-admin-manifests-display.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/woo-shipping-dpd-baltic/admin/class-dpd-home-delivery.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/woo-shipping-dpd-baltic/admin/partials/dpd-admin-warehouses-display.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/woo-shipping-dpd-baltic/public/woocommerce/checkout/time-frames.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/woo-shipping-dpd-baltic/public/woocommerce/checkout/form-shipping-dpd-terminals.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/woo-shipping-dpd-baltic/admin/class-dpd-same-day-delivery.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/woo-shipping-dpd-baltic/admin/class-dpd-home-delivery-sat.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/woo-shipping-dpd-baltic/admin/class-dpd-parcels.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: woocommerce, dpd, parcels, shipping

woo-shipping-dpd-baltic/dpd.php 92% from 13 tests

The main file in "DPD Baltic Shipping" v. 1.2.68 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-shipping-dpd-baltic.php" instead of "dpd.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin7,523 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP289811,8155,138
JavaScript113296421,259
PO File34686901,115
Sass11010
CSS2041

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity45.20
▷ Minimum class complexity1.00
▷ Maximum class complexity196.00
Average method complexity4.85
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods161
▷ Static methods1710.56%
▷ Public methods13583.85%
▷ Protected methods00.00%
▷ Private methods2616.15%
Functions14
▷ Named functions750.00%
▷ Anonymous functions750.00%
Constants11
▷ Global constants436.36%
▷ Class constants763.64%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/m4.png5.57KB4.23KB▼ 24.08%
public/images/m2.png3.18KB2.36KB▼ 25.77%
public/images/m3.png3.86KB3.06KB▼ 20.80%
public/images/m5.png6.68KB5.10KB▼ 23.66%
public/images/point.png3.78KB1.90KB▼ 49.63%