89% woo-gateway-mc2p

Code Review | WooCommerce MyChoice2Pay Payment Gateway

WordPress plugin WooCommerce MyChoice2Pay Payment Gateway scored89%from 54 tests.

About plugin

  • Plugin page: woo-gateway-mc2p
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 18, 2017
  • Latest release: Mar 8, 2019
  • Number of updates: 19
  • Update frequency: every 28.3 days
  • Top authors: mychoice2pay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /908 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Analyzing server-side resources used by WooCommerce MyChoice2Pay Payment Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0640.85 ▼1.06
Dashboard /wp-admin3.40 ▲0.0649.27 ▼3.94
Posts /wp-admin/edit.php3.52 ▲0.1253.24 ▲4.18
Add New Post /wp-admin/post-new.php5.99 ▲0.06104.84 ▼1.02
Media Library /wp-admin/upload.php3.33 ▲0.0639.32 ▲1.88

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce MyChoice2Pay Payment Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.34 ▼0.211.83 ▲0.2047.89 ▲4.24
Dashboard /wp-admin2,195 ▲155.57 ▼0.0591.01 ▲4.6643.91 ▼2.22
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0740.03 ▲3.1135.60 ▼0.49
Add New Post /wp-admin/post-new.php1,526 ▼023.10 ▼0.18660.22 ▼25.3060.62 ▲8.88
Media Library /wp-admin/upload.php1,394 ▼94.18 ▼0.05101.03 ▲1.9144.83 ▼1.74

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests Passed 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)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

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 90% 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: gateway, bitcoin, divvy, payments, credit card...

woo-gateway-mc2p/wc_gateway_mc2p.php 77% from 13 tests

The main PHP script in "WooCommerce MyChoice2Pay Payment Gateway" version 1.2.4 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-gateway-mc2p.php" instead of "wc_gateway_mc2p.php")
  • Domain Path: The domain path folder does not exist ("/i18n/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,307 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP92807301,230
PO File123064
Markdown112013

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity2.03
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity1.49
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes59
▷ Abstract classes11.69%
▷ Concrete classes5898.31%
▷ Final classes00.00%
Methods125
▷ Static methods10.80%
▷ Public methods11289.60%
▷ Protected methods64.80%
▷ Private methods75.60%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants00.00%
▷ Class constants10100.00%
▷ Public constants10100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/mc2p.png2.96KB2.00KB▼ 32.50%