84% woocommerce-other-payment-gateway

Code Review | WooCommerce Custom Payment Gateway

WordPress plugin WooCommerce Custom Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-other...
  • Plugin version: 1.3.8
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 1, 2015
  • Latest release: Jul 23, 2023
  • Number of updates: 65
  • Update frequency: every 45.7 days
  • Top authors: waseem_senjer (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

10,000+ active /103,064 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

This is a short check of server-side resources used by WooCommerce Custom Payment Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.11 ▼9.64
Dashboard /wp-admin3.31 ▼0.0443.07 ▼18.16
Posts /wp-admin/edit.php3.36 ▲0.0045.92 ▲3.86
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.46 ▼5.92
Media Library /wp-admin/upload.php3.23 ▲0.0033.91 ▲1.05

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

WooCommerce Custom 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 ▲2913.19 ▼1.372.14 ▲0.1037.58 ▼6.17
Dashboard /wp-admin2,206 ▲215.90 ▲0.88100.92 ▼17.0440.72 ▼3.22
Posts /wp-admin/edit.php2,089 ▼32.04 ▲0.0537.90 ▼3.9737.73 ▲0.46
Add New Post /wp-admin/post-new.php1,514 ▼617.60 ▼5.69672.84 ▲34.7462.46 ▲14.98
Media Library /wp-admin/upload.php1,385 ▼04.19 ▲0.0499.38 ▲1.1043.98 ▲1.16

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woocommerce-other-payment-gateway/class-woocommerce-other-payment-gateway.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/woocommerce-other-payment-gateway/woocommerce-other-payment-gateway.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: payment gateway, custom payment, payment, other payment, payment option...

woocommerce-other-payment-gateway/woocommerce-other-payment-gateway.php 92% from 13 tests

The main file in "WooCommerce Custom Payment Gateway" v. 1.3.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin257 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22628220
PO File191137

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin