89% wc-moneris-payment-gateway

Code Review | WC Moneris Payment Gateway

WordPress plugin WC Moneris Payment Gateway scored89%from 54 tests.

About plugin

  • Plugin page: wc-moneris-paymen...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Nov 11, 2017
  • Latest release: Jun 19, 2023
  • Number of updates: 77
  • Update frequency: every 26.6 days
  • Top authors: akshayaswaroop (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

900+ active /13,086 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.16ms] Passed 4 tests

Server-side resources used by WC Moneris Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0342.30 ▲0.02
Dashboard /wp-admin3.38 ▲0.0349.32 ▼1.93
Posts /wp-admin/edit.php3.49 ▲0.0949.54 ▼0.57
Add New Post /wp-admin/post-new.php5.96 ▲0.0386.16 ▼8.96
Media Library /wp-admin/upload.php3.30 ▲0.0336.58 ▼5.18

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WC Moneris Payment Gateway
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲1014.29 ▼0.311.86 ▼0.2344.06 ▲0.56
Dashboard /wp-admin2,202 ▲255.52 ▼0.0484.21 ▼5.9239.31 ▲0.08
Posts /wp-admin/edit.php2,107 ▲72.00 ▼0.0037.18 ▲1.8237.52 ▲0.79
Add New Post /wp-admin/post-new.php1,533 ▲723.10 ▲0.03639.43 ▼68.3264.38 ▲3.98
Media Library /wp-admin/upload.php1,404 ▲14.17 ▼0.0098.34 ▼0.6645.48 ▲2.56

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% 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: payment gateway, canada payment gateway, moneris, credit card, woocommerce moneris payment gateway...

wc-moneris-payment-gateway/wc-moneris-payment-gateway.php 85% from 13 tests

The entry point to "WC Moneris Payment Gateway" version 3.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 183 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin6,403 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP141,5776816,082
CSS2190152
PO File14854137
JSON20022
JavaScript10010

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity6.29
▷ Minimum class complexity1.00
▷ Maximum class complexity120.00
Average method complexity1.48
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes77
▷ Abstract classes00.00%
▷ Concrete classes77100.00%
▷ Final classes00.00%
Methods856
▷ Static methods171.99%
▷ Public methods82195.91%
▷ Protected methods80.93%
▷ Private methods273.15%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants15
▷ Global constants1066.67%
▷ Class constants533.33%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo.png1.74KB1.19KB▼ 31.88%
assets/images/logo-dark.png8.20KB2.88KB▼ 64.86%
assets/images/wp-heka-site-logo.png5.20KB0.97KB▼ 81.42%