84% mifinity-payments-gateway

Code Review | MiFinity Payments Gateway

WordPress plugin MiFinity Payments Gateway scored84%from 54 tests.

About plugin

  • Plugin page: mifinity-payments...
  • Plugin version: 1.0.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.8
  • WordPress version: 6.3.1
  • First release: Sep 6, 2021
  • Latest release: Nov 23, 2021
  • Number of updates: 29
  • Update frequency: every 2.8 days
  • Top authors: mifinityguestpayment (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,832 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

An overview of server-side resources used by MiFinity Payments Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0145.84 ▼4.43
Dashboard /wp-admin3.32 ▲0.0253.56 ▲0.11
Posts /wp-admin/edit.php3.37 ▲0.0157.93 ▲5.65
Add New Post /wp-admin/post-new.php5.90 ▲0.0197.78 ▼8.47
Media Library /wp-admin/upload.php3.24 ▲0.0136.68 ▼0.22

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for MiFinity Payments Gateway
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.371.62 ▼0.1045.06 ▼0.52
Dashboard /wp-admin2,195 ▲185.52 ▼0.1486.63 ▼14.0440.36 ▼3.76
Posts /wp-admin/edit.php2,100 ▼01.98 ▲0.0341.07 ▲3.8438.22 ▼0.75
Add New Post /wp-admin/post-new.php1,528 ▼023.24 ▲0.25637.82 ▼86.9148.93 ▼8.49
Media Library /wp-admin/upload.php1,400 ▼04.17 ▲0.0196.27 ▼17.2546.39 ▼2.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway_CC' not found in wp-content/plugins/mifinity-payments-gateway/includes/class-wc-payment-gateway-mifinity.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Contributors: Contributors not specified
The official readme.txt is a good inspiration

mifinity-payments-gateway/gateway.php 92% from 13 tests

This is the main PHP file of "MiFinity Payments Gateway" version 1.0.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("mifinity-payments-gateway.php" instead of "gateway.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
Success! There were no dangerous files found in this plugin855 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP3121147477
JavaScript1379244
SVG101134

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity21.33
▷ Minimum class complexity3.00
▷ Maximum class complexity52.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2696.30%
▷ Protected methods13.70%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/pci.png12.58KB12.58KB0.00%
assets/images/mifinity.png1.56KB0.87KB▼ 44.37%