78% woo-cheetahpay-payment-gateway

Code Review | Cheetahpay Checkout Payment Gateway for WooCommerce

WordPress plugin Cheetahpay Checkout Payment Gateway for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woo-cheetahpay-pa...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.5.1
  • WordPress version: 6.3.1
  • First release: Apr 16, 2018
  • Latest release: Sep 10, 2020
  • Number of updates: 33
  • Update frequency: every 26.6 days
  • Top authors: incofab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,169 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Cheetahpay Checkout Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.99 ▼3.56
Dashboard /wp-admin3.32 ▲0.0144.16 ▼0.36
Posts /wp-admin/edit.php3.37 ▲0.0146.93 ▲0.10
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.69 ▼11.64
Media Library /wp-admin/upload.php3.24 ▲0.0134.73 ▲5.37

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Cheetahpay Checkout Payment Gateway for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7914.47 ▲0.121.79 ▼0.2039.68 ▼2.60
Dashboard /wp-admin2,209 ▲184.86 ▼1.00104.32 ▲1.7142.36 ▲1.69
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0240.29 ▼2.0036.51 ▲0.59
Add New Post /wp-admin/post-new.php1,538 ▲2423.34 ▲5.92658.98 ▲30.3559.49 ▲5.24
Media Library /wp-admin/upload.php1,385 ▼34.12 ▼0.1199.14 ▼0.2040.52 ▼2.89

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/woo-cheetahpay-payment-gateway/inc/payment-field.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woo-cheetahpay-payment-gateway/wc_cheetahpay.php:4
    • > PHP Notice
      Undefined variable: actualPrice in wp-content/plugins/woo-cheetahpay-payment-gateway/inc/payment-field.php on line 70
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-cheetahpay-payment-gateway/woo-cheetahpay-payment-gateway.php:21
    • > PHP Notice
      Undefined variable: actualPrice in wp-content/plugins/woo-cheetahpay-payment-gateway/inc/payment-field.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

woo-cheetahpay-payment-gateway/woo-cheetahpay-payment-gateway.php Passed 13 tests

The main PHP script in "Cheetahpay Checkout Payment Gateway for WooCommerce" version 1.0.5 is automatically included on every request by WordPress
69 characters long description:
A woocommerce paymernt gateway to help you receive airtime as payment

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 plugin546 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP4167166546

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity22.50
▷ Minimum class complexity11.00
▷ Maximum class complexity34.00
Average method complexity3.87
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods16.67%
▷ Public methods1280.00%
▷ Protected methods00.00%
▷ Private methods320.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants337.50%
▷ Class constants562.50%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/icon_48.png1.61KB1.06KB▼ 34.36%
inc/icon_72.png1.82KB1.28KB▼ 29.67%