84% payment-gateway-via-borgun-for-woocommerce

Code Review | Payment gateway via Teya SecurePay for WooCommerce

WordPress plugin Payment gateway via Teya SecurePay for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: payment-gateway-v...
  • Plugin version: 1.3.28
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 7, 2016
  • Latest release: Nov 27, 2023
  • Number of updates: 69
  • Update frequency: every 37.4 days
  • Top authors: tacticais (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

800+ active /13,962 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼9.18ms] Passed 4 tests

Analyzing server-side resources used by Payment gateway via Teya SecurePay for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.33 ▼8.10
Dashboard /wp-admin3.32 ▼0.0246.56 ▼13.26
Posts /wp-admin/edit.php3.37 ▲0.0246.58 ▲1.83
Add New Post /wp-admin/post-new.php5.90 ▲0.0280.83 ▼17.18
Media Library /wp-admin/upload.php3.24 ▲0.0237.38 ▲2.52

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Payment gateway via Teya SecurePay for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.21 ▼0.131.69 ▼0.0141.08 ▼2.61
Dashboard /wp-admin2,195 ▲215.61 ▼0.0587.74 ▼11.2639.94 ▼2.11
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0239.34 ▲1.7337.03 ▲3.22
Add New Post /wp-admin/post-new.php1,526 ▼1323.17 ▼0.17604.17 ▲3.8248.61 ▼6.71
Media Library /wp-admin/upload.php1,403 ▲34.18 ▼0.0296.17 ▼0.9541.81 ▼1.60

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× 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/payment-gateway-via-borgun-for-woocommerce/borgun.php:18
    • > PHP Warning
      The use statement with non-compound name 'Exception' has no effect in wp-content/plugins/payment-gateway-via-borgun-for-woocommerce/includes/class-payment-method-borgun-registration.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/payment-gateway-via-borgun-for-woocommerce/includes/class-wc-gateway-borgun.php:14

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: woocommerce, saltpay, gateway, credit card, teya

payment-gateway-via-borgun-for-woocommerce/borgun.php 85% from 13 tests

The main file in "Payment gateway via Teya SecurePay for WooCommerce" v. 1.3.28 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: It is recommended to name the main PHP file as the plugin slug ("payment-gateway-via-borgun-for-woocommerce.php" instead of "borgun.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected992 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3102220800
PO File16770165
JavaScript261427

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity54.50
▷ Minimum class complexity6.00
▷ Maximum class complexity103.00
Average method complexity4.96
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods27
▷ Static methods00.00%
▷ Public methods2281.48%
▷ Protected methods518.52%
▷ Private methods00.00%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in 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
cards.png5.49KB2.76KB▼ 49.80%