79% woo-cardknox-gateway

Code Review | Cardknox Payment Gateway for WooCommerce

WordPress plugin Cardknox Payment Gateway for WooCommerce scored79%from 54 tests.

About plugin

  • Plugin page: woo-cardknox-gateway
  • Plugin version: 1.0.15
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.0.3
  • WordPress version: 6.3.1
  • First release: Jan 23, 2018
  • Latest release: Feb 23, 2023
  • Number of updates: 21
  • Update frequency: every 88.4 days
  • Top authors: dlehren (95.24%)rezwanck (9.52%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /3,152 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.83MB] [CPU: ▼32.52ms] Passed 4 tests

Server-side resources used by Cardknox Payment Gateway for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0542.18 ▼1.59
Dashboard /wp-admin3.12 ▼0.1925.63 ▼22.92
Posts /wp-admin/edit.php3.12 ▼0.2425.21 ▼26.51
Add New Post /wp-admin/post-new.php3.12 ▼2.7726.94 ▼68.37
Media Library /wp-admin/upload.php3.12 ▼0.1124.17 ▼12.26

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Cardknox Payment Gateway for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲1214.45 ▲0.091.78 ▼0.1843.22 ▲0.88
Dashboard /wp-admin2,201 ▲215.55 ▼0.1087.52 ▲3.0138.96 ▼6.90
Posts /wp-admin/edit.php2,109 ▲92.03 ▲0.0133.23 ▼7.2237.51 ▼1.67
Add New Post /wp-admin/post-new.php1,535 ▲723.53 ▲0.45677.93 ▼4.9254.25 ▼6.53
Media Library /wp-admin/upload.php1,412 ▲124.17 ▲0.01109.79 ▼6.2647.20 ▼2.29

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/woo-cardknox-gateway/includes/class-wc-cardknox-api.php+55
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • wc_cardknox_version
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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
4 plugin tags: cardknox, woocommerce, credit card, gateway

woo-cardknox-gateway/woocommerce-gateway-cardknox.php 85% from 13 tests

Analyzing the main PHP file in "Cardknox Payment Gateway for WooCommerce" version 1.0.15
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-cardknox-gateway.php" instead of "woocommerce-gateway-cardknox.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
No dangerous file extensions were detected1,539 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP63356751,357
JavaScript43349182

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity55.20
▷ Minimum class complexity7.00
▷ Maximum class complexity133.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods76
▷ Static methods1013.16%
▷ Public methods6788.16%
▷ Protected methods56.58%
▷ Private methods45.26%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/diners.png1.08KB1.20KB0.00%