84% custom-payment-gateways-woocommerce

Code Review | Custom Payment Gateways for WooCommerce

WordPress plugin Custom Payment Gateways for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: custom-payment-ga...
  • Plugin version: 1.8.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4
  • WordPress version: 6.3.1
  • First release: Feb 18, 2017
  • Latest release: Nov 14, 2023
  • Number of updates: 60
  • Update frequency: every 41.0 days
  • Top authors: algoritmika (58.33%)Dhruvin (41.67%)tychesoftwares (3.33%)

Code review

54 tests

User reviews

14 reviews

Install metrics

8,000+ active /58,851 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.01MB] [CPU: ▼10.99ms] Passed 4 tests

An overview of server-side resources used by Custom Payment Gateways for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.29 ▼7.15
Dashboard /wp-admin3.33 ▼0.0245.23 ▼23.88
Posts /wp-admin/edit.php3.38 ▲0.0249.99 ▲1.76
Add New Post /wp-admin/post-new.php5.91 ▲0.0280.35 ▼14.70
Media Library /wp-admin/upload.php3.25 ▲0.0239.36 ▲2.68

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Custom Payment Gateways for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6814.54 ▲0.272.04 ▲0.2537.08 ▼6.63
Dashboard /wp-admin2,195 ▲175.62 ▼0.0990.38 ▼24.5539.74 ▼1.59
Posts /wp-admin/edit.php2,100 ▼32.00 ▲0.0634.14 ▼1.9134.05 ▲2.56
Add New Post /wp-admin/post-new.php1,526 ▼023.41 ▲0.40687.80 ▲4.4651.24 ▼4.84
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.05109.83 ▲7.3446.87 ▲2.89

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please fix the following
  • 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/custom-payment-gateways-woocommerce/includes/class-wc-gateway-alg-custom.php:11

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 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 to be fixed:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
The official readme.txt might help

custom-payment-gateways-woocommerce/custom-payment-gateways-for-woocommerce.php 92% from 13 tests

This is the main PHP file of "Custom Payment Gateways for WooCommerce" version 1.8.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-payment-gateways-woocommerce.php" instead of "custom-payment-gateways-for-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,579 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP131847121,568
JavaScript11711

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.52
Average class complexity15.09
▷ Minimum class complexity1.00
▷ Maximum class complexity71.00
Average method complexity3.87
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes19.09%
Methods54
▷ Static methods11.85%
▷ Public methods54100.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
No PNG files were detected