89% wc-nuvei-payment-gateway

Code Review | Payment Gateway for Nuvei on WooCommerce

WordPress plugin Payment Gateway for Nuvei on WooCommerce scored 89% from 54 tests.

About plugin

  • Plugin page: wc-nuvei-payment-...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 17, 2022
  • Latest release: Apr 3, 2023
  • Number of updates: 10
  • Update frequency: every 38.2 days
  • Top authors: dmitrylitvinov (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,245 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.08MB] [CPU: ▼6.24ms] Passed 4 tests

A check of server-side resources used by Payment Gateway for Nuvei on WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0835.90 ▼2.78
Dashboard /wp-admin3.39 ▲0.0843.84 ▼3.20
Posts /wp-admin/edit.php3.50 ▲0.1446.33 ▲4.42
Add New Post /wp-admin/post-new.php5.97 ▲0.0884.13 ▼18.36
Media Library /wp-admin/upload.php3.31 ▲0.0834.98 ▼0.63

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Payment Gateway for Nuvei on WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▲0.121.74 ▼0.0835.99 ▼3.53
Dashboard /wp-admin2,206 ▲155.91 ▲1.00109.47 ▲2.7844.01 ▲3.03
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0632.92 ▼7.5331.95 ▼3.97
Add New Post /wp-admin/post-new.php1,513 ▼3117.77 ▼0.53631.92 ▲7.4854.43 ▲0.43
Media Library /wp-admin/upload.php1,382 ▼94.26 ▲0.02100.73 ▼5.8143.24 ▲0.18

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests Passed 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 no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The SRP test was a success

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wc-nuvei-payment-gateway === )
Please take inspiration from this readme.txt

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

The main PHP file in "Payment Gateway for Nuvei on WooCommerce" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.7" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin398 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP184127398

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.29
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods425.00%
▷ Public methods1593.75%
▷ Protected methods16.25%
▷ Private methods00.00%
Functions7
▷ Named functions342.86%
▷ Anonymous functions457.14%
Constants4
▷ Global constants4100.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
No PNG files were detected