83% unipayment-gateway-for-woocommerce

Code Review | UniPayment Gateway for WooCommerce

WordPress plugin UniPayment Gateway for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: unipayment-gatewa...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Sep 20, 2022
  • Latest release: Oct 1, 2022
  • Number of updates: 8
  • Update frequency: every 2.1 days
  • Top authors: unipayment (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /504 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
Install script ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼0.95ms] Passed 4 tests

Analyzing server-side resources used by UniPayment Gateway for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2551.50 ▲11.32
Dashboard /wp-admin3.57 ▲0.2751.56 ▲0.16
Posts /wp-admin/edit.php3.62 ▲0.2749.12 ▲0.68
Add New Post /wp-admin/post-new.php6.09 ▲0.2185.44 ▼7.37
Media Library /wp-admin/upload.php3.43 ▲0.2139.02 ▲2.72

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 193 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for UniPayment Gateway for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.63 ▼0.722.09 ▲0.3245.65 ▲3.87
Dashboard /wp-admin2,206 ▲184.87 ▼0.00113.03 ▼3.0442.56 ▼2.31
Posts /wp-admin/edit.php2,089 ▼32.05 ▼0.0035.86 ▼7.6334.44 ▼3.70
Add New Post /wp-admin/post-new.php1,519 ▲523.28 ▲5.63661.09 ▼46.5250.38 ▼1.33
Media Library /wp-admin/upload.php1,385 ▼34.19 ▼0.00101.20 ▼22.6942.30 ▼4.42

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 63× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/unipayment-gateway-for-woocommerce/vendor/guzzlehttp/psr7/src/Stream.php:12
    • > PHP Parse error
      syntax error, unexpected '|', expecting '{' in wp-content/plugins/unipayment-gateway-for-woocommerce/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Polyfill\\Intl\ormalizer\ormalizer' not found in wp-content/plugins/unipayment-gateway-for-woocommerce/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'UniPayment\\Client\\Model\\ModelInterface' not found in wp-content/plugins/unipayment-gateway-for-woocommerce/lib/Model/GetExchangeRateByCurrencyPairResponse.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/unipayment-gateway-for-woocommerce/vendor/guzzlehttp/psr7/src/LimitStream.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/unipayment-gateway-for-woocommerce/index.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/unipayment-gateway-for-woocommerce/vendor/guzzlehttp/promises/src/Promise.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'UniPayment\\Client\\Model\\ModelInterface' not found in wp-content/plugins/unipayment-gateway-for-woocommerce/lib/Model/GetCurrenciesResponse.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/unipayment-gateway-for-woocommerce/vendor/guzzlehttp/promises/src/EachPromise.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'UniPayment\\Client\\Model\\ModelInterface' not found in wp-content/plugins/unipayment-gateway-for-woocommerce/lib/Model/CreateInvoiceRequest.php:14

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
9 plugin tags: payment, usdt, usc, woocommerce, busd...

unipayment-gateway-for-woocommerce/index.php 85% from 13 tests

The principal PHP file in "UniPayment Gateway for WooCommerce" v. 1.0.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.9" instead of "3.0")
  • Main file name: The principal plugin file should be the same as the plugin slug ("unipayment-gateway-for-woocommerce.php" instead of "index.php")

Code Analysis 97% from 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 plugin36,541 lines of code in 183 files:
LanguageFilesBlank linesComment linesLines of code
PHP1533,32810,15831,980
Markdown141,14903,449
JSON9001,002
YAML522391
Dockerfile18010
make1409

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity17.09
▷ Minimum class complexity1.00
▷ Maximum class complexity212.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces15
Interfaces16
Traits2
Classes104
▷ Abstract classes00.00%
▷ Concrete classes104100.00%
▷ Final classes2322.12%
Methods1,237
▷ Static methods25520.61%
▷ Public methods1,08687.79%
▷ Protected methods141.13%
▷ Private methods13711.08%
Functions189
▷ Named functions7640.21%
▷ Anonymous functions11359.79%
Constants213
▷ Global constants7635.68%
▷ Class constants13764.32%
▷ Public constants137100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin