94% woocommerce-custom-payment-gateways

Code Review | WooCommerce Custom Payment Gateways

WordPress plugin WooCommerce Custom Payment Gateways scored 94% from 54 tests.

About plugin

  • Plugin page: woocommerce-custo...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Aug 3, 2013
  • Latest release: Aug 3, 2013
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: royaltechbd (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

300+ active / 9,862 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by WooCommerce Custom Payment Gateways
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0255.34 ▲7.22
Dashboard /wp-admin3.42 ▲0.0241.97 ▲5.98
Posts /wp-admin/edit.php3.65 ▲0.0258.66 ▲18.08
Add New Post /wp-admin/post-new.php6.89 ▼0.0894.08 ▼1,243.04
Media Library /wp-admin/upload.php3.31 ▲0.0127.73 ▲1.07

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Custom Payment Gateways
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,760 ▲1615.33 ▼0.285.52 ▼2.052.61 ▲0.29
Dashboard /wp-admin2,885 ▲276.02 ▼0.21117.49 ▼16.39162.62 ▲0.35
Posts /wp-admin/edit.php2,700 ▲93.23 ▼0.0168.28 ▲3.50148.78 ▲0.92
Add New Post /wp-admin/post-new.php1,647 ▼6421.91 ▲1.17438.50 ▼30.33174.24 ▼24.21
Media Library /wp-admin/upload.php1,709 ▲145.53 ▲0.02151.09 ▲9.94191.14 ▼45.58

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woocommerce-custom-payment-gateways/woocommerce-custom-payment-gateways.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woocommerce-custom-payment-gateways/class-wc-custom_payment_gateway_2.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woocommerce-custom-payment-gateways/class-wc-custom_payment_gateway_5.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woocommerce-custom-payment-gateways/class-wc-custom_payment_gateway_4.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woocommerce-custom-payment-gateways/class-wc-custom_payment_gateway_3.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woocommerce-custom-payment-gateways/class-wc-custom_payment_gateway_1.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Requires at least: The plugin version is formatted incorrectly
You can take inspiration from this readme.txt

woocommerce-custom-payment-gateways/woocommerce-custom-payment-gateways.php Passed 13 tests

The entry point to "WooCommerce Custom Payment Gateways" version 1.0.0 is a PHP file that has certain tags in its header comment area
44 characters long description:
Add Custom Payment Gateways for WooCommerce.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin476 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP6161119476

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected