74% woo-m-pesa-payment-gateway

Code Review | WooCommerce M-PESA Payment Gateway

WordPress plugin WooCommerce M-PESA Payment Gateway scored 74% from 54 tests.

About plugin

  • Plugin page: woo-m-pesa-paymen...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.2-6.2
  • WordPress version: 6.3.1
  • First release: Oct 8, 2018
  • Latest release: May 12, 2023
  • Number of updates: 30
  • Update frequency: every 55.9 days
  • Top authors: dennokip (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active / 19,492 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼6.27ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce M-PESA Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.63 ▼2.78
Dashboard /wp-admin3.37 ▲0.0646.27 ▼6.53
Posts /wp-admin/edit.php3.42 ▲0.0647.81 ▲2.52
Add New Post /wp-admin/post-new.php5.95 ▲0.0690.71 ▼14.21
Media Library /wp-admin/upload.php3.29 ▲0.0634.76 ▼1.54

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 6 new files
Database: 1 new table, 7 new options
New tables
wp_mpesa_trx
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
trx_db_version
db_upgraded

Browser metrics Passed 4 tests

WooCommerce M-PESA Payment Gateway: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲14814.00 ▼0.306.95 ▲4.9435.85 ▼8.18
Dashboard /wp-admin2,209 ▲185.80 ▼0.1196.59 ▼9.0540.29 ▼1.69
Posts /wp-admin/edit.php2,089 ▼32.04 ▼0.0839.07 ▲4.2735.07 ▲3.35
Add New Post /wp-admin/post-new.php1,542 ▼018.54 ▲0.45608.46 ▼3.2853.81 ▼2.35
Media Library /wp-admin/upload.php1,391 ▲34.26 ▲0.0799.34 ▲3.9841.12 ▼0.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie tables were found after uninstall: 1 table
    • wp_mpesa_trx
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • trx_db_version
    • db_upgraded
    • widget_recent-posts

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/woo-m-pesa-payment-gateway/Woocommerce_mpesa.php

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Payment Gateways List2. Settings page 13. Settings page 24. Request accepted5. Transaction in progress6. Customer action response) image required
Please take inspiration from this readme.txt

woo-m-pesa-payment-gateway/Woocommerce_mpesa.php 92% from 13 tests

The entry point to "WooCommerce M-PESA Payment Gateway" version 1.0.0 is a PHP file that has certain tags in its header comment area
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 ("woo-m-pesa-payment-gateway.php" instead of "Woocommerce_mpesa.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin331 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP150477275
JavaScript150238
CSS10018

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.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%
Functions12
▷ Named functions650.00%
▷ Anonymous functions650.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
There are no PNG files in this plugin