83% woo-nova-poshta-shipping

Code Review | Shipping via Nova Poshta for WooCommerce

WordPress plugin Shipping via Nova Poshta for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: woo-nova-poshta-s...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.2.3
  • WordPress version: 6.3.1
  • First release: Oct 28, 2019
  • Latest release: Oct 31, 2019
  • Number of updates: 6
  • Update frequency: every 2.3 days
  • Top authors: antonkutakov21 (66.67%)extrawest (50%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /982 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Server-side resources used by Shipping via Nova Poshta for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0245.12 ▼1.56
Dashboard /wp-admin3.31 ▲0.0163.00 ▲8.26
Posts /wp-admin/edit.php3.36 ▲0.0150.00 ▼5.99
Add New Post /wp-admin/post-new.php5.89 ▲0.0187.07 ▼20.27
Media Library /wp-admin/upload.php3.24 ▲0.0138.09 ▲0.20

Server storage [IO: ▲0.35MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 49 new files
Database: 3 new tables, 6 new options
New tables
wp_novaposhta_warehouses
wp_novaposhta_cities
wp_novaposhta_areas
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Shipping via Nova Poshta for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲1714.35 ▼0.051.86 ▲0.1344.59 ▲2.92
Dashboard /wp-admin2,212 ▲355.64 ▲0.0088.73 ▼1.7344.47 ▼0.34
Posts /wp-admin/edit.php2,115 ▲121.98 ▲0.0135.65 ▼2.3034.59 ▼1.22
Add New Post /wp-admin/post-new.php1,540 ▲1223.11 ▲0.11682.33 ▲78.9655.17 ▲3.45
Media Library /wp-admin/upload.php1,414 ▲174.18 ▼0.0296.87 ▼10.3844.71 ▼0.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% 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)
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-nova-poshta-shipping/app/woocommerce-extensions/wnps-wc-shipping.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WooNovaPoshtaShipping\\App\\BaseRender' not found in wp-content/plugins/woo-nova-poshta-shipping/app/renders/wnps-order-details-render-admin.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WooNovaPoshtaShipping\\App\\BaseController' not found in wp-content/plugins/woo-nova-poshta-shipping/app/controllers/wnps-get-shipping-fields.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WooNovaPoshtaShipping\\App\\BaseRender' not found in wp-content/plugins/woo-nova-poshta-shipping/app/renders/wnps-settings-render.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WooNovaPoshtaShipping\\App\\BaseModel' not found in wp-content/plugins/woo-nova-poshta-shipping/app/models/wnps-settings-model.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WooNovaPoshtaShipping\\App\\BaseController' not found in wp-content/plugins/woo-nova-poshta-shipping/app/controllers/wnps-settings.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WooNovaPoshtaShipping\\App\\BaseRender' not found in wp-content/plugins/woo-nova-poshta-shipping/app/renders/wnps-checkout-select-render.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WooNovaPoshtaShipping\\App\\BaseRender' not found in wp-content/plugins/woo-nova-poshta-shipping/app/renders/wnps-checkout-gmap-render.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WooNovaPoshtaShipping\\App\\BaseHelper' not found in wp-content/plugins/woo-nova-poshta-shipping/app/helpers/wnps-helper.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WooNovaPoshtaShipping\\App\\BaseRender' not found in wp-content/plugins/woo-nova-poshta-shipping/app/renders/wnps-order-details-render-frontend.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Donate link: Please fix this invalid url: "#"
You can look at the official readme.txt

woo-nova-poshta-shipping/nova-poshta-shipping.php 77% from 13 tests

"Shipping via Nova Poshta for WooCommerce" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("###")
  • Domain Path: The domain path must begin with a forward slash character ("/###")
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-nova-poshta-shipping.php" instead of "nova-poshta-shipping.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
There were no executable files found in this plugin2,316 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP313693451,551
JavaScript412136549
CSS3280194
JSON20022
Sass1010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity4.50
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.94
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes27.69%
Methods98
▷ Static methods66.12%
▷ Public methods9495.92%
▷ Protected methods00.00%
▷ Private methods44.08%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.11MB with 0.09MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) screenshot-1.png43.02KB0.00KB▼ 100.00%
(invalid) screenshot-2.png49.90KB0.00KB▼ 100.00%
(invalid) screenshot-3.png22.86KB0.00KB▼ 100.00%
assets/images/novaposhta-logo.png1.49KB1.04KB▼ 30.48%