84% woo-cardcom-payment-gateway

Code Review | CardCom Payment Gateway

WordPress plugin CardCom Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: woo-cardcom-payme...
  • Plugin version: 3.4.8.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-7.4
  • WordPress version: 6.3.1
  • First release: Dec 21, 2017
  • Latest release: May 21, 2023
  • Number of updates: 162
  • Update frequency: every 12.9 days
  • Top authors: cardcom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

3,000+ active /46,599 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.48MB] [CPU: ▼2.63ms] Passed 4 tests

A check of server-side resources used by CardCom Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4850.13 ▲10.71
Dashboard /wp-admin3.78 ▲0.4846.20 ▼8.34
Posts /wp-admin/edit.php3.89 ▲0.5452.99 ▲7.94
Add New Post /wp-admin/post-new.php6.36 ▲0.4882.87 ▼11.57
Media Library /wp-admin/upload.php3.70 ▲0.4837.14 ▲1.45

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

CardCom Payment Gateway: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.47 ▼0.111.95 ▲0.1736.39 ▼7.85
Dashboard /wp-admin2,203 ▲155.90 ▲0.02106.90 ▼8.0739.99 ▼5.77
Posts /wp-admin/edit.php2,092 ▼02.04 ▲0.0439.47 ▲3.2133.49 ▼0.84
Add New Post /wp-admin/post-new.php1,519 ▼1423.46 ▲0.23675.56 ▲6.0860.69 ▲9.70
Media Library /wp-admin/upload.php1,388 ▼04.21 ▼0.0493.08 ▼10.2342.40 ▼2.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

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
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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-cardcom-payment-gateway/cardcom.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Donate link: Invalid url: ""
Please take inspiration from this readme.txt

woo-cardcom-payment-gateway/cardcom.php 92% from 13 tests

This is the main PHP file of "CardCom Payment Gateway" version 3.4.8.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-cardcom-payment-gateway.php" instead of "cardcom.php")

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
Everything looks great! No dangerous files found in this plugin2,630 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP12074482,365
PO File192105214
JavaScript12451

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity344.00
▷ Minimum class complexity344.00
▷ Maximum class complexity344.00
Average method complexity5.34
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods79
▷ Static methods1924.05%
▷ Public methods7797.47%
▷ Protected methods11.27%
▷ Private methods11.27%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
images/cards.png2.11KB1.81KB▼ 14.01%