78% bs-payone-woocommerce

Code Review | PAYONE WooCommerce

WordPress plugin PAYONE WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: bs-payone-woocomm...
  • Plugin version: 2.6.0
  • PHP compatiblity: 7.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-8.1.1
  • WordPress version: 6.3.1
  • First release: Oct 18, 2018
  • Latest release: Oct 4, 2023
  • Number of updates: 29
  • Update frequency: every 63.2 days
  • Top authors: bspayone (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

500+ active /6,890 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.49ms] Passed 4 tests

An overview of server-side resources used by PAYONE WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.42 ▼3.29
Dashboard /wp-admin3.31 ▲0.0147.99 ▼2.63
Posts /wp-admin/edit.php3.36 ▲0.0151.40 ▲0.03
Add New Post /wp-admin/post-new.php5.89 ▲0.0196.42 ▲1.31
Media Library /wp-admin/upload.php3.23 ▲0.0135.46 ▼0.05

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 164 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for PAYONE WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.62 ▼1.024.88 ▲3.0942.86 ▼5.01
Dashboard /wp-admin2,206 ▲185.88 ▲0.7995.79 ▼16.4842.85 ▼1.79
Posts /wp-admin/edit.php2,092 ▼02.02 ▲0.0039.42 ▼1.4734.76 ▼1.52
Add New Post /wp-admin/post-new.php1,514 ▼517.55 ▼5.57646.93 ▲40.0665.26 ▲6.38
Media Library /wp-admin/upload.php1,388 ▼34.38 ▲0.0394.82 ▼6.8444.93 ▼0.86

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 12× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/bs-payone-woocommerce/src/Payone/Admin/AddressChecks.php
    • > /wp-content/plugins/bs-payone-woocommerce/src/Payone/Admin/Option/AddressChecks.php
    • > /wp-content/plugins/bs-payone-woocommerce/src/Payone/Admin/Option/Helper.php
    • > /wp-content/plugins/bs-payone-woocommerce/src/Payone/Database/Migration.php
    • > /wp-content/plugins/bs-payone-woocommerce/src/Payone/Admin/Option/CreditCheck.php
    • > /wp-content/plugins/bs-payone-woocommerce/src/Payone/Admin/Option/Account.php
    • > /wp-content/plugins/bs-payone-woocommerce/src/Payone/Admin/CreditCheck.php
    • > /wp-content/plugins/bs-payone-woocommerce/src/Payone/Admin/TransactionLog.php
    • > /wp-content/plugins/bs-payone-woocommerce/views/gateway/common/checkout-form-fields.php
    • > /wp-content/plugins/bs-payone-woocommerce/payone-woocommerce-3.php
  • 118× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/bs-payone-woocommerce/views/admin/credit-check.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Payone\\Payone\\Api\\DataTransfer' not found in wp-content/plugins/bs-payone-woocommerce/src/Payone/Payone/Api/TransactionStatus.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Payone\\Gateway\\GatewayBase' not found in wp-content/plugins/bs-payone-woocommerce/src/Payone/Gateway/SepaDirectDebit.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Payone\\Transaction\\Base' not found in wp-content/plugins/bs-payone-woocommerce/src/Payone/Transaction/Trustly.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Payone\\Gateway\\RedirectGatewayBase' not found in wp-content/plugins/bs-payone-woocommerce/src/Payone/Gateway/RatepayBase.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Payone\\Gateway\\RedirectGatewayBase' not found in wp-content/plugins/bs-payone-woocommerce/src/Payone/Gateway/Ideal.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/bs-payone-woocommerce/views/gateway/klarna/invoice-payment-form.php:2
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/bs-payone-woocommerce/views/admin/transaction-log-single.php on line 2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/bs-payone-woocommerce/views/gateway/ideal/payment-form.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Payone\\Payone\\Api\\DataTransfer' not found in wp-content/plugins/bs-payone-woocommerce/src/Payone/Payone/Api/Response.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

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
2 plugin tags: woocommerce, payment

bs-payone-woocommerce/payone-woocommerce-3.php 92% from 13 tests

The main PHP file in "PAYONE WooCommerce" ver. 2.6.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("bs-payone-woocommerce.php" instead of "payone-woocommerce-3.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
Success! There were no dangerous files found in this plugin10,617 lines of code in 133 files:
LanguageFilesBlank linesComment linesLines of code
PHP1231,6761,9718,134
PO File41,0321,5722,260
SVG202122
CSS25070
JSON10026
Markdown1405

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity9.26
▷ Minimum class complexity1.00
▷ Maximum class complexity124.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces7
Interfaces1
Traits0
Classes90
▷ Abstract classes77.78%
▷ Concrete classes8392.22%
▷ Final classes00.00%
Methods581
▷ Static methods233.96%
▷ Public methods49785.54%
▷ Protected methods508.61%
▷ Private methods345.85%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants54
▷ Global constants47.41%
▷ Class constants5092.59%
▷ Public constants50100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
15 PNG files occupy 0.15MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-eps.png9.53KB4.86KB▼ 49.01%
assets/icon-giropay.png9.10KB4.11KB▼ 54.80%
assets/checkout-paypal-en.png4.99KB3.75KB▼ 24.94%
assets/checkout-paypal-de.png4.56KB3.31KB▼ 27.41%
assets/icon-paypal.png8.62KB4.79KB▼ 44.48%