84% woo-payu-payment-gateway

Code Review | PayU EU Payment Gateway for WooCommerce

WordPress plugin PayU EU Payment Gateway for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-payu-payment-...
  • Plugin version: 2.0.33
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 8, 2016
  • Latest release: Nov 23, 2023
  • Number of updates: 152
  • Update frequency: every 18.3 days
  • Top authors: payusa (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10,000+ active /220,252 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.09ms] Passed 4 tests

A check of server-side resources used by PayU EU Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1033.91 ▼7.35
Dashboard /wp-admin3.40 ▲0.1044.79 ▼5.77
Posts /wp-admin/edit.php3.51 ▲0.1649.98 ▲4.12
Add New Post /wp-admin/post-new.php6.00 ▲0.1192.32 ▼4.43
Media Library /wp-admin/upload.php3.32 ▲0.0934.97 ▲1.21

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 62 new files
Database: no new tables, 11 new options
New WordPress options
widget_recent-posts
woocommerce_payucreditcard_settings
_payu_plugin_version
woocommerce_payulistbanks_settings
widget_theysaidso_widget
theysaidso_admin_options
woocommerce_payuinstallments_settings
db_upgraded
widget_recent-comments
payu_settings_option_name
...

Browser metrics Passed 4 tests

Checking browser requirements for PayU EU Payment Gateway for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3214.14 ▼0.211.59 ▼0.0337.69 ▼9.73
Dashboard /wp-admin2,202 ▲225.60 ▼0.0590.46 ▼4.8139.78 ▼2.72
Posts /wp-admin/edit.php2,104 ▲41.99 ▲0.0441.80 ▲2.3935.06 ▲0.70
Add New Post /wp-admin/post-new.php1,530 ▲423.15 ▼0.07665.32 ▲1.8561.87 ▲6.84
Media Library /wp-admin/upload.php1,404 ▲14.36 ▲0.1696.70 ▼8.2342.18 ▼0.44

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • woocommerce_payulistbanks_settings
    • woocommerce_payucreditcard_settings
    • payu_settings_option_name
    • can_compress_scripts
    • _payu_plugin_version
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • ...

Smoke tests 75% 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 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
  • 22× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_PayUGateways' not found in wp-content/plugins/woo-payu-payment-gateway/includes/WC_Gateway_PayuStandard.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/woo-payu-payment-gateway/includes/PayUSettings.php:253
    • > PHP Fatal error
      Uncaught Error: Interface 'OauthCacheInterface' not found in wp-content/plugins/woo-payu-payment-gateway/includes/lib/OpenPayU/Oauth/Cache/OauthCacheFile.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'AuthType' not found in wp-content/plugins/woo-payu-payment-gateway/includes/lib/OpenPayU/AuthType/TokenRequest.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'OpenPayU' not found in wp-content/plugins/woo-payu-payment-gateway/includes/lib/OpenPayU/v2/Retrieve.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'OpenPayU' not found in wp-content/plugins/woo-payu-payment-gateway/includes/lib/OpenPayU/v2/Refund.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WC_PayUGateways' not found in wp-content/plugins/woo-payu-payment-gateway/includes/WC_Gateway_PayuPaypo.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'OauthCacheInterface' not found in wp-content/plugins/woo-payu-payment-gateway/includes/OauthCacheWP.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'OauthCacheInterface' not found in wp-content/plugins/woo-payu-payment-gateway/includes/lib/OpenPayU/Oauth/Cache/OauthCacheMemcached.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_PayUGateways' not found in wp-content/plugins/woo-payu-payment-gateway/includes/WC_Gateway_PayuBlik.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: payment, payment gateway, payu poland, platnosci, payu...

woo-payu-payment-gateway/woocommerce-gateway-payu.php 85% from 13 tests

The principal PHP file in "PayU EU Payment Gateway for WooCommerce" v. 2.0.33 is loaded by WordPress automatically on each request
The following require your attention:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.4" instead of "3.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-payu-payment-gateway.php" instead of "woocommerce-gateway-payu.php")

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
Everything looks great! No dangerous files found in this plugin4,338 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP407631,1523,556
PO File1100132308
Sass3300195
JavaScript5220169
SVG500103
CSS3007

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity10.73
▷ Minimum class complexity1.00
▷ Maximum class complexity155.00
Average method complexity2.79
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes42
▷ Abstract classes49.52%
▷ Concrete classes3890.48%
▷ Final classes00.00%
Methods243
▷ Static methods8534.98%
▷ Public methods19680.66%
▷ Protected methods229.05%
▷ Private methods2510.29%
Functions27
▷ Named functions2696.30%
▷ Anonymous functions13.70%
Constants32
▷ Global constants412.50%
▷ Class constants2887.50%
▷ Public constants28100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin