89% klarna-order-management-for-woocommerce

Code Review | Klarna Order Management for WooCommerce

WordPress plugin Klarna Order Management for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: klarna-order-mana...
  • Plugin version: 1.8.3
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 12, 2017
  • Latest release: Oct 10, 2023
  • Number of updates: 64
  • Update frequency: every 33.3 days
  • Top authors: klarna (96.88%)michaelbengtsson (4.69%)

Code review

54 tests

User reviews

1 review

Install metrics

30,000+ active /433,187 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.39MB] [CPU: ▼0.40ms] Passed 4 tests

Server-side resources used by Klarna Order Management for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4338.04 ▲2.04
Dashboard /wp-admin3.73 ▲0.4248.61 ▲2.42
Posts /wp-admin/edit.php3.78 ▲0.4246.29 ▲0.95
Add New Post /wp-admin/post-new.php6.25 ▲0.3681.40 ▼7.01
Media Library /wp-admin/upload.php3.59 ▲0.3635.55 ▲2.91

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Klarna Order Management for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.171.73 ▲0.1237.22 ▼6.99
Dashboard /wp-admin2,198 ▲215.58 ▲0.0585.40 ▼1.1940.96 ▲2.12
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0333.82 ▼2.1334.08 ▼3.30
Add New Post /wp-admin/post-new.php1,526 ▼823.23 ▲4.74675.61 ▲42.4654.07 ▼14.80
Media Library /wp-admin/upload.php1,400 ▼04.24 ▲0.03137.08 ▲34.3162.75 ▲18.48

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: woocommerce, klarna

klarna-order-management-for-woocommerce/klarna-order-management-for-woocommerce.php 85% from 13 tests

The primary PHP file in "Klarna Order Management for WooCommerce" version 1.8.3 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "5.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected1,700 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP173571,0181,695
JSON1005

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity18.38
▷ Minimum class complexity1.00
▷ Maximum class complexity56.00
Average method complexity3.73
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes425.00%
▷ Concrete classes1275.00%
▷ Final classes00.00%
Methods102
▷ Static methods1413.73%
▷ Public methods6967.65%
▷ Protected methods2524.51%
▷ Private methods87.84%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin