84% woo-payzen-payment

Code Review | PayZen for WooCommerce

WordPress plugin PayZen for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-payzen-payment
  • Plugin version: 1.11.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3
  • WordPress version: 6.3.1
  • First release: Apr 28, 2017
  • Latest release: Nov 7, 2023
  • Number of updates: 112
  • Update frequency: every 21.3 days
  • Top authors: lyradev31 (60.71%)lyranetwork (40.18%)

Code review

54 tests

User reviews

3 reviews

Install metrics

900+ active /17,762 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼8.27ms] Passed 4 tests

This is a short check of server-side resources used by PayZen for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.11 ▼0.83
Dashboard /wp-admin3.31 ▼0.0448.58 ▼21.78
Posts /wp-admin/edit.php3.36 ▲0.0049.30 ▼3.93
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.14 ▼6.54
Media Library /wp-admin/upload.php3.23 ▲0.0034.95 ▼0.40

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

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

Browser metrics Passed 4 tests

PayZen for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5314.33 ▼0.382.20 ▲0.5447.52 ▲3.20
Dashboard /wp-admin2,198 ▲245.61 ▲0.0288.83 ▼12.4939.70 ▼6.26
Posts /wp-admin/edit.php2,100 ▼32.01 ▲0.0039.47 ▲2.6136.34 ▲1.85
Add New Post /wp-admin/post-new.php1,527 ▲122.99 ▼0.32678.61 ▼36.3751.74 ▼4.68
Media Library /wp-admin/upload.php1,400 ▼04.22 ▲0.03107.07 ▲0.7747.24 ▲0.21

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Interface 'Lyranetwork\\Payzen\\Sdk\\Refund\\Processor' not found in wp-content/plugins/woo-payzen-payment/includes/PayzenRefundProcessor.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: A description for screenshot #6 is missing in woo-payzen-payment/assets to your readme.txt
  • Screenshots: Add an image for screenshot #1 (PayZen general configuration.)
The official readme.txt might help

woo-payzen-payment/woo-payzen-payment.php Passed 13 tests

"PayZen for WooCommerce" version 1.11.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
73 characters long description:
This plugin links your WordPress WooCommerce shop to the payment gateway.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected31,165 lines of code in 66 files:
LanguageFilesBlank linesComment linesLines of code
JSON20017,041
PHP382,0902,0649,102
PO File41,2641,4084,221
JavaScript19114161544
Markdown2500233
CSS13024

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity44.21
▷ Minimum class complexity1.00
▷ Maximum class complexity337.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity70.00
Code structure
Namespaces4
Interfaces2
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes13.70%
Methods378
▷ Static methods5915.61%
▷ Public methods28876.19%
▷ Protected methods5213.76%
▷ Private methods3810.05%
Functions25
▷ Named functions1872.00%
▷ Anonymous functions728.00%
Constants30
▷ Global constants26.67%
▷ Class constants2893.33%
▷ Public constants28100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/klarna.png1.86KB1.90KB0.00%
assets/images/other.png1.46KB0.86KB▼ 41.00%
assets/images/franfinance.png3.42KB1.98KB▼ 42.14%
assets/images/warn.png1.97KB1.50KB▼ 23.84%
assets/images/payzen.png7.62KB2.66KB▼ 65.02%