84% oceanpayment-klarna-gateway

Code Review | Oceanpayment Klarna Gateway

WordPress plugin Oceanpayment Klarna Gateway scored 84% from 54 tests.

About plugin

  • Plugin page: oceanpayment-klar...
  • Plugin version: 6.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Dec 7, 2022
  • Latest release: Apr 28, 2023
  • Number of updates: 9
  • Update frequency: every 15.8 days
  • Top authors: oceanpayment (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 256 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

Analyzing server-side resources used by Oceanpayment Klarna Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.42 ▼1.73
Dashboard /wp-admin3.31 ▲0.0145.21 ▼5.77
Posts /wp-admin/edit.php3.36 ▲0.0047.38 ▼5.32
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.10 ▼27.07
Media Library /wp-admin/upload.php3.23 ▲0.0038.54 ▲1.49

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Oceanpayment Klarna Gateway
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.28 ▼1.081.72 ▼0.0539.80 ▼8.45
Dashboard /wp-admin2,206 ▲155.89 ▲0.97106.37 ▼0.1937.26 ▼3.24
Posts /wp-admin/edit.php2,089 ▼02.14 ▲0.0939.70 ▼1.6034.11 ▼0.25
Add New Post /wp-admin/post-new.php1,535 ▲223.31 ▲0.49663.14 ▲54.7658.83 ▲4.84
Media Library /wp-admin/upload.php1,388 ▼34.23 ▼0.0094.34 ▼7.2542.49 ▼0.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/oceanpayment-klarna-gateway/oceanklarna.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
1 plugin tags: payment

oceanpayment-klarna-gateway/oceanklarna.php 92% from 13 tests

The entry point to "Oceanpayment Klarna Gateway" version 6.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("oceanpayment-klarna-gateway.php" instead of "oceanklarna.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin601 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2143185601

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity68.00
▷ Minimum class complexity68.00
▷ Maximum class complexity68.00
Average method complexity4.72
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/op_klarna.png4.90KB1.69KB▼ 65.47%