78% cartasi-x-pay

Code Review | Nexi XPay

WordPress plugin Nexi XPay scored78%from 54 tests.

About plugin

  • Plugin page: cartasi-x-pay
  • Plugin version: 7.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Feb 13, 2017
  • Latest release: Oct 10, 2023
  • Number of updates: 149
  • Update frequency: every 16.3 days
  • Top authors: cartasi (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

4,000+ active /43,891 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼12.51ms] Passed 4 tests

A check of server-side resources used by Nexi XPay
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0337.63 ▼7.38
Dashboard /wp-admin3.38 ▼0.0151.67 ▼13.90
Posts /wp-admin/edit.php3.49 ▲0.1048.29 ▼7.29
Add New Post /wp-admin/post-new.php5.96 ▲0.0390.40 ▼21.46
Media Library /wp-admin/upload.php3.30 ▲0.0335.87 ▼3.14

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 46 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Nexi XPay
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.66 ▲0.261.73 ▼0.0542.53 ▼2.58
Dashboard /wp-admin2,198 ▲275.62 ▲0.0494.72 ▲7.1143.41 ▲1.96
Posts /wp-admin/edit.php2,100 ▼31.96 ▼0.0140.48 ▼0.1735.71 ▼3.70
Add New Post /wp-admin/post-new.php1,526 ▼023.07 ▲0.03610.20 ▼21.9656.14 ▲3.13
Media Library /wp-admin/upload.php1,403 ▲34.17 ▼0.0198.76 ▼14.4744.76 ▼3.25

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 output text when accessed directly:
    • > /wp-content/plugins/cartasi-x-pay/templates/npg_payment_detail.php
  • 25× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Nexi\\WC_Gateway_XPay_Generic_Method' not found in wp-content/plugins/cartasi-x-pay/src/classes/Nexi/WC_Gateway_XPay_Cards_Build.php:16
    • > PHP Notice
      Undefined variable: orderInfo in wp-content/plugins/cartasi-x-pay/templates/npg_payment_detail.php on line 66
    • > PHP Notice
      Undefined variable: showOperations in wp-content/plugins/cartasi-x-pay/templates/npg_payment_detail.php on line 10
    • > PHP Fatal error
      Uncaught Error: Class 'Nexi\\WC_Gateway_NPG_Generic_Method' not found in wp-content/plugins/cartasi-x-pay/src/classes/Nexi/WC_Gateway_NPG_Cards_Build.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Token_CC' not found in wp-content/plugins/cartasi-x-pay/src/classes/Nexi/WC_NPG_Token.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/cartasi-x-pay/src/classes/Nexi/WC_Gateway_Admin.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/cartasi-x-pay/src/classes/Nexi/WC_Pending_Status.php:15
    • > PHP Notice
      Undefined variable: showOperations in wp-content/plugins/cartasi-x-pay/templates/npg_payment_detail.php on line 94
    • > PHP Fatal error
      Uncaught Error: Class 'Nexi\\WC_Gateway_XPay_Generic_Method' not found in wp-content/plugins/cartasi-x-pay/src/classes/Nexi/WC_Gateway_XPay_Cards.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Nexi\\WC_Gateway_XPay_Generic_Method' not found in wp-content/plugins/cartasi-x-pay/src/classes/Nexi/WC_Gateway_NPG_Generic_Method.php:16

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 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 your attention:
  • Tags: There are too many tags (20 tag instead of maximum 10)
The official readme.txt might help

cartasi-x-pay/woocommerce-gateway-nexi-xpay.php 85% from 13 tests

This is the main PHP file of "Nexi XPay" version 7.2.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("cartasi-x-pay.php" instead of "woocommerce-gateway-nexi-xpay.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected12,126 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP351,37373510,501
PO File1212275632
JavaScript511941575
CSS24620225
Markdown1660193

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity22.86
▷ Minimum class complexity1.00
▷ Maximum class complexity105.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes28
▷ Abstract classes27.14%
▷ Concrete classes2692.86%
▷ Final classes00.00%
Methods210
▷ Static methods11353.81%
▷ Public methods14870.48%
▷ Protected methods20.95%
▷ Private methods6028.57%
Functions18
▷ Named functions1688.89%
▷ Anonymous functions211.11%
Constants36
▷ Global constants36100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin