84% woo-3d-secure-bankart-payment-gateway

Code Review | WooCommerce 3D Secure (Bankart) Payment Gateway

WordPress plugin WooCommerce 3D Secure (Bankart) Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: woo-3d-secure-ban...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.2.3
  • WordPress version: 6.3.1
  • First release: Jul 20, 2017
  • Latest release: Oct 4, 2019
  • Number of updates: 15
  • Update frequency: every 54.8 days
  • Top authors: geca (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /1,638 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼0.13ms] Passed 4 tests

Server-side resources used by WooCommerce 3D Secure (Bankart) Payment Gateway
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1135.84 ▼0.23
Dashboard /wp-admin3.42 ▲0.1144.35 ▲1.08
Posts /wp-admin/edit.php3.53 ▲0.1747.39 ▼1.66
Add New Post /wp-admin/post-new.php6.00 ▲0.1192.07 ▲0.31
Media Library /wp-admin/upload.php3.34 ▲0.1139.60 ▲6.12

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 9 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

This is an overview of browser requirements for WooCommerce 3D Secure (Bankart) Payment Gateway
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.38 ▼0.191.80 ▲0.0136.00 ▼5.23
Dashboard /wp-admin2,195 ▲145.57 ▼0.1193.20 ▼18.7642.60 ▼6.65
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0638.83 ▼1.8635.94 ▲0.75
Add New Post /wp-admin/post-new.php1,526 ▼023.00 ▼0.04657.14 ▼0.9860.69 ▲2.29
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.0594.54 ▼3.2546.12 ▲4.29

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

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/woo-3d-secure-bankart-payment-gateway/index.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
8 plugin tags: bankart, mastercard, woocommerce, visa, gateway...

woo-3d-secure-bankart-payment-gateway/index.php 85% from 13 tests

The main file in "WooCommerce 3D Secure (Bankart) Payment Gateway" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-3d-secure-bankart-payment-gateway.php" instead of "index.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected579 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP510831579

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity10.75
▷ Minimum class complexity4.00
▷ Maximum class complexity19.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods2187.50%
▷ Protected methods14.17%
▷ Private methods28.33%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/mc.png5.42KB1.77KB▼ 67.41%