88% via-delivery

Code Review | Via.Delivery: Shipping service for WooCommerce

WordPress plugin Via.Delivery: Shipping service for WooCommerce scored 88% from 54 tests.

About plugin

  • Plugin page: via-delivery
  • Plugin version: 1.0.12
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.6.0
  • WordPress version: 5.8.1
  • First release: Jan 20, 2021
  • Latest release: Feb 16, 2022
  • Number of updates: 22
  • Update frequency: every 18.1 days
  • Top authors: ipol (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 379 total downloads

Benchmarks

Plugin footprint Passed 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.00MB] [CPU: ▼175.73ms] Passed 4 tests

Server-side resources used by Via.Delivery: Shipping service for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0033.00 ▲5.47
Dashboard /wp-admin3.06 ▼0.0037.77 ▼6.37
Posts /wp-admin/edit.php3.11 ▲0.0139.72 ▲2.23
Add New Post /wp-admin/post-new.php5.42 ▼0.0176.53 ▼701.22
Media Library /wp-admin/upload.php3.01 ▲0.0028.18 ▲2.45

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 54 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Via.Delivery: Shipping service for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲6515.99 ▲0.3510.34 ▲5.5274.90 ▼2.03
Dashboard /wp-admin2,929 ▲366.09 ▼0.11114.97 ▼15.62165.41 ▼12.78
Posts /wp-admin/edit.php2,740 ▼03.23 ▲0.0165.30 ▲0.27140.65 ▼0.70
Add New Post /wp-admin/post-new.php3,807 ▲4618.81 ▼0.04424.33 ▼19.75160.08 ▼3.03
Media Library /wp-admin/upload.php1,752 ▼05.52 ▲0.01133.90 ▼10.98185.19 ▼5.87

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/via-delivery/views/backend/settings/tab-main.php
    • > /wp-content/plugins/via-delivery/views/backend/dashboard/dash-payment.php
    • > /wp-content/plugins/via-delivery/views/backend/dashboard/dash-shipments-per-day.php
    • > /wp-content/plugins/via-delivery/views/backend/dashboard/dash-cities.php
    • > /wp-content/plugins/via-delivery/views/backend/dashboard/dash-status.php
  • 32× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Ipol\\Woo\\ViaDelivery\\Api\\Provider\\ProviderInterface' not found in wp-content/plugins/via-delivery/includes/api/provider/base.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/via-delivery/views/backend/order/form.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/via-delivery/views/backend/dashboard/index.php:4
    • > PHP Notice
      Undefined variable: locale in wp-content/plugins/via-delivery/views/backend/dashboard/dash-status.php on line 40
    • > PHP Fatal error
      Uncaught Error: Interface 'Ipol\\Woo\\ViaDelivery\\Api\\Service\\ServiceInterface' not found in wp-content/plugins/via-delivery/includes/api/service/geocode.php:7
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/via-delivery/views/backend/dashboard/dash-shipments-per-day.php on line 34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/via-delivery/views/backend/dashboard/auth.php:1
    • > PHP Fatal error
      Uncaught Error: Interface 'Ipol\\Woo\\ViaDelivery\\Api\\Service\\ServiceInterface' not found in wp-content/plugins/via-delivery/includes/api/service/order.php:7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/via-delivery/views/backend/settings/tab-main.php on line 9
    • > PHP Fatal error
      Uncaught Error: Interface 'Ipol\\Woo\\ViaDelivery\\Api\\Service\\ServiceInterface' not found in wp-content/plugins/via-delivery/includes/api/service/pointlist.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Add an image for screenshot #1 (/assets/screenshot/settings-en.png)
Please take inspiration from this readme.txt

via-delivery/via-delivery.php 92% from 13 tests

"Via.Delivery: Shipping service for WooCommerce" version 1.0.12's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin3,162 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP395557292,620
JavaScript2642258
PO File297281248
CSS25036

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity7.11
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces9
Interfaces2
Traits0
Classes26
▷ Abstract classes27.69%
▷ Concrete classes2492.31%
▷ Final classes00.00%
Methods177
▷ Static methods6737.85%
▷ Public methods15386.44%
▷ Protected methods2212.43%
▷ Private methods21.13%
Functions10
▷ Named functions110.00%
▷ Anonymous functions990.00%
Constants10
▷ Global constants330.00%
▷ Class constants770.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.32MB with 0.16MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot/charts-en.png50.21KB22.21KB▼ 55.77%
assets/screenshot/settings-en.png54.94KB27.27KB▼ 50.36%
assets/screenshot/checkout-en.png219.05KB109.11KB▼ 50.19%