78% capital-epay-woocommerce-payment-gateway

Code Review | WooCommerce Payment Gateway - Capital ePay

WordPress plugin WooCommerce Payment Gateway - Capital ePay scored78%from 54 tests.

About plugin

  • Plugin page: capital-epay-wooc...
  • Plugin version: 3.3.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.9-6.2.2
  • WordPress version: 6.3.1
  • First release: May 11, 2018
  • Latest release: May 21, 2023
  • Number of updates: 148
  • Update frequency: every 12.4 days
  • Top authors: capitalepay (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active /11,372 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

Server-side resources used by WooCommerce Payment Gateway - Capital ePay
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.31 ▼3.23
Dashboard /wp-admin3.31 ▲0.0148.77 ▼1.27
Posts /wp-admin/edit.php3.36 ▲0.0149.86 ▼1.98
Add New Post /wp-admin/post-new.php5.91 ▲0.0396.51 ▼0.59
Media Library /wp-admin/upload.php3.24 ▲0.0138.01 ▼0.31

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Payment Gateway - Capital ePay
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6214.25 ▼0.032.13 ▲0.1143.42 ▲1.17
Dashboard /wp-admin2,197 ▲175.55 ▼0.1183.37 ▼18.1339.66 ▼3.31
Posts /wp-admin/edit.php2,105 ▲52.15 ▲0.1440.33 ▲2.4035.10 ▼1.69
Add New Post /wp-admin/post-new.php1,535 ▲922.95 ▼0.08623.77 ▼34.7552.44 ▲2.29
Media Library /wp-admin/upload.php1,405 ▲54.17 ▼0.0799.41 ▼11.5743.27 ▼2.74

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/capital-epay-woocommerce-payment-gateway/credit-card/connection.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/capital-epay-woocommerce-payment-gateway/woocommerce-capitalepay.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/capital-epay-woocommerce-payment-gateway/e-check/class-cepay-payment-gateway-echeck.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway_CC' not found in wp-content/plugins/capital-epay-woocommerce-payment-gateway/credit-card/class-cepay-payment-gateway-cc.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes: You can take inspiration from this readme.txt

capital-epay-woocommerce-payment-gateway/woocommerce-capitalepay.php 85% from 13 tests

The primary PHP file in "WooCommerce Payment Gateway - Capital ePay" version 3.3.4 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("capital-epay-woocommerce-payment-gateway.php" instead of "woocommerce-capitalepay.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.4" instead of "3.0.9")

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
Success! There were no dangerous files found in this plugin1,573 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP73033911,445
CSS116194
JavaScript211534

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity55.50
▷ Minimum class complexity25.00
▷ Maximum class complexity86.00
Average method complexity4.63
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.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
No PNG files were detected