74% wc-mtn-momo-payment-gateway

Code Review | Payment Gateway for MTN MoMo on WooCommerce

WordPress plugin Payment Gateway for MTN MoMo on WooCommerce scored74%from 54 tests.

About plugin

  • Plugin page: wc-mtn-momo-payme...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.2-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 18, 2020
  • Latest release: Aug 14, 2023
  • Number of updates: 29
  • Update frequency: every 39.0 days
  • Top authors: dennokip (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /4,966 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼8.45ms] Passed 4 tests

A check of server-side resources used by Payment Gateway for MTN MoMo on WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0838.04 ▼2.23
Dashboard /wp-admin3.38 ▲0.0741.78 ▼10.02
Posts /wp-admin/edit.php3.49 ▲0.1353.44 ▲4.57
Add New Post /wp-admin/post-new.php5.96 ▲0.0782.55 ▼20.79
Media Library /wp-admin/upload.php3.30 ▲0.0735.31 ▼0.74

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: 1 new table, 7 new options
New tables
wp_momo_trx
New WordPress options
widget_recent-comments
trx_db_version
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Payment Gateway for MTN MoMo on WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲11213.61 ▼0.957.06 ▲5.2739.75 ▼0.99
Dashboard /wp-admin2,209 ▲185.85 ▼0.05111.01 ▲11.1442.04 ▲0.54
Posts /wp-admin/edit.php2,092 ▼01.97 ▼0.0640.95 ▲7.0436.19 ▲4.36
Add New Post /wp-admin/post-new.php1,533 ▲1423.28 ▲0.31590.49 ▼68.7557.92 ▲5.22
Media Library /wp-admin/upload.php1,388 ▼04.21 ▼0.0296.11 ▼15.5740.32 ▼6.71

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_momo_trx
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • can_compress_scripts
    • trx_db_version
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wc-mtn-momo-payment-gateway/Gateway_Woocommerce_MoMo.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: mobile, mtn, mobile payments, momo, online...

wc-mtn-momo-payment-gateway/Gateway_Woocommerce_MoMo.php 92% from 13 tests

The main PHP script in "Payment Gateway for MTN MoMo on WooCommerce" version 1.0.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-mtn-momo-payment-gateway.php" instead of "Gateway_Woocommerce_MoMo.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected377 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP15783319
JavaScript122140
CSS10018

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.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%
Functions15
▷ Named functions960.00%
▷ Anonymous functions640.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
PNG images were not found in this plugin