84% echbay-momo-woo

Code Review | EchBay Integrate MoMo paygate into WooCommerce

WordPress plugin EchBay Integrate MoMo paygate into WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: echbay-momo-woo
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3
  • WordPress version: 6.3.1
  • First release: Apr 26, 2022
  • Latest release: Nov 14, 2023
  • Number of updates: 11
  • Update frequency: every 51.6 days
  • Top authors: itvn9online (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /656 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by EchBay Integrate MoMo paygate into WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0738.37 ▼3.62
Dashboard /wp-admin3.37 ▲0.0246.71 ▼14.89
Posts /wp-admin/edit.php3.49 ▲0.1347.26 ▲1.28
Add New Post /wp-admin/post-new.php5.96 ▲0.0682.10 ▼28.98
Media Library /wp-admin/upload.php3.30 ▲0.0635.55 ▼0.39

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 31 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
momo_settings
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

EchBay Integrate MoMo paygate into WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲1814.20 ▼0.011.77 ▼0.3643.05 ▼4.07
Dashboard /wp-admin2,198 ▲245.61 ▼0.0790.06 ▼2.7840.99 ▲3.25
Posts /wp-admin/edit.php2,103 ▲31.96 ▼0.0439.30 ▲3.3137.42 ▲0.80
Add New Post /wp-admin/post-new.php1,526 ▼923.39 ▼1.69609.89 ▼7.2849.68 ▼14.11
Media Library /wp-admin/upload.php1,400 ▼04.13 ▼0.0099.68 ▼2.1141.58 ▼0.80

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • momo_settings
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • 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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Interface 'momo\\Facades\\FacadeResponse' not found in wp-content/plugins/echbay-momo-woo/src/momoResponse.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/echbay-momo-woo/src/gateways/momoGateway.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'momo\\Responses\\momoResponse' not found in wp-content/plugins/echbay-momo-woo/src/gateways/momoInternationalResponse.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (MoMo paygate setting in admin.) image missing
You can look at the official readme.txt

echbay-momo-woo/momo.php 92% from 13 tests

The main PHP file in "EchBay Integrate MoMo paygate into WooCommerce" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
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 ("echbay-momo-woo.php" instead of "momo.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected918 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP16011916
JSON2002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity8.91
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces1
Traits1
Classes9
▷ Abstract classes111.11%
▷ Concrete classes888.89%
▷ Final classes00.00%
Methods60
▷ Static methods35.00%
▷ Public methods5795.00%
▷ Protected methods11.67%
▷ Private methods23.33%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants1
▷ Global constants1100.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
7 PNG files occupy 0.07MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/momo_icon_circle_pinkbg_RGB.png3.08KB3.19KB0.00%
favicon_eb.png3.39KB3.51KB0.00%
favicon_wgr.png2.23KB2.27KB0.00%
favicon.png2.23KB2.27KB0.00%
favicon-full.png53.11KB10.79KB▼ 79.67%