77% wc-nova-poshta-for-shop

Code Review | Shipping of Nova Poshta for WooCommerce

WordPress plugin Shipping of Nova Poshta for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: wc-nova-poshta-fo...
  • Plugin version: 1.1.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 18, 2020
  • Latest release: Aug 31, 2023
  • Number of updates: 33
  • Update frequency: every 31.8 days
  • Top authors: protport4991 (96.97%)Otto42 (6.06%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,294 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: ▼0.80ms] Passed 4 tests

Server-side resources used by Shipping of Nova Poshta for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.17 ▼5.01
Dashboard /wp-admin3.35 ▲0.0550.53 ▲2.71
Posts /wp-admin/edit.php3.46 ▲0.1153.54 ▲8.79
Add New Post /wp-admin/post-new.php5.93 ▲0.0488.42 ▼2.73
Media Library /wp-admin/upload.php3.25 ▲0.0336.20 ▲1.81
Setting for NovaPoshta /wp-admin/admin.php?page=npw_submenu-page3.3146.90

Server storage [IO: ▲0.12MB] [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: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Shipping of Nova Poshta for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,070 ▲33515.18 ▲0.798.01 ▲6.3238.84 ▼11.58
Dashboard /wp-admin2,353 ▲1656.31 ▲1.39131.86 ▲16.3841.05 ▼1.06
Posts /wp-admin/edit.php2,262 ▲1733.33 ▲1.3349.94 ▲13.2030.54 ▼5.78
Add New Post /wp-admin/post-new.php1,518 ▼1517.67 ▼5.45627.65 ▼46.4535.95 ▼18.29
Media Library /wp-admin/upload.php1,392 ▲14.18 ▼0.1193.49 ▼10.4940.70 ▼2.66
Setting for NovaPoshta /wp-admin/admin.php?page=npw_submenu-page1,0433.0740.9229.01

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-nova-poshta-for-shop/includes/enqueue-admin.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-nova-poshta-for-shop/includes/enqueue-front.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'NPFW_Parser' not found in wp-content/plugins/wc-nova-poshta-for-shop/Classes/NovaPoshtaAdapter.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-nova-poshta-for-shop/Classes/CheckoutField.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wc-nova-poshta-for-shop/Classes/Shortcode.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wc-nova-poshta-for-shop/views/settings.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=npw_submenu-page
    • > Network (severe)
    wp-content/plugins/wc-nova-poshta-for-shop/assets_file/js/admin_custom.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=npw_submenu-page
    • > Network (severe)
    wp-content/plugins/wc-nova-poshta-for-shop/assets_file/img/general-settings_black.svg - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Screenshots: These screenshots need descriptions #1, #2 in wc-nova-poshta-for-shop/assets to your readme.txt
You can take inspiration from this readme.txt

wc-nova-poshta-for-shop/nova_poshta_for_woocommerce.php 85% from 13 tests

The main PHP file in "Shipping of Nova Poshta for WooCommerce" ver. 1.1.4 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("wc-nova-poshta-for-shop.php" instead of "nova_poshta_for_woocommerce.php")

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 plugin848 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP1213157425
CSS4911213
JavaScript22323109
PO File23440101

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity4.29
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods19
▷ Static methods15.26%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin