84% wpec-unzer

Code Review | Integrate Unzer Direct payment gateway with wp eCommerce

WordPress plugin Integrate Unzer Direct payment gateway with wp eCommerce scored84%from 54 tests.

About plugin

  • Plugin page: wpec-unzer
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.7.0
  • WordPress version: 6.3.1
  • First release: Apr 14, 2021
  • Latest release: May 17, 2022
  • Number of updates: 8
  • Update frequency: every 51.3 days
  • Top authors: PerfectSolution (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /400 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼5.04ms] Passed 4 tests

Analyzing server-side resources used by Integrate Unzer Direct payment gateway with wp eCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2539.68 ▲0.10
Dashboard /wp-admin3.57 ▲0.2644.83 ▼8.31
Posts /wp-admin/edit.php3.62 ▲0.2647.70 ▼1.37
Add New Post /wp-admin/post-new.php6.10 ▲0.2290.64 ▼10.59
Media Library /wp-admin/upload.php3.43 ▲0.2036.53 ▲1.86
Unzer logs /wp-admin/tools.php?page=wpec-unzer-logs3.4031.59

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 45 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Integrate Unzer Direct payment gateway with wp eCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲8013.25 ▼1.521.86 ▲0.2639.85 ▼7.09
Dashboard /wp-admin2,221 ▲305.90 ▲0.00105.42 ▲2.9341.54 ▲0.57
Posts /wp-admin/edit.php2,107 ▲152.03 ▲0.0141.56 ▼12.2534.59 ▼9.06
Add New Post /wp-admin/post-new.php1,542 ▼018.02 ▼0.31588.55 ▼26.9950.16 ▼4.04
Media Library /wp-admin/upload.php1,403 ▲124.18 ▼0.0597.20 ▲1.7340.70 ▼1.79
Unzer logs /wp-admin/tools.php?page=wpec-unzer-logs7982.0724.2423.23

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WPEC_Unzer_API' not found in wp-content/plugins/wpec-unzer/includes/classes/api/wpec-unzer-api-transaction.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wpec-unzer/vendor/quickpay/quickpay-php-client/Tests/api/ResponseTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wpec-unzer/vendor/quickpay/quickpay-php-client/Tests/api/ExceptionTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WPEC_Unzer_API_Transaction' not found in wp-content/plugins/wpec-unzer/includes/classes/api/wpec-unzer-api-payment.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpec-unzer/includes/functions.php:224
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wpec-unzer/wpec-unzer.php:104
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wpec-unzer/vendor/quickpay/quickpay-php-client/Tests/api/RequestTest.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% 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
You can look at the official readme.txt

wpec-unzer/wpec-unzer.php Passed 13 tests

The entry point to "Integrate Unzer Direct payment gateway with wp eCommerce" version 1.0.0 is a PHP file that has certain tags in its header comment area
70 characters long description:
Integrates your Unzer payment gateway into your WP e-Commerce webshop.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected1,769 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP263999971,376
Markdown2500121
JavaScript1162102
JSON20067
YAML26045
CSS13632
XML20126

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.95
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods109
▷ Static methods1412.84%
▷ Public methods10495.41%
▷ Protected methods32.75%
▷ Private methods21.83%
Functions11
▷ Named functions981.82%
▷ Anonymous functions218.18%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/banner-772x250.png30.13KB12.87KB▼ 57.28%