84% e-commerce-payment-gateway-kevin

Code Review | kevin. Payment Gateway for WooCommerce

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

About plugin

  • Plugin page: e-commerce-paymen...
  • Plugin version: 4.2.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.2
  • WordPress version: 6.3.1
  • First release: Jul 15, 2022
  • Latest release: Oct 23, 2023
  • Number of updates: 54
  • Update frequency: every 8.7 days
  • Top authors: kevineu (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active /2,949 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼5.12ms] Passed 4 tests

A check of server-side resources used by kevin. Payment Gateway for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1037.71 ▼4.76
Dashboard /wp-admin3.39 ▲0.0945.09 ▼2.65
Posts /wp-admin/edit.php3.51 ▲0.1542.76 ▼3.11
Add New Post /wp-admin/post-new.php5.98 ▲0.0983.19 ▼9.96
Media Library /wp-admin/upload.php3.32 ▲0.0937.86 ▲5.54

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 151 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
woocommerce_getkevin_installation_id
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by kevin. Payment Gateway for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲3414.38 ▲0.001.80 ▲0.0339.58 ▲1.09
Dashboard /wp-admin2,201 ▲215.53 ▼0.1182.01 ▼2.3339.73 ▼4.82
Posts /wp-admin/edit.php2,106 ▲62.02 ▲0.0634.59 ▼1.0734.43 ▼0.53
Add New Post /wp-admin/post-new.php1,534 ▼423.07 ▼0.22675.54 ▲8.4554.83 ▲2.75
Media Library /wp-admin/upload.php1,409 ▲154.15 ▼0.05105.59 ▲5.7944.90 ▲2.64

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
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • woocommerce_getkevin_installation_id
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 25× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'KevinPlugin\\View\\AbstractSettingsView' not found in wp-content/plugins/e-commerce-payment-gateway-kevin/src/View/BankPaymentSettingsFormView.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'KevinPluginFramework\\Application\\Exception\\KevinRequestException' not found in wp-content/plugins/e-commerce-payment-gateway-kevin/vendor-kevin/getkevin/kevin-plugin-framework/src/Application/Exception/KevinRequestInternalServerException.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/e-commerce-payment-gateway-kevin/templates/kevin-bank-payment-view.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'KevinPluginFramework\\Presentation\\Admin\\Form\\Validator\\RegexValidator' not found in wp-content/plugins/e-commerce-payment-gateway-kevin/vendor-kevin/getkevin/kevin-plugin-framework/src/Presentation/Admin/Form/Validator/CreditorNameRegexValidator.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Kevin\\AuthInterface' not found in wp-content/plugins/e-commerce-payment-gateway-kevin/vendor/getkevin/kevin-php/src/Auth.php:8
    • > PHP Fatal error
      Trait 'Kevin\\UtilityTrait' not found in wp-content/plugins/e-commerce-payment-gateway-kevin/vendor/getkevin/kevin-php/src/AccountTrait.php on line 8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/e-commerce-payment-gateway-kevin/templates/kevin-card-settings-form-view.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'KevinPluginFramework\\Presentation\\Admin\\Form\\Validator\\ValidatorInterface' not found in wp-content/plugins/e-commerce-payment-gateway-kevin/vendor-kevin/getkevin/kevin-plugin-framework/src/Presentation/Admin/Form/Validator/NotBlankValidator.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PhpCsFixer\\Finder' not found in wp-content/plugins/e-commerce-payment-gateway-kevin/vendor/getkevin/kevin-php/.php.cs.fixer.php:3
    • > PHP Fatal error
      Trait 'Kevin\\UtilityTrait' not found in wp-content/plugins/e-commerce-payment-gateway-kevin/vendor/getkevin/kevin-php/src/PaymentTrait.php on line 8

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 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
6 plugin tags: ecommerce payment gateway, payments, woocommerce payment gateway, woocommerce, payment gateway...

e-commerce-payment-gateway-kevin/getkevin.php 85% from 13 tests

"kevin. Payment Gateway for WooCommerce" version 4.2.7'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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("e-commerce-payment-gateway-kevin.php" instead of "getkevin.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin9,051 lines of code in 111 files:
LanguageFilesBlank linesComment linesLines of code
PO File142,18404,396
PHP839931,4973,967
Markdown21090320
CSS4290159
JSON500154
JavaScript21043
YAML10012

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity6.13
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces17
Interfaces8
Traits4
Classes58
▷ Abstract classes23.45%
▷ Concrete classes5696.55%
▷ Final classes11.79%
Methods321
▷ Static methods4012.46%
▷ Public methods25579.44%
▷ Protected methods195.92%
▷ Private methods4714.64%
Functions9
▷ Named functions444.44%
▷ Anonymous functions555.56%
Constants81
▷ Global constants33.70%
▷ Class constants7896.30%
▷ Public constants78100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/VISA_MC.png8.75KB4.39KB▼ 49.82%
assets/images/VISA_MC_small.png2.20KB1.81KB▼ 17.51%
assets/images/kevin.png4.10KB1.70KB▼ 58.63%