74% revolut-gateway-for-woocommerce

Code Review | Revolut Gateway for WooCommerce

WordPress plugin Revolut Gateway for WooCommerce scored74%from 54 tests.

About plugin

  • Plugin page: revolut-gateway-f...
  • Plugin version: 4.9.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: May 12, 2020
  • Latest release: Nov 13, 2023
  • Number of updates: 181
  • Update frequency: every 7.1 days
  • Top authors: revolutbusiness (97.79%)laghzali (2.76%)

Code review

54 tests

User reviews

36 reviews

Install metrics

4,000+ active /94,995 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.62ms] Passed 4 tests

Server-side resources used by Revolut Gateway for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.31 ▼4.03
Dashboard /wp-admin3.35 ▼0.0045.42 ▼16.94
Posts /wp-admin/edit.php3.40 ▲0.0448.72 ▲2.13
Add New Post /wp-admin/post-new.php5.93 ▲0.0493.94 ▲2.96
Media Library /wp-admin/upload.php3.27 ▲0.0435.50 ▲0.35

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 40 new files
Database: 3 new tables, 7 new options
New tables
wp_wc_revolut_orders
wp_wc_revolut_customer
wp_wc_revolut_temp_session
New WordPress options
widget_theysaidso_widget
WC_GATEWAY_REVOLUT_VERSION
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Revolut Gateway for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6814.24 ▼0.001.96 ▼0.3238.66 ▼11.15
Dashboard /wp-admin2,198 ▲175.62 ▼0.0991.53 ▼21.8241.60 ▼1.48
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0438.56 ▲0.7136.71 ▼0.89
Add New Post /wp-admin/post-new.php1,526 ▼523.24 ▲0.42601.83 ▼92.5244.08 ▼9.01
Media Library /wp-admin/upload.php1,397 ▼34.19 ▲0.0299.92 ▲3.5841.96 ▲0.09

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_wc_revolut_customer
    • wp_wc_revolut_orders
    • wp_wc_revolut_temp_session
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • WC_GATEWAY_REVOLUT_VERSION
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
Please fix the following
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Trait 'WC_Gateway_Revolut_Helper_Trait' not found in wp-content/plugins/revolut-gateway-for-woocommerce/includes/class-wc-revolut-order-descriptor.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway_Revolut' not found in wp-content/plugins/revolut-gateway-for-woocommerce/includes/gateways/class-wc-gateway-revolut-pay.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WC_REST_Data_Controller' not found in wp-content/plugins/revolut-gateway-for-woocommerce/api/class-revolut-webhook-controller.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/revolut-gateway-for-woocommerce/templates/html-settings-nav.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Settings_API' not found in wp-content/plugins/revolut-gateway-for-woocommerce/includes/settings/class-wc-revolut-settings-api.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Revolut_Settings_API' not found in wp-content/plugins/revolut-gateway-for-woocommerce/includes/settings/class-wc-revolut-advanced-settings.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway_Revolut' not found in wp-content/plugins/revolut-gateway-for-woocommerce/includes/gateways/class-wc-gateway-revolut-cc.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: payment gateway, payments, gateway, credit card, revolut business...

revolut-gateway-for-woocommerce/gateway-revolut.php 92% from 13 tests

Analyzing the main PHP file in "Revolut Gateway for WooCommerce" version 4.9.5
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("revolut-gateway-for-woocommerce.php" instead of "gateway-revolut.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin6,355 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP211,0531,8554,537
JavaScript32531051,659
SVG801137
CSS14022

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity37.95
▷ Minimum class complexity3.00
▷ Maximum class complexity174.00
Average method complexity3.74
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits4
Classes15
▷ Abstract classes16.67%
▷ Concrete classes1493.33%
▷ Final classes00.00%
Methods254
▷ Static methods10.39%
▷ Public methods22990.16%
▷ Protected methods249.45%
▷ Private methods10.39%
Functions12
▷ Named functions1191.67%
▷ Anonymous functions18.33%
Constants20
▷ Global constants1785.00%
▷ Class constants315.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/revolut_business_logo.png25.19KB12.88KB▼ 48.89%
assets/images/revolut-pay-banner-chevron - right.png0.28KB0.21KB▼ 27.84%
assets/images/revolut-pay-banner-gift.png2.07KB1.78KB▼ 13.93%
assets/images/g-pay-logo.png33.35KB12.19KB▼ 63.45%