83% resurs-bank-payments-for-woocommerce

Code Review | Resurs Bank Payments for WooCommerce

WordPress plugin Resurs Bank Payments for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: resurs-bank-payme...
  • Plugin version: 1.0.14
  • PHP compatiblity: 8.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 7.6.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 28, 2023
  • Latest release: Nov 29, 2023
  • Number of updates: 26
  • Update frequency: every 8.3 days
  • Top authors: RB-Tornevall (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /714 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

Analyzing server-side resources used by Resurs Bank Payments for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.42 ▼1.38
Dashboard /wp-admin3.31 ▲0.0046.68 ▼2.14
Posts /wp-admin/edit.php3.36 ▲0.0046.89 ▼4.97
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.29 ▼12.53
Media Library /wp-admin/upload.php3.23 ▲0.0034.90 ▼1.11

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 494 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Resurs Bank Payments for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.67 ▼0.041.81 ▲0.1639.59 ▼4.53
Dashboard /wp-admin2,198 ▲265.58 ▼0.1491.85 ▼25.4442.21 ▼2.22
Posts /wp-admin/edit.php2,103 ▼02.02 ▲0.0640.80 ▼0.8735.90 ▼6.41
Add New Post /wp-admin/post-new.php1,526 ▼023.16 ▼0.30658.71 ▲62.5052.90 ▲4.75
Media Library /wp-admin/upload.php1,400 ▼04.12 ▼0.0693.66 ▼4.0042.51 ▲0.40

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 407× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Parse error
      syntax error, unexpected 'Type' (T_STRING) in wp-content/plugins/resurs-bank-payments-for-woocommerce/lib/ecom/src/Lib/Model/PaymentMethod/ApplicationFormSpecResponse/ApplicationFormSpecElementResponse/Type.php on line 15
    • > PHP Parse error
      syntax error, unexpected 'public' (T_PUBLIC), expecting variable (T_VARIABLE) in wp-content/plugins/resurs-bank-payments-for-woocommerce/lib/ecom/src/Module/RcoCallback/Models/RegisterCallback/Request.php on line 20
    • > PHP Parse error
      syntax error, unexpected 'public' (T_PUBLIC), expecting variable (T_VARIABLE) in wp-content/plugins/resurs-bank-payments-for-woocommerce/lib/ecom/src/Module/Payment/Models/CreatePaymentRequest/Options/Callback.php on line 23
    • > PHP Parse error
      syntax error, unexpected ':', expecting ')' in wp-content/plugins/resurs-bank-payments-for-woocommerce/src/Util/Currency.php on line 29
    • > PHP Parse error
      syntax error, unexpected 'public' (T_PUBLIC), expecting variable (T_VARIABLE) in wp-content/plugins/resurs-bank-payments-for-woocommerce/lib/ecom/src/Lib/Model/Payment/Order.php on line 29
    • > PHP Parse error
      syntax error, unexpected ':', expecting ')' in wp-content/plugins/resurs-bank-payments-for-woocommerce/src/Settings/Api.php on line 40
    • > PHP Parse error
      syntax error, unexpected 'public' (T_PUBLIC), expecting variable (T_VARIABLE) in wp-content/plugins/resurs-bank-payments-for-woocommerce/lib/ecom/src/Module/Payment/Models/CreatePaymentRequest/Options.php on line 30
    • > PHP Parse error
      syntax error, unexpected ':', expecting ')' in wp-content/plugins/resurs-bank-payments-for-woocommerce/lib/ecom/src/Lib/Cache/AbstractCache.php on line 55
    • > PHP Parse error
      syntax error, unexpected ':', expecting ')' in wp-content/plugins/resurs-bank-payments-for-woocommerce/lib/ecom/tests/Integration/Module/PriceSignage/RepositoryTest.php on line 59
    • > PHP Parse error
      syntax error, unexpected 'public' (T_PUBLIC), expecting variable (T_VARIABLE) in wp-content/plugins/resurs-bank-payments-for-woocommerce/lib/ecom/src/Module/AnnuityFactor/Models/AnnuityInformationCollection.php on line 25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
The official readme.txt might help

resurs-bank-payments-for-woocommerce/init.php 85% from 13 tests

"Resurs Bank Payments for WooCommerce" version 1.0.14's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("resurs-bank-payments-for-woocommerce.php" instead of "init.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("6.0" instead of "7.6.0")

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
There were no executable files found in this plugin30,418 lines of code in 484 files:
LanguageFilesBlank linesComment linesLines of code
PHP4475,69713,22025,628
XML12501,745
JSON5001,436
Markdown31150568
CSS56418357
JavaScript552174286
Bourne Shell2539262
SVG401112
YAML11024

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity4.14
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.84
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces188
Interfaces4
Traits4
Classes408
▷ Abstract classes81.96%
▷ Concrete classes40098.04%
▷ Final classes143.50%
Methods1,527
▷ Static methods41827.37%
▷ Public methods1,19778.39%
▷ Protected methods563.67%
▷ Private methods27417.94%
Functions17
▷ Named functions423.53%
▷ Anonymous functions1376.47%
Constants64
▷ Global constants46.25%
▷ Class constants6093.75%
▷ Public constants4270.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/ecom/src/Module/PaymentMethod/Widget/Resources/Images/swish.png12.95KB5.35KB▼ 58.70%
lib/ecom/src/Module/PaymentMethod/Widget/Resources/Images/resurs.png15.42KB3.70KB▼ 76.01%