84% kupay-payment-gateway-for-woocommerce

Code Review | KuPay Payment Gateway for WooCommerce

WordPress plugin KuPay Payment Gateway for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: kupay-payment-gat...
  • Plugin version: 0.1.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.3.0-5.9.3
  • WordPress version: 6.3.1
  • First release: Apr 15, 2022
  • Latest release: May 3, 2022
  • Number of updates: 3
  • Update frequency: every 6.0 days
  • Top authors: kupayfinance (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,038 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
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by KuPay Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0135.44 ▼7.16
Dashboard /wp-admin3.32 ▲0.0244.12 ▼5.48
Posts /wp-admin/edit.php3.37 ▲0.0152.92 ▼1.87
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.34 ▼19.60
Media Library /wp-admin/upload.php3.24 ▲0.0138.00 ▲0.45

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

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

Browser metrics Passed 4 tests

A check of browser resources used by KuPay Payment Gateway for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▼0.291.68 ▲0.0638.98 ▼2.48
Dashboard /wp-admin2,195 ▲155.55 ▼0.11104.94 ▲16.3043.11 ▲3.54
Posts /wp-admin/edit.php2,100 ▲31.96 ▼0.0039.30 ▲3.5234.83 ▼0.41
Add New Post /wp-admin/post-new.php1,526 ▼1023.21 ▼0.04608.12 ▼86.4946.34 ▼9.65
Media Library /wp-admin/upload.php1,394 ▼34.22 ▼0.01100.64 ▼13.3045.65 ▼2.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/kupay-payment-gateway-for-woocommerce/includes/kupay-checkout-description-fields.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/kupay-payment-gateway-for-woocommerce/includes/class-wc-payment-gateway-kupay.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: defi, woocommerce, metamask, kcc, gateway...

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

The principal PHP file in "KuPay Payment Gateway for WooCommerce" v. 0.1.3 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.7" instead of "6.3.0")
  • Main file name: Name the main plugin file the same as the plugin slug ("kupay-payment-gateway-for-woocommerce.php" instead of "kupay-payment-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected366 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3110165366

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity67.00
▷ Minimum class complexity67.00
▷ Maximum class complexity67.00
Average method complexity5.12
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods850.00%
▷ Protected methods16.25%
▷ Private methods743.75%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon.png3.72KB3.23KB▼ 13.20%