89% unipay-payment-gateway-for-woocommerce

Code Review | UniPAY Payment Gateway For WooCommerce

WordPress plugin UniPAY Payment Gateway For WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: unipay-payment-ga...
  • Plugin version: 2.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.2
  • WordPress version: 6.3.1
  • First release: Aug 13, 2018
  • Latest release: Apr 6, 2023
  • Number of updates: 34
  • Update frequency: every 50.0 days
  • Top authors: unipaydev (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /2,906 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by UniPAY Payment Gateway For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1143.90 ▼3.28
Dashboard /wp-admin3.41 ▲0.1155.50 ▲6.34
Posts /wp-admin/edit.php3.52 ▲0.1747.04 ▼8.20
Add New Post /wp-admin/post-new.php5.99 ▲0.1191.09 ▼8.63
Media Library /wp-admin/upload.php3.33 ▲0.1036.53 ▲2.07

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 76 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

UniPAY Payment Gateway For WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.42 ▲0.071.84 ▼0.5446.57 ▲4.62
Dashboard /wp-admin2,195 ▲155.64 ▲0.0294.53 ▲6.2441.90 ▲2.87
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0436.53 ▼2.6532.72 ▼4.67
Add New Post /wp-admin/post-new.php1,526 ▼023.12 ▼0.62667.20 ▲14.5856.92 ▼19.17
Media Library /wp-admin/upload.php1,400 ▲34.12 ▲0.02116.49 ▲12.8045.47 ▼1.61

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 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)
Everything seems fine, however this is by no means an exhaustive test

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 a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

unipay-payment-gateway-for-woocommerce/woocommerce-unipay.php 77% from 13 tests

The main file in "UniPAY Payment Gateway For WooCommerce" v. 2.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("unipay-payment-gateway-for-woocommerce.php" instead of "woocommerce-unipay.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin808 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP4187335735
JavaScript120773

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity19.33
▷ Minimum class complexity2.00
▷ Maximum class complexity40.00
Average method complexity3.39
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods23
▷ Static methods14.35%
▷ Public methods1460.87%
▷ Protected methods939.13%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
70 PNG files occupy 0.15MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/amex_logo_black_large.png1.19KB1.47KB0.00%
assets/images/logo-medium-black-no-amex.png1.81KB1.03KB▼ 42.94%
assets/images/logo-small-white-no-amex.png1.80KB0.95KB▼ 47.15%
assets/images/icons/qrcode_logo_black_small.png0.48KB0.37KB▼ 22.29%
assets/images/logo-large-white-no-amex.png3.23KB1.55KB▼ 51.90%