89% k2-woo-custom-payment-gateway

Code Review | K2 Custom Payment Gateway for WooCommerce

WordPress plugin K2 Custom Payment Gateway for WooCommerce scored 89% from 54 tests.

About plugin

  • Plugin page: k2-woo-custom-pay...
  • Plugin version: 1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.5.1
  • WordPress version: 6.3.1
  • First release: Aug 25, 2020
  • Latest release: Nov 12, 2020
  • Number of updates: 7
  • Update frequency: every 11.4 days
  • Top authors: pookidevs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 408 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.31ms] Passed 4 tests

A check of server-side resources used by K2 Custom Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.56 ▼5.25
Dashboard /wp-admin3.31 ▲0.0041.60 ▼5.58
Posts /wp-admin/edit.php3.36 ▲0.0045.19 ▼0.30
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.37 ▼10.38
Media Library /wp-admin/upload.php3.23 ▲0.0031.71 ▼4.03

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

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

Browser metrics Passed 4 tests

A check of browser resources used by K2 Custom Payment Gateway for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲5113.31 ▼0.941.51 ▼0.8737.57 ▼8.07
Dashboard /wp-admin2,209 ▲185.91 ▲1.0496.47 ▼6.9737.82 ▼6.49
Posts /wp-admin/edit.php2,086 ▼32.02 ▼0.0039.76 ▲2.4235.05 ▲3.56
Add New Post /wp-admin/post-new.php1,534 ▲2023.36 ▲5.78592.28 ▼91.7853.96 ▼14.15
Media Library /wp-admin/upload.php1,388 ▼04.22 ▲0.0395.55 ▼7.6142.20 ▼3.68

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
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Everything seems fine, however this is by no means an exhaustive test

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (`/assets/K2-custom-Gateway-Screenshot-1.png`), #2 (`/assets/K2-custom-Gateway-Screenshot-2.png`), #3 (`/assets/K2-custom-Gateway-Screenshot-3.png`), #4 (`/assets/K2-custom-Gateway-Screenshot-4.png`)
Please take inspiration from this readme.txt

k2-woo-custom-payment-gateway/K2_Custom_Payment_Gateway.php 92% from 13 tests

"K2 Custom Payment Gateway for WooCommerce" version 1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("k2-woo-custom-payment-gateway.php" instead of "K2_Custom_Payment_Gateway.php")

Code Analysis Passed 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
There were no executable files found in this plugin142 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14934142

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/hand.png22.19KB11.66KB▼ 47.44%