83% wc-sudan-payment-gateway

Code Review | Sudan Payment Gateway for WooCommerce

WordPress plugin Sudan Payment Gateway for WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: wc-sudan-payment-...
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.2
  • WordPress version: 6.3.1
  • First release: May 3, 2023
  • Latest release: May 13, 2023
  • Number of updates: 5
  • Update frequency: every 2.0 days
  • Top authors: aminomer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 203 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.33ms] Passed 4 tests

A check of server-side resources used by Sudan Payment Gateway for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.89 ▼4.30
Dashboard /wp-admin3.31 ▲0.0046.55 ▼3.27
Posts /wp-admin/edit.php3.36 ▲0.0044.58 ▼4.30
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.36 ▼9.45
Media Library /wp-admin/upload.php3.23 ▲0.0033.31 ▼1.11

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Sudan Payment Gateway for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.23 ▼1.141.84 ▲0.0137.85 ▼8.62
Dashboard /wp-admin2,206 ▲215.83 ▼0.0694.32 ▼4.8138.23 ▼4.24
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0436.21 ▼8.9933.13 ▼1.77
Add New Post /wp-admin/post-new.php1,536 ▲1223.73 ▲0.49625.40 ▲15.1251.18 ▲1.06
Media Library /wp-admin/upload.php1,388 ▲64.24 ▲0.07101.83 ▲1.3244.44 ▲0.56

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/wc-sudan-payment-gateway/includes/wc-sudan-payment-gateway.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: payment, woocommerce, bank of khartoum, mbok, sudan

wc-sudan-payment-gateway/wc-sudan-payment-gateway.php 77% from 13 tests

The principal PHP file in "Sudan Payment Gateway for WooCommerce" v. 1.2.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • 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
  • Description: Please don't use more than 140 characters for the plugin description (currently 512 characters long)
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "5.5")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin921 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP310584528
CSS2342203
PO File14857136
JavaScript28854

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity29.50
▷ Minimum class complexity16.00
▷ Maximum class complexity43.00
Average method complexity3.85
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1995.00%
▷ Protected methods00.00%
▷ Private methods15.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There were not PNG files found in your plugin