89% woo-payment-gateway-for-vivapayments

Code Review | Viva Payments - Viva Wallet WooCommerce Payment Gateway

WordPress plugin Viva Payments - Viva Wallet WooCommerce Payment Gateway scored89%from 54 tests.

About plugin

  • Plugin page: woo-payment-gatew...
  • Plugin version: 1.4.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9.1
  • WordPress version: 6.3.1
  • First release: Mar 22, 2017
  • Latest release: Feb 28, 2022
  • Number of updates: 41
  • Update frequency: every 43.9 days
  • Top authors: enartia (63.41%)georgekapsalakis (39.02%)

Code review

54 tests

User reviews

12 reviews

Install metrics

2,000+ active /28,513 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.22ms] Passed 4 tests

Analyzing server-side resources used by Viva Payments - Viva Wallet WooCommerce Payment Gateway
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.24 ▼0.83
Dashboard /wp-admin3.31 ▲0.0047.07 ▼3.44
Posts /wp-admin/edit.php3.36 ▲0.0043.37 ▼6.52
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.19 ▼6.09
Media Library /wp-admin/upload.php3.23 ▲0.0032.71 ▲1.26

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Viva Payments - Viva Wallet WooCommerce Payment Gateway: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.18 ▼1.201.76 ▼0.1242.56 ▼7.86
Dashboard /wp-admin2,206 ▲154.85 ▼0.96103.18 ▼1.4542.16 ▲2.23
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0234.69 ▼2.6532.95 ▼3.03
Add New Post /wp-admin/post-new.php1,534 ▼023.21 ▲0.20675.15 ▲44.3665.95 ▲7.21
Media Library /wp-admin/upload.php1,388 ▼34.23 ▲0.0295.74 ▼1.5140.78 ▼1.75

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% 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
3 plugin tags: payment gateway, payment gateways, woocommerce

woo-payment-gateway-for-vivapayments/viva-woocommerce-payment-gateway.php 85% from 13 tests

The primary PHP file in "Viva Payments - Viva Wallet WooCommerce Payment Gateway" version 1.4.0.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-payment-gateway-for-vivapayments.php" instead of "viva-woocommerce-payment-gateway.php")
  • Description: The description should be shorter than 140 characters (currently 195 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin992 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP2140105593
PO File2105140361
SVG10138

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity27.00
▷ Minimum class complexity3.00
▷ Maximum class complexity51.00
Average method complexity4.71
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods214.29%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/pay-via-vivapay.png21.14KB6.90KB▼ 67.35%