64% paym8-gateway

Code Review | PayM8 Gateway

WordPress plugin PayM8 Gateway scored64%from 54 tests.

About plugin

  • Plugin page: paym8-gateway
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jan 18, 2022
  • Latest release: Jun 22, 2023
  • Number of updates: 5
  • Update frequency: every 106.0 days
  • Top authors: paym8payments (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /589 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Analyzing server-side resources used by PayM8 Gateway
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.25 ▲0.49
Dashboard /wp-admin3.32 ▼0.0249.83 ▼16.26
Posts /wp-admin/edit.php3.37 ▲0.0250.78 ▼3.38
Add New Post /wp-admin/post-new.php5.90 ▲0.02100.52 ▼2.06
Media Library /wp-admin/upload.php3.24 ▲0.0234.72 ▼0.06

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for PayM8 Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.27 ▲0.002.20 ▲0.3346.01 ▲2.55
Dashboard /wp-admin2,195 ▲285.65 ▼0.0497.73 ▼9.5440.33 ▼3.47
Posts /wp-admin/edit.php2,100 ▲32.02 ▲0.0539.28 ▲1.7338.10 ▼2.72
Add New Post /wp-admin/post-new.php1,535 ▼618.39 ▼4.71634.77 ▼12.9272.29 ▲19.36
Media Library /wp-admin/upload.php1,403 ▲64.21 ▲0.0195.31 ▼7.1843.73 ▼0.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Error in wp-content/plugins/paym8-gateway/wc-gateway-paym8-plugin.php+136
    Uncaught Error: Call to undefined function wc_get_logger() in wp-content/plugins/paym8-gateway/wc-gateway-paym8-plugin.php:136
    Stack trace:
    #0 wp-content/plugins/paym8-gateway/wc-gateway-paym8-plugin.php(103): logger()
    #1 wp-includes/class-wp-hook.php(310): paym8_uninstall_gateway()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(1269): do_action()
    #5 wp-admin/includes/plugin.php(960): uninstall_plugin()
  • The plugin did not uninstall correctly, leaving 12 files (0.09MB) in the plugin directory
    • (new file) assets/images/payM8LoginLettering-withoutAxis.png
    • (new file) assets/images/paym8Logo.png
    • (new file) assets/images/payM8LoginLettering.png
    • (new file) README.md
    • (new file) changelog.txt
    • (new file) assets/images/paym8LogoRounded.png
    • (new file) includes/css/loading.gif
    • (new file) includes/class-wc-gateway-paym8.php
    • (new file) assets/images/exclamationMark2.png
    • (new file) assets/images/exclamationMark.png
    • ...
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • db_upgraded

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

SRP 50% from 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
Please fix the following
  • 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/paym8-gateway/includes/class-wc-gateway-paym8.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Requires php: The plugin version is formatted incorrectly
Please take inspiration from this readme.txt

paym8-gateway/wc-gateway-paym8-plugin.php 92% from 13 tests

The entry point to "PayM8 Gateway" version 1.1 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: Name the main plugin file the same as the plugin slug ("paym8-gateway.php" instead of "wc-gateway-paym8-plugin.php")

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
There were no executable files found in this plugin421 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP288239347
CSS16647
Markdown113027

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.24
Average class complexity33.00
▷ Minimum class complexity33.00
▷ Maximum class complexity33.00
Average method complexity3.46
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods1184.62%
▷ Protected methods00.00%
▷ Private methods215.38%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
6 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/paym8Logo.png14.54KB8.08KB▼ 44.45%
assets/images/payM8LoginLettering-withoutAxis.png10.14KB4.14KB▼ 59.19%
assets/images/paym8LogoRounded.png16.47KB8.20KB▼ 50.21%
assets/images/exclamationMark2.png0.38KB0.49KB0.00%
assets/images/payM8LoginLettering.png12.12KB4.71KB▼ 61.12%