83% wc-unzer-direct

Code Review | Unzer Direct for WooCommerce

WordPress plugin Unzer Direct for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: wc-unzer-direct
  • Plugin version: 1.4.4
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.9
  • WordPress version: 6.3.1
  • First release: Feb 25, 2021
  • Latest release: May 25, 2022
  • Number of updates: 15
  • Update frequency: every 30.3 days
  • Top authors: PerfectSolution (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,913 total downloads

Benchmarks

Plugin footprint 82% 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.20MB] [CPU: ▼6.23ms] Passed 4 tests

A check of server-side resources used by Unzer Direct for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2040.16 ▼1.92
Dashboard /wp-admin3.50 ▲0.2049.33 ▲1.42
Posts /wp-admin/edit.php3.62 ▲0.2646.87 ▼5.65
Add New Post /wp-admin/post-new.php6.09 ▲0.2082.52 ▼18.75
Media Library /wp-admin/upload.php3.43 ▲0.2035.40 ▲2.46

Server storage [IO: ▲0.46MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • You have illegally modified 1 file (0.00KB) outside of "wp-content/plugins/wc-unzer-direct/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/wc-unzer-direct/assets/icon-128\303\227128.png"
Filesystem: 69 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Unzer Direct for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲4814.35 ▼0.011.69 ▲0.0544.25 ▼6.82
Dashboard /wp-admin2,203 ▲265.65 ▲0.0294.91 ▲6.9049.50 ▲11.48
Posts /wp-admin/edit.php2,105 ▲51.97 ▼0.0434.24 ▲1.0833.39 ▼4.89
Add New Post /wp-admin/post-new.php1,531 ▲523.20 ▼0.42677.01 ▲8.0150.77 ▲0.26
Media Library /wp-admin/upload.php1,405 ▲54.28 ▲0.10107.18 ▼1.7445.44 ▼0.13

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 22× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_UnzerDirect_Instance' not found in wp-content/plugins/wc-unzer-direct/classes/instances/apple-pay.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_UnzerDirect_Module' not found in wp-content/plugins/wc-unzer-direct/classes/modules/wc-unzer-direct-orders.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Email' not found in wp-content/plugins/wc-unzer-direct/classes/emails/wc-unzer-direct-payment-link-email.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_UnzerDirect' not found in wp-content/plugins/wc-unzer-direct/classes/instances/instance.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Order' not found in wp-content/plugins/wc-unzer-direct/classes/wc-unzer-direct-order.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WC_UnzerDirect_Instance' not found in wp-content/plugins/wc-unzer-direct/classes/instances/unzer-direct-invoice.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wc-unzer-direct/extensions/wpml.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WC_UnzerDirect_Instance' not found in wp-content/plugins/wc-unzer-direct/classes/instances/google-pay.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_UnzerDirect_Module' not found in wp-content/plugins/wc-unzer-direct/classes/modules/wc-unzer-direct-subscriptions.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WC_UnzerDirect_Instance' not found in wp-content/plugins/wc-unzer-direct/classes/instances/sofort.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt might help

wc-unzer-direct/wc-unzer-direct.php 92% from 13 tests

The main file in "Unzer Direct for WooCommerce" v. 1.4.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0.0" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected4,329 lines of code in 60 files:
LanguageFilesBlank linesComment linesLines of code
PHP451,1012,4603,799
CSS1400218
JavaScript3323207
SVG100096
XML1009

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity14.18
▷ Minimum class complexity1.00
▷ Maximum class complexity140.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes34
▷ Abstract classes12.94%
▷ Concrete classes3397.06%
▷ Final classes00.00%
Methods277
▷ Static methods7527.08%
▷ Public methods26294.58%
▷ Protected methods72.53%
▷ Private methods82.89%
Functions26
▷ Named functions2388.46%
▷ Anonymous functions311.54%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.11MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/refresh.png3.75KB2.06KB▼ 45.03%
assets/images/icons/ok.png3.83KB2.20KB▼ 42.57%
assets/banner-1544x500.png69.21KB73.08KB0.00%
assets/icon-128×128.png7.33KB3.18KB▼ 56.58%
assets/images/icons/error.png3.29KB2.08KB▼ 36.84%