93% mistral-pay-woocommerce-payment-gateway

Code Review | Mistralpay Payment Gateway for Woocommerce

WordPress plugin Mistralpay Payment Gateway for Woocommerce scored 93% from 54 tests.

About plugin

  • Plugin page: mistral-pay-wooco...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.3.1
  • WordPress version: 5.8.1
  • First release: Sep 17, 2015
  • Latest release: Sep 17, 2015
  • Number of updates: 3
  • Update frequency: every 14.0 days
  • Top authors: Mistralpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 625 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Analyzing server-side resources used by Mistralpay Payment Gateway for Woocommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1841.90 ▲22.11
Dashboard /wp-admin3.12 ▲0.0744.76 ▼4.35
Posts /wp-admin/edit.php3.18 ▲0.0751.60 ▲4.77
Add New Post /wp-admin/post-new.php5.48 ▲0.05101.88 ▼2,607.93
Media Library /wp-admin/upload.php3.07 ▲0.0738.47 ▲1.66

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Mistralpay Payment Gateway for Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.94 ▲0.4210.98 ▼0.2753.83 ▼2.25
Dashboard /wp-admin2,967 ▲365.90 ▼0.21155.04 ▲6.19122.33 ▲15.85
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0070.61 ▼5.0993.26 ▼6.21
Add New Post /wp-admin/post-new.php1,615 ▼6821.46 ▲2.79297.28 ▼114.42121.69 ▲1.34
Media Library /wp-admin/upload.php1,807 ▼05.04 ▲0.02160.82 ▼3.39131.04 ▲8.26

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mistral-pay-woocommerce-payment-gateway/class-wc-gateway-mistralpay.php:19

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 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tested up to: Invalid version format
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === mistral-pay-woocommerce-payment-gateway === )
The official readme.txt is a good inspiration

mistral-pay-woocommerce-payment-gateway/class-wc-gateway-mistralpay.php 85% from 13 tests

The main file in "Mistralpay Payment Gateway for Woocommerce" v. 0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Version: The plugin version was missing
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mistral-pay-woocommerce-payment-gateway.php" instead of "class-wc-gateway-mistralpay.php")

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
Success! There were no dangerous files found in this plugin315 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13768315

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity34.00
▷ Minimum class complexity34.00
▷ Maximum class complexity34.00
Average method complexity4.75
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin