78% zahls-ch-payment-gateway

Code Review | zahls.ch Credit Cards, PostFinance and TWINT for WooCommerce

WordPress plugin zahls.ch Credit Cards, PostFinance and TWINT for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: zahls-ch-payment-...
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Oct 22, 2020
  • Latest release: Oct 25, 2023
  • Number of updates: 31
  • Update frequency: every 35.5 days
  • Top authors: ivanlouis (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

2,000+ active /22,605 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼7.51ms] Passed 4 tests

A check of server-side resources used by zahls.ch Credit Cards, PostFinance and TWINT for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0840.45 ▲2.80
Dashboard /wp-admin3.38 ▲0.0447.46 ▼12.29
Posts /wp-admin/edit.php3.50 ▲0.1445.83 ▼2.66
Add New Post /wp-admin/post-new.php5.96 ▲0.0880.39 ▼11.86
Media Library /wp-admin/upload.php3.31 ▲0.0835.46 ▼3.24

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

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

Browser metrics Passed 4 tests

Checking browser requirements for zahls.ch Credit Cards, PostFinance and TWINT for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.33 ▼0.031.73 ▲0.0943.95 ▲0.92
Dashboard /wp-admin2,198 ▲215.65 ▲0.0793.44 ▲9.4442.61 ▲2.78
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0232.88 ▼3.6833.83 ▼2.58
Add New Post /wp-admin/post-new.php1,526 ▼023.54 ▲0.13684.36 ▲1.3160.92 ▲3.22
Media Library /wp-admin/upload.php1,397 ▼04.27 ▲0.1096.09 ▼5.1242.90 ▼2.11

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 37× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/examples/QrCodeDelete.php
    • > /wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/examples/PageGetAll.php
    • > /wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/examples/TransactionGetAll.php
    • > /wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/examples/TransactionGetOne.php
    • > /wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/examples/InvoiceGetOne.php
    • > /wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/examples/PaymentMethodGetAll.php
    • > /wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/examples/GatewayCreate.php
    • > /wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/examples/PaymentProviderGetAll.php
    • > /wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/examples/PageGetOne.php
    • > /wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/examples/DesignDelete.php
  • 32× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Zahls\\Models\\Request\\Transaction' not found in wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/lib/Zahls/Models/Response/Transaction.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Zahls\\Models\\Base' not found in wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/lib/Zahls/Models/Request/PaymentMethod.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Zahls\\Models\\Base' not found in wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/lib/Zahls/Models/Request/Invoice.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Zahls\\Models\\Request\\QrCodeScan' not found in wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/lib/Zahls/Models/Response/QrCodeScan.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Zahls\\Models\\Request\\PaymentProvider' not found in wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/lib/Zahls/Models/Response/PaymentProvider.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/zahls-ch-payment-gateway/includes/settings-zahls.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Zahls\\Models\\Base' not found in wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/lib/Zahls/Models/Request/PaymentProvider.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Zahls\\Models\\Base' not found in wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/lib/Zahls/Models/Request/Payout.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Zahls\\Models\\Request\\QrCode' not found in wp-content/plugins/zahls-ch-payment-gateway/zahls-php-master/lib/Zahls/Models/Response/QrCode.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Blocks\\Payments\\Integrations\\AbstractPaymentMethodType' not found in wp-content/plugins/zahls-ch-payment-gateway/includes/blocks-checkout.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 32 tag instead of maximum 10
You can look at the official readme.txt

zahls-ch-payment-gateway/woo-zahls-gateway.php 92% from 13 tests

The primary PHP file in "zahls.ch Credit Cards, PostFinance and TWINT for WooCommerce" version 2.0.2 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("zahls-ch-payment-gateway.php" instead of "woo-zahls-gateway.php")

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
There were no executable files found in this plugin6,969 lines of code in 151 files:
LanguageFilesBlank linesComment linesLines of code
PHP791,1292,5644,097
SVG7010472,788
Markdown117059
JSON10025

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity5.68
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity1.41
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces9
Interfaces0
Traits0
Classes41
▷ Abstract classes24.88%
▷ Concrete classes3995.12%
▷ Final classes12.56%
Methods450
▷ Static methods71.56%
▷ Public methods43396.22%
▷ Protected methods71.56%
▷ Private methods102.22%
Functions44
▷ Named functions49.09%
▷ Anonymous functions4090.91%
Constants41
▷ Global constants512.20%
▷ Class constants3687.80%
▷ Public constants36100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
zahls-php-master/examples/zahls-logo.png10.55KB6.51KB▼ 38.30%