78% younitedpay-payment-gateway

Code Review | Younited Pay Payment Gateway

WordPress plugin Younited Pay Payment Gateway scored78%from 54 tests.

About plugin

  • Plugin page: younitedpay-payme...
  • Plugin version: 1.5.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Jun 7, 2023
  • Latest release: Nov 6, 2023
  • Number of updates: 17
  • Update frequency: every 8.9 days
  • Top authors: younitedpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /427 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.10MB] [CPU: ▼4.70ms] Passed 4 tests

A check of server-side resources used by Younited Pay Payment Gateway
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1033.17 ▼8.46
Dashboard /wp-admin3.41 ▲0.1048.08 ▼2.71
Posts /wp-admin/edit.php3.52 ▲0.1747.80 ▲2.54
Add New Post /wp-admin/post-new.php5.99 ▲0.1083.59 ▼5.71
Media Library /wp-admin/upload.php3.33 ▲0.1033.86 ▼1.93
Younited Pay Gateway /wp-admin/admin.php?page=younitedpay_settings3.2931.09

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 46 new files
Database: no new tables, 7 new options
New WordPress options
woocommerce_younitedpay-gateway_customerid
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Younited Pay Payment Gateway
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲314.62 ▲0.342.21 ▲0.3039.50 ▼4.47
Dashboard /wp-admin2,195 ▲185.62 ▲0.0189.48 ▼12.2140.79 ▼4.31
Posts /wp-admin/edit.php2,097 ▼31.98 ▲0.0339.60 ▲3.8137.39 ▲1.44
Add New Post /wp-admin/post-new.php1,529 ▼623.21 ▲5.01632.31 ▼29.0061.45 ▼7.33
Media Library /wp-admin/upload.php1,400 ▲64.26 ▲0.06100.66 ▲1.3840.84 ▼2.39
Younited Pay Gateway /wp-admin/admin.php?page=younitedpay_settings8242.1722.8826.37

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • woocommerce_younitedpay-gateway_customerid
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/younitedpay-payment-gateway/views/payment.php
    • > /wp-content/plugins/younitedpay-payment-gateway/views/bestprice.php
  • 21× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: ajax in wp-content/plugins/younitedpay-payment-gateway/views/bestprice.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/younitedpay-payment-gateway/views/home.php:2
    • > PHP Notice
      Undefined variable: possible_maturities in wp-content/plugins/younitedpay-payment-gateway/views/payment.php on line 51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/younitedpay-payment-gateway/views/payment_maturity_details.php:1
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/younitedpay-payment-gateway/views/payment.php on line 46
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/younitedpay-payment-gateway/views/payment.php on line 51
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/younitedpay-payment-gateway/views/payment.php on line 1
    • > PHP Notice
      Undefined variable: possible_prices in wp-content/plugins/younitedpay-payment-gateway/views/payment.php on line 46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/younitedpay-payment-gateway/views/menu.php:6
    • > PHP Notice
      Undefined variable: api_keys_is_defined in wp-content/plugins/younitedpay-payment-gateway/views/config.php on line 11

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)
There were no browser issues found

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
There were no plugin tags found

younitedpay-payment-gateway/wc-younitedpay-gateway.php 85% from 13 tests

"Younited Pay Payment Gateway" version 1.5.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("younitedpay-payment-gateway.php" instead of "wc-younitedpay-gateway.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected3,418 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP244625822,442
PO File22418510
CSS2686321
JavaScript23113123
JSON10016
SVG6006

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity30.40
▷ Minimum class complexity1.00
▷ Maximum class complexity165.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods85
▷ Static methods1618.82%
▷ Public methods7992.94%
▷ Protected methods00.00%
▷ Private methods67.06%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.44MB with 0.25MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/close.png1.05KB0.61KB▼ 42.15%
assets/img/image_marketing_fr.png15.94KB7.63KB▼ 52.15%
assets/img/image_marketing_es.png433.32KB109.61KB▼ 74.70%