10% ecommpay-payments

Code Review | ECOMMPAY Payments

WordPress plugin ECOMMPAY Payments scored10%from 54 tests.

About plugin

  • Plugin page: ecommpay-payments
  • Plugin version: 3.3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 1, 2023
  • Latest release: Oct 6, 2023
  • Number of updates: 26
  • Update frequency: every 9.7 days
  • Top authors: ecommpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /624 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Error in wp-content/plugins/ecommpay-payments/common/includes/class-ecp-gateway-form-handler.php+13
    Uncaught Error: Class 'WC_Form_Handler' not found in wp-content/plugins/ecommpay-payments/common/includes/class-ecp-gateway-form-handler.php:13
    Stack trace:
    #0 wp-content/plugins/ecommpay-payments/common/__autoload.php(56): require_once()
    #1 wp-content/plugins/ecommpay-payments/gateway-ecommpay.php(98): require_once('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): {closure}()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.36ms] Passed 4 tests

Analyzing server-side resources used by ECOMMPAY Payments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.08 ▼2.42
Dashboard /wp-admin3.31 ▲0.0059.15 ▼0.53
Posts /wp-admin/edit.php3.36 ▲0.0044.12 ▼7.38
Add New Post /wp-admin/post-new.php5.89 ▲0.00101.60 ▲10.68
Media Library /wp-admin/upload.php3.23 ▲0.0036.20 ▼3.10

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 158 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by ECOMMPAY Payments
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.68 ▼0.901.63 ▼0.1642.98 ▲1.97
Dashboard /wp-admin2,203 ▲215.83 ▼0.05125.32 ▼26.1848.80 ▼1.08
Posts /wp-admin/edit.php2,089 ▲212.00 ▼0.0537.81 ▲0.0432.90 ▼2.46
Add New Post /wp-admin/post-new.php1,538 ▲523.10 ▼0.11648.55 ▲2.9969.08 ▲17.82
Media Library /wp-admin/upload.php1,388 ▲34.22 ▲0.04134.18 ▲12.8750.06 ▲4.79

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/ecommpay-payments/views/fields/html-form-toggle-end.php
    • > /wp-content/plugins/ecommpay-payments/views/fields/html-form-fieldset-end.php
    • > /wp-content/plugins/ecommpay-payments/views/fields/html-form-fieldset-start.php
  • 29× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ecommpay-payments/helpers/notices.php:108
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Form_Handler' not found in wp-content/plugins/ecommpay-payments/common/includes/class-ecp-gateway-form-handler.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/ecommpay-payments/views/fields/html-form-toggle-start.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/ecommpay-payments/views/html-order-table-payment-data.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/ecommpay-payments/views/html-meta-box-payment-info.php:112
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ecp_get_log() in wp-content/plugins/ecommpay-payments/common/install/migrations/upgrade_settings_to_version_3.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Settings_API' not found in wp-content/plugins/ecommpay-payments/common/class-ecp-core.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ecommpay-payments/helpers/notices.php:108
    • > PHP Fatal error
      Uncaught Error: Class 'Ecp_Gateway_Registry' not found in wp-content/plugins/ecommpay-payments/common/modules/class-ecp-gateway-signer.php:12
    • > PHP Notice
      Undefined variable: is_test in wp-content/plugins/ecommpay-payments/views/html-meta-box-subscription.php on line 30

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
Please take inspiration from this readme.txt

ecommpay-payments/gateway-ecommpay.php 85% from 13 tests

The main PHP file in "ECOMMPAY Payments" ver. 3.3.4 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ecommpay-payments.php" instead of "gateway-ecommpay.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected13,923 lines of code in 154 files:
LanguageFilesBlank linesComment linesLines of code
PHP1202,5066,92110,903
PO File25477301,586
JavaScript58215591
SVG2407477
CSS3661366

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity9.37
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity1.98
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces2
Traits1
Classes83
▷ Abstract classes44.82%
▷ Concrete classes7995.18%
▷ Final classes22.53%
Methods758
▷ Static methods668.71%
▷ Public methods60780.08%
▷ Protected methods587.65%
▷ Private methods9312.27%
Functions97
▷ Named functions7173.20%
▷ Anonymous functions2626.80%
Constants332
▷ Global constants10.30%
▷ Class constants33199.70%
▷ Public constants331100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin