74% magicway-payment-gateway

Code Review | MagicWay Payment Gateway

WordPress plugin MagicWay Payment Gateway scored74%from 54 tests.

About plugin

  • Plugin page: magicway-payment-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.7.1
  • WordPress version: 6.3.1
  • First release: Jul 7, 2021
  • Latest release: Jul 11, 2021
  • Number of updates: 5
  • Update frequency: every 1.0 days
  • Top authors: magicway (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /297 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by MagicWay Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.65 ▼5.33
Dashboard /wp-admin3.31 ▲0.0144.11 ▼9.81
Posts /wp-admin/edit.php3.36 ▲0.0146.36 ▼0.51
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.19 ▲1.59
Media Library /wp-admin/upload.php3.24 ▲0.0132.92 ▼2.36

Server storage [IO: ▲0.16MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
These are issues you should consider
  • You have illegally modified 2 files (0.00KB) outside of "wp-content/plugins/magicway-payment-gateway/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/magicway-payment-gateway/images/icon-256\303\227256.png"
    • (new file) "wp-content/plugins/magicway-payment-gateway/images/banner-772\303\227250.png"
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
magicway_easy_version
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by MagicWay Payment Gateway
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.28 ▼1.101.66 ▼0.1340.61 ▼8.48
Dashboard /wp-admin2,206 ▲155.89 ▲0.0195.85 ▼21.5740.72 ▼2.79
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0039.61 ▲2.4437.67 ▲0.32
Add New Post /wp-admin/post-new.php1,547 ▲2218.41 ▲0.89608.22 ▼80.5569.62 ▼5.39
Media Library /wp-admin/upload.php1,385 ▼34.21 ▼0.0294.37 ▼8.3344.65 ▼2.24

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'MagicwayPaymentDeactivator' not found or invalid function name
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • magicway_easy_version
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

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)
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/magicway-payment-gateway/momagic-securepay.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: payment, magicway, international-payment-gateway, cart, gateway...

magicway-payment-gateway/momagic-securepay.php 92% from 13 tests

This is the main PHP file of "MagicWay Payment Gateway" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("magicway-payment-gateway.php" instead of "momagic-securepay.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
Success! There were no dangerous files found in this plugin410 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34457410

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity43.00
▷ Minimum class complexity43.00
▷ Maximum class complexity43.00
Average method complexity4.82
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.37MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/banner-772×250.png229.53KB78.14KB▼ 65.95%
images/screenshot-1.png10.01KB6.31KB▼ 36.97%
images/icon-256×256.png17.11KB7.27KB▼ 57.49%
images/screenshot-3.png37.56KB19.71KB▼ 47.52%
images/mmbd-verified.png5.52KB3.19KB▼ 42.31%