83% worldnet-payments-gateway-for-woocommerce

Code Review | Worldnet Payments Gateway for WooCommerce

WordPress plugin Worldnet Payments Gateway for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: worldnet-payments...
  • Plugin version: 2.7.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-6.3.2
  • WordPress version: 6.3.1
  • First release: Dec 11, 2019
  • Latest release: Nov 21, 2023
  • Number of updates: 31
  • Update frequency: every 46.5 days
  • Top authors: bbondane (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,852 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.33MB] [CPU: ▼6.16ms] Passed 4 tests

A check of server-side resources used by Worldnet Payments Gateway for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3337.25 ▼13.83
Dashboard /wp-admin3.63 ▲0.3348.54 ▼3.83
Posts /wp-admin/edit.php3.75 ▲0.3947.51 ▲0.35
Add New Post /wp-admin/post-new.php6.22 ▲0.3285.35 ▼6.81
Media Library /wp-admin/upload.php3.56 ▲0.3237.46 ▼0.17

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
wc_worldnetpayments_version
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Worldnet Payments Gateway for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3114.03 ▼0.601.73 ▲0.0738.29 ▼7.81
Dashboard /wp-admin2,201 ▲215.64 ▼0.0393.97 ▲1.1242.67 ▲1.16
Posts /wp-admin/edit.php2,103 ▲31.96 ▼0.0540.50 ▲3.8035.26 ▲2.34
Add New Post /wp-admin/post-new.php1,529 ▲323.07 ▼0.26635.73 ▼28.9549.05 ▼7.38
Media Library /wp-admin/upload.php1,403 ▼04.20 ▼0.0195.96 ▼4.3742.22 ▼2.48

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • wc_worldnetpayments_version
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/worldnet-payments-gateway-for-woocommerce/includes/worldnetpayments_gateway_xml_api.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: payment, woocommerce, gateway

worldnet-payments-gateway-for-woocommerce/worldnetpayments-gateway-for-woocommerce.php 85% from 13 tests

"Worldnet Payments Gateway for WooCommerce" version 2.7.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("worldnet-payments-gateway-for-woocommerce.php" instead of "worldnetpayments-gateway-for-woocommerce.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected5,863 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP59948514,683
JavaScript414281789
SVG10510391

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 154)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity31.72
▷ Minimum class complexity1.00
▷ Maximum class complexity391.00
Average method complexity5.16
▷ Minimum method complexity1.00
▷ Maximum method complexity154.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes29
▷ Abstract classes13.45%
▷ Concrete classes2896.55%
▷ Final classes00.00%
Methods212
▷ Static methods125.66%
▷ Public methods20596.70%
▷ Protected methods52.36%
▷ Private methods20.94%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants6
▷ Global constants6100.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
No PNG files were detected