83% zaver-checkout-for-woocommerce

Code Review | Zaver Checkout for WooCommerce

WordPress plugin Zaver Checkout for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: zaver-checkout-fo...
  • Plugin version: 1.0.18
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.0-5.9.2
  • WordPress version: 6.3.1
  • First release: Apr 4, 2022
  • Latest release: Apr 7, 2022
  • Number of updates: 5
  • Update frequency: every 1.4 days
  • Top authors: zaverio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /496 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.16MB] [CPU: ▼5.50ms] Passed 4 tests

An overview of server-side resources used by Zaver Checkout for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1738.99 ▼8.44
Dashboard /wp-admin3.46 ▲0.1650.50 ▲0.15
Posts /wp-admin/edit.php3.58 ▲0.2250.16 ▲0.68
Add New Post /wp-admin/post-new.php6.05 ▲0.1691.69 ▼14.38
Media Library /wp-admin/upload.php3.39 ▲0.1638.22 ▲2.04

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 195 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Zaver Checkout for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.19 ▼1.124.93 ▲2.9344.44 ▲0.77
Dashboard /wp-admin2,209 ▲174.83 ▼0.07114.87 ▲6.4738.13 ▼6.49
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0140.06 ▼4.4734.93 ▲4.37
Add New Post /wp-admin/post-new.php1,534 ▲1323.21 ▼0.12645.90 ▼21.9351.69 ▲3.17
Media Library /wp-admin/upload.php1,382 ▼04.17 ▼0.0195.80 ▼0.4642.17 ▲1.78

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

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 64× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/zaver-checkout-for-woocommerce/classes/checkout-gateway.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/zaver-checkout-for-woocommerce/vendor/guzzlehttp/psr7/src/DroppingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Client\\ClientExceptionInterface' not found in wp-content/plugins/zaver-checkout-for-woocommerce/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/zaver-checkout-for-woocommerce/vendor/guzzlehttp/promises/src/RejectedPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Client\\ClientExceptionInterface' not found in wp-content/plugins/zaver-checkout-for-woocommerce/vendor/psr/http-client/src/NetworkExceptionInterface.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/zaver-checkout-for-woocommerce/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/zaver-checkout-for-woocommerce/vendor/guzzlehttp/psr7/src/NoSeekStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/zaver-checkout-for-woocommerce/vendor/guzzlehttp/guzzle/src/Pool.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\TaskQueueInterface' not found in wp-content/plugins/zaver-checkout-for-woocommerce/vendor/guzzlehttp/promises/src/TaskQueue.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Zaver\\SDK\\Utils\\DataObject' not found in wp-content/plugins/zaver-checkout-for-woocommerce/vendor/zaver/sdk/src/Object/PaymentStatusResponse.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: zaver, refund, swish, checkout, woocommerce...

zaver-checkout-for-woocommerce/woocommerce-zaver-checkout.php 77% from 13 tests

The main PHP script in "Zaver Checkout for WooCommerce" version 1.0.18 is automatically included on every request by WordPress
It is important to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.7" instead of "6.0.0")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("zaver-checkout-for-woocommerce.php" instead of "woocommerce-zaver-checkout.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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 detected16,332 lines of code in 178 files:
LanguageFilesBlank linesComment linesLines of code
PHP1492,4386,25711,336
Markdown161,26603,714
JSON10001,132
PO File14242134
make1409
YAML1007

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity11.62
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces16
Interfaces26
Traits3
Classes107
▷ Abstract classes21.87%
▷ Concrete classes10598.13%
▷ Final classes3634.29%
Methods904
▷ Static methods16818.58%
▷ Public methods77085.18%
▷ Protected methods40.44%
▷ Private methods13014.38%
Functions123
▷ Named functions3427.64%
▷ Anonymous functions8972.36%
Constants98
▷ Global constants00.00%
▷ Class constants98100.00%
▷ Public constants8788.78%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin