78% pay-with-mtn-momo-woocommerce

Code Review | Pay with MTN MoMo in WooCommerce

WordPress plugin Pay with MTN MoMo in WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: pay-with-mtn-momo...
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.0-6.1
  • WordPress version: 6.3.1
  • First release: Feb 7, 2021
  • Latest release: Dec 1, 2022
  • Number of updates: 28
  • Update frequency: every 23.8 days
  • Top authors: mstonys (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

500+ active /10,140 total downloads

Benchmarks

Plugin footprint 83% 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 gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.44ms] Passed 4 tests

Server-side resources used by Pay with MTN MoMo in WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0441.10 ▼2.61
Dashboard /wp-admin3.34 ▼0.0152.83 ▼1.81
Posts /wp-admin/edit.php3.39 ▲0.0352.65 ▲3.63
Add New Post /wp-admin/post-new.php5.95 ▲0.0690.45 ▼19.77
Media Library /wp-admin/upload.php3.27 ▲0.0338.28 ▲2.42

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: 1 new table, 7 new options
New tables
wp_momopay_payments
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
wp_momopay_payments_db_version
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Pay with MTN MoMo in WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲14013.45 ▼0.939.57 ▲7.7643.52 ▲2.27
Dashboard /wp-admin2,202 ▲225.67 ▼0.0389.66 ▲2.5741.47 ▲2.40
Posts /wp-admin/edit.php2,104 ▲42.01 ▼0.0137.14 ▲0.0933.14 ▼1.65
Add New Post /wp-admin/post-new.php1,530 ▲423.14 ▼0.37698.49 ▲72.2947.18 ▼5.13
Media Library /wp-admin/upload.php1,404 ▲44.22 ▲0.01105.63 ▲0.8945.92 ▲1.40

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
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • wp_momopay_payments_db_version
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/pay-with-mtn-momo-woocommerce/mtn-momo-pay.php
  • 1× 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/pay-with-mtn-momo-woocommerce/classes/class_momo_pay_gateway.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: mtn momo, mtn, mobile money, momo, woocommerce...

pay-with-mtn-momo-woocommerce/mtn-momo-pay.php 77% from 13 tests

"Pay with MTN MoMo in WooCommerce" version 1.0.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pay-with-mtn-momo-woocommerce.php" instead of "mtn-momo-pay.php")
  • Requires at least: Required version must match the one declared in readme.txt ("5.0" instead of "4.2.0")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
No dangerous file extensions were detected1,570 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5252721,358
JavaScript2280159
CSS19153

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity32.00
▷ Minimum class complexity1.00
▷ Maximum class complexity104.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods52
▷ Static methods1834.62%
▷ Public methods2955.77%
▷ Protected methods2344.23%
▷ Private methods00.00%
Functions12
▷ Named functions1191.67%
▷ Anonymous functions18.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/mtn-momo-logo.png60.35KB16.00KB▼ 73.49%