68% nova-poshta-ttn

Code Review | Shipping for Nova Poshta

WordPress plugin Shipping for Nova Poshta scored68%from 54 tests.

About plugin

  • Plugin page: nova-poshta-ttn
  • Plugin version: 1.18.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.3
  • WordPress version: 6.3.1
  • First release: Sep 10, 2018
  • Latest release: Nov 18, 2023
  • Number of updates: 248
  • Update frequency: every 7.7 days
  • Top authors: bandido (100%)

Code review

54 tests

User reviews

28 reviews

Install metrics

200+ active /22,153 total downloads

Benchmarks

Plugin footprint 65% 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.06MB] [CPU: ▼11.29ms] Passed 4 tests

Server-side resources used by Shipping for Nova Poshta
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.10 ▲0.6341.94 ▲0.55
Dashboard /wp-admin3.93 ▲0.6350.05 ▲0.86
Posts /wp-admin/edit.php3.98 ▲0.6350.27 ▲5.37
Add New Post /wp-admin/post-new.php3.75 ▼2.1337.89 ▼49.25
Media Library /wp-admin/upload.php3.86 ▲0.6336.89 ▲2.67

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 358 new files
Database: 4 new tables, 7 new options
New tables
wp_nova_poshta_city
wp_novaposhta_ttn_invoices
wp_nova_poshta_region
wp_nova_poshta_warehouse
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
mrkv_nova_poshta_free_version

Browser metrics Passed 4 tests

An overview of browser requirements for Shipping for Nova Poshta
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲9514.14 ▼0.571.75 ▲0.0439.07 ▼7.60
Dashboard /wp-admin2,265 ▲855.68 ▲0.0288.51 ▼11.4786.74 ▲41.85
Posts /wp-admin/edit.php2,174 ▲772.09 ▲0.1435.33 ▼1.7233.53 ▼6.23
Add New Post /wp-admin/post-new.php1,611 ▲8524.19 ▲1.12677.71 ▲42.5545.20 ▼14.67
Media Library /wp-admin/upload.php1,467 ▲644.13 ▼0.0097.42 ▲1.9080.19 ▲36.22

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie tables detected upon uninstall: 3 tables
    • wp_nova_poshta_city
    • wp_nova_poshta_warehouse
    • wp_nova_poshta_region
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • mrkv_nova_poshta_free_version
    • db_upgraded

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Please take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/nova-poshta-ttn/admin/partials/morkvanp-plugin-admin-display.php
    • > /wp-content/plugins/nova-poshta-ttn/admin/partials/plugin-name-admin-display.php
  • 206× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function showFormBlockTitle() on null in wp-content/plugins/nova-poshta-ttn/public/partials/invoice/view/invoice_sender.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/nova-poshta-ttn/vendor/monolog/monolog/tests/Monolog/Processor/PsrLogMessageProcessorTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/nova-poshta-ttn/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/nova-poshta-ttn/vendor/monolog/monolog/tests/Monolog/Processor/GitProcessorTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/nova-poshta-ttn/vendor/monolog/monolog/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/nova-poshta-ttn/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/nova-poshta-ttn/vendor/monolog/monolog/tests/Monolog/Processor/MemoryUsageProcessorTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/nova-poshta-ttn/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/nova-poshta-ttn/vendor/monolog/monolog/tests/Monolog/Formatter/ScalarFormatterTest.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Handler\\FingersCrossed\\ActivationStrategyInterface' not found in wp-content/plugins/nova-poshta-ttn/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: nova poshta, nova post

nova-poshta-ttn/nova-poshta-ttn.php 92% from 13 tests

"Shipping for Nova Poshta" version 1.18.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "3.8")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin31,362 lines of code in 297 files:
LanguageFilesBlank linesComment linesLines of code
PHP2545,0039,82824,896
JavaScript153591982,565
CSS1075692,317
Markdown102450998
JSON400317
PO File29096249
XML13016
SVG1004

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity8.55
▷ Minimum class complexity1.00
▷ Maximum class complexity170.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces18
Interfaces5
Traits2
Classes246
▷ Abstract classes104.07%
▷ Concrete classes23695.93%
▷ Final classes00.00%
Methods1,773
▷ Static methods945.30%
▷ Public methods1,39878.85%
▷ Protected methods24113.59%
▷ Private methods1347.56%
Functions124
▷ Named functions4435.48%
▷ Anonymous functions8064.52%
Constants101
▷ Global constants1211.88%
▷ Class constants8988.12%
▷ Public constants89100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
35 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/partials/img/001-shopping-bag.png0.32KB0.32KB0.00%
includes/img/003-barcode.png0.26KB0.26KB0.00%
public/partials/img/003-shopping-cart-1.png0.33KB0.33KB0.29%
includes/nova_poshta_grey_25px.png0.37KB0.37KB0.00%
public/partials/img/006-user-1.png0.34KB0.34KB0.00%