10% woo-postfinance-checkout

Code Review | PostFinance Checkout

WordPress plugin PostFinance Checkout scored10%from 54 tests.

About plugin

  • Plugin page: woo-postfinance-c...
  • Plugin version: 2.1.24
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: May 9, 2019
  • Latest release: Sep 26, 2023
  • Number of updates: 158
  • Update frequency: every 10.1 days
  • Top authors: customwebgmbh (100%)

Code review

54 tests

User reviews

24 reviews

Install metrics

1,000+ active /46,842 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Error in wp-content/plugins/woo-postfinance-checkout/includes/class-wc-postfinancecheckout-migration.php+86
    Uncaught Error: Call to undefined function wc_maybe_define_constant() in wp-content/plugins/woo-postfinance-checkout/includes/class-wc-postfinancecheckout-migration.php:86
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): WC_PostFinanceCheckout_Migration::install_db()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(693): do_action()

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

A check of server-side resources used by PostFinance Checkout
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0044.25 ▲4.02
Dashboard /wp-admin3.31 ▲0.0047.77 ▼0.21
Posts /wp-admin/edit.php3.36 ▲0.0045.09 ▼3.39
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.31 ▼5.58
Media Library /wp-admin/upload.php3.23 ▲0.0036.02 ▲2.90

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 504 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for PostFinance Checkout
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.42 ▼0.162.00 ▲0.2343.60 ▲1.61
Dashboard /wp-admin2,209 ▲215.04 ▼0.84105.92 ▲3.6042.57 ▼2.49
Posts /wp-admin/edit.php2,092 ▼02.04 ▼0.0235.54 ▼2.4532.67 ▼5.68
Add New Post /wp-admin/post-new.php1,533 ▼023.31 ▲0.24657.51 ▲38.5557.78 ▲4.15
Media Library /wp-admin/upload.php1,391 ▲34.22 ▼0.0396.40 ▼16.2544.43 ▲2.07

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
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
The following issues need your attention
  • 230× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'PostFinanceCheckout\\Sdk\\Model\\ModelInterface' not found in wp-content/plugins/woo-postfinance-checkout/postfinancecheckout-sdk/lib/Model/Transaction.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'PostFinanceCheckout\\Sdk\\Model\\ModelInterface' not found in wp-content/plugins/woo-postfinance-checkout/postfinancecheckout-sdk/lib/Model/PaymentTerminalConfigurationVersion.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'PostFinanceCheckout\\Sdk\\Model\\ModelInterface' not found in wp-content/plugins/woo-postfinance-checkout/postfinancecheckout-sdk/lib/Model/Address.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'PostFinanceCheckout\\Sdk\\Model\\ModelInterface' not found in wp-content/plugins/woo-postfinance-checkout/postfinancecheckout-sdk/lib/Model/Feature.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'PostFinanceCheckout\\Sdk\\Model\\ModelInterface' not found in wp-content/plugins/woo-postfinance-checkout/postfinancecheckout-sdk/lib/Model/AnalyticsQuery.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'PostFinanceCheckout\\Sdk\\Model\\AbstractHumanUserUpdate' not found in wp-content/plugins/woo-postfinance-checkout/postfinancecheckout-sdk/lib/Model/HumanUserCreate.php:33
    • > PHP Fatal error
      Uncaught Error: Interface 'PostFinanceCheckout\\Sdk\\Model\\ModelInterface' not found in wp-content/plugins/woo-postfinance-checkout/postfinancecheckout-sdk/lib/Model/Customer.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'PostFinanceCheckout\\Sdk\\Model\\ModelInterface' not found in wp-content/plugins/woo-postfinance-checkout/postfinancecheckout-sdk/lib/Model/LegalOrganizationForm.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'PostFinanceCheckout\\Sdk\\Model\\ModelInterface' not found in wp-content/plugins/woo-postfinance-checkout/postfinancecheckout-sdk/lib/Model/ChargeFlowLevelConfigurationType.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'PostFinanceCheckout\\Sdk\\Model\\ModelInterface' not found in wp-content/plugins/woo-postfinance-checkout/postfinancecheckout-sdk/lib/Model/EntityExportRequest.php:35

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

woo-postfinance-checkout/woocommerce-postfinancecheckout.php 85% from 13 tests

The principal PHP file in "PostFinance Checkout" v. 2.1.24 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-postfinance-checkout.php" instead of "woocommerce-postfinancecheckout.php")

Code Analysis 5% from 3 tests

File types 0% from 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
Please fix the following items
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/woo-postfinance-checkout/postfinancecheckout-sdk/lib/ca-bundle.crt
80,977 lines of code in 487 files:
LanguageFilesBlank linesComment linesLines of code
PHP46722,29880,93077,912
JavaScript7130561,005
CSS416625758
HTML110716
PO File1143158408
Markdown258099
JSON10034
XML11020
SVG24018
YAML1007

PHP code Passed 2 tests

An short overview of 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.31
Average class complexity18.76
▷ Minimum class complexity1.00
▷ Maximum class complexity198.00
Average method complexity2.01
▷ Minimum method complexity1.00
▷ Maximum method complexity71.00
Code structure
Namespaces5
Interfaces3
Traits0
Classes458
▷ Abstract classes51.09%
▷ Concrete classes45398.91%
▷ Final classes102.21%
Methods8,119
▷ Static methods1,35416.68%
▷ Public methods7,87897.03%
▷ Protected methods1752.16%
▷ Private methods660.81%
Functions5
▷ Named functions00.00%
▷ Anonymous functions5100.00%
Constants614
▷ Global constants101.63%
▷ Class constants60498.37%
▷ Public constants604100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.93MB with 0.61MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
docs/en/resource/order-void-woocommerce.png194.68KB55.25KB▼ 71.62%
docs/en/resource/order-capture-woocommerce.png194.65KB55.14KB▼ 71.67%
docs/en/resource/method.png67.82KB31.12KB▼ 54.12%
docs/en/resource/settings.png88.92KB37.60KB▼ 57.71%
docs/en/resource/order-refund-woocommerce2.png215.40KB61.02KB▼ 71.67%