84% visma-pay-payment-gateway

Code Review | Visma Pay for Woocommerce

WordPress plugin Visma Pay for Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: visma-pay-payment...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 20, 2021
  • Latest release: Oct 4, 2023
  • Number of updates: 20
  • Update frequency: every 49.6 days
  • Top authors: hsuvant (100%)

Code review

54 tests

User reviews

1 review

Install metrics

2,000+ active /17,706 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼9.22ms] Passed 4 tests

This is a short check of server-side resources used by Visma Pay for Woocommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.58 ▼4.07
Dashboard /wp-admin3.31 ▼0.0345.51 ▼16.01
Posts /wp-admin/edit.php3.43 ▲0.0747.36 ▼0.53
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.30 ▼16.27
Media Library /wp-admin/upload.php3.24 ▲0.0138.45 ▲5.55

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 45 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Visma Pay for Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.34 ▼0.971.82 ▲0.0638.99 ▼4.52
Dashboard /wp-admin2,209 ▲214.87 ▼1.03100.71 ▼12.1237.52 ▼9.01
Posts /wp-admin/edit.php2,089 ▲211.99 ▼0.0241.60 ▲3.4135.82 ▼2.51
Add New Post /wp-admin/post-new.php1,533 ▲1923.44 ▲5.78681.34 ▼11.6855.79 ▲1.53
Media Library /wp-admin/upload.php1,388 ▲34.28 ▲0.0995.33 ▼8.1339.52 ▼5.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Blocks\\Payments\\Integrations\\AbstractPaymentMethodType' not found in wp-content/plugins/visma-pay-payment-gateway/includes/blocks/visma_pay_blocks_support.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Visma\\VismaPayConnector' not found in wp-content/plugins/visma-pay-payment-gateway/includes/lib/Visma/VismaPayWPConnector.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid url: ""
You can look at the official readme.txt

visma-pay-payment-gateway/visma-pay-payment-gateway.php 92% from 13 tests

The primary PHP file in "Visma Pay for Woocommerce" version 1.1.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("3.3" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected1,650 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP8198291,261
PO File19698286
CSS17172
JavaScript22021
XML1009
JSON1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity34.33
▷ Minimum class complexity1.00
▷ Maximum class complexity180.00
Average method complexity5.55
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods45
▷ Static methods24.44%
▷ Public methods4191.11%
▷ Protected methods48.89%
▷ Private methods00.00%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
28 PNG files occupy 0.19MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/handelsbanken.png3.47KB1.72KB▼ 50.39%
assets/images/spankki.png12.20KB1.84KB▼ 84.92%
assets/images/fellowfinance_big.png14.81KB6.39KB▼ 56.85%
assets/images/joustoraha.png4.36KB2.18KB▼ 50.06%
assets/images/fellowfinance.png3.22KB1.74KB▼ 45.78%