77% wirecard-woocommerce-extension

Code Review | Wirecard WooCommerce Extension

WordPress plugin Wirecard WooCommerce Extension scored77%from 54 tests.

About plugin

  • Plugin page: wirecard-woocomme...
  • Plugin version: 3.3.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.4-5.4.2
  • WordPress version: 6.3.1
  • First release: Jul 17, 2018
  • Latest release: Aug 3, 2020
  • Number of updates: 73
  • Update frequency: every 10.3 days
  • Top authors: wirecard (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /11,304 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

A check of server-side resources used by Wirecard WooCommerce Extension
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.94 ▲2.60
Dashboard /wp-admin3.31 ▲0.0044.68 ▼3.03
Posts /wp-admin/edit.php3.36 ▲0.0044.28 ▼4.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.35 ▼0.57
Media Library /wp-admin/upload.php3.23 ▲0.0036.21 ▲1.93

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 886 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Wirecard WooCommerce Extension
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▼0.281.71 ▼0.1345.02 ▲2.95
Dashboard /wp-admin2,209 ▲175.85 ▲0.8697.07 ▼14.2041.68 ▼7.70
Posts /wp-admin/edit.php2,092 ▲32.04 ▲0.0436.11 ▼4.6732.20 ▼3.32
Add New Post /wp-admin/post-new.php1,537 ▲423.34 ▼0.02678.23 ▼18.5261.54 ▲8.47
Media Library /wp-admin/upload.php1,388 ▼04.20 ▲0.0492.82 ▼11.7441.52 ▼5.94

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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 everything seems fine, this is not 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
Please take a closer look at the following
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wirecard-woocommerce-extension/vendor/whichbrowser/parser/bin/update-profiles.php
    • > /wp-content/plugins/wirecard-woocommerce-extension/vendor/whichbrowser/parser/bin/update-chrome.php
    • > /wp-content/plugins/wirecard-woocommerce-extension/vendor/whichbrowser/parser/bin/update-browser-ids.php
    • > /wp-content/plugins/wirecard-woocommerce-extension/vendor/wirecard/extension-credentials-module/example/example_with_facade.php
  • 419× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/wirecard-woocommerce-extension/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Wirecard\\PaymentSdk\\Response\\ResponseDataInterface' not found in wp-content/plugins/wirecard-woocommerce-extension/vendor/wirecard/payment-sdk-php/src/Response/XmlResponseData.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\GroupHandler' not found in wp-content/plugins/wirecard-woocommerce-extension/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Formatter\\FormatterInterface' not found in wp-content/plugins/wirecard-woocommerce-extension/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\TaskQueueInterface' not found in wp-content/plugins/wirecard-woocommerce-extension/vendor/guzzlehttp/promises/src/TaskQueue.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/wirecard-woocommerce-extension/vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Wirecard\\PaymentSdk\\Response\\Response' not found in wp-content/plugins/wirecard-woocommerce-extension/vendor/wirecard/payment-sdk-php/src/Response/InteractionResponse.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wirecard-woocommerce-extension/vendor/guzzlehttp/psr7/src/NoSeekStream.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wirecard-woocommerce-extension/vendor/guzzlehttp/psr7/src/BufferStream.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Message\\Encoding\\FilteredStream' not found in wp-content/plugins/wirecard-woocommerce-extension/vendor/php-http/message/src/Encoding/GzipDecodeStream.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% 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
Attributes that need to be fixed:
  • Tags: There are too many tags (23 tag instead of maximum 10)
The official readme.txt is a good inspiration

wirecard-woocommerce-extension/woocommerce-wirecard-payment-gateway.php 77% from 13 tests

The main PHP script in "Wirecard WooCommerce Extension" version 3.3.4 is automatically included on every request by WordPress
The following require your attention:
  • Git Repository: Please remove the Git repository from this plugin
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0.3" instead of "3.3.4")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wirecard-woocommerce-extension.php" instead of "woocommerce-wirecard-payment-gateway.php")

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected110,046 lines of code in 816 files:
LanguageFilesBlank linesComment linesLines of code
PHP69112,81225,26093,985
PO File123,4046,5766,000
Markdown442,21605,427
JSON371003,449
JavaScript377315478
YAML123721242
XML10114220
CSS32419167
XSD14055
Dockerfile18010
make1409
Bourne Shell1104

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 107)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity11.27
▷ Minimum class complexity1.00
▷ Maximum class complexity479.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity107.00
Code structure
Namespaces90
Interfaces58
Traits41
Classes501
▷ Abstract classes173.39%
▷ Concrete classes48496.61%
▷ Final classes8216.94%
Methods3,323
▷ Static methods2507.52%
▷ Public methods2,48174.66%
▷ Protected methods3019.06%
▷ Private methods54116.28%
Functions394
▷ Named functions13835.03%
▷ Anonymous functions25664.97%
Constants614
▷ Global constants538.63%
▷ Class constants56191.37%
▷ Public constants561100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
12 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/ideal.png2.45KB1.48KB▼ 39.75%
assets/images/invoice.png1.00KB0.98KB▼ 2.15%
assets/images/sofortbanking.png1.60KB0.68KB▼ 57.68%
assets/images/masterpass.png2.13KB1.56KB▼ 27.03%
assets/images/paypal.png2.76KB2.02KB▼ 26.80%