83% dusupay-payment-gateway-for-woocommerce

Code Review | Dusupay Woocommerce Gateway

WordPress plugin Dusupay Woocommerce Gateway scored83%from 54 tests.

About plugin

  • Plugin page: dusupay-payment-g...
  • Plugin version: 2.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7
  • WordPress version: 6.3.1
  • First release: Apr 13, 2016
  • Latest release: Mar 17, 2021
  • Number of updates: 42
  • Update frequency: every 42.9 days
  • Top authors: dusupay (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /1,973 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.00MB] [CPU: ▼8.99ms] Passed 4 tests

A check of server-side resources used by Dusupay Woocommerce Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.02 ▼3.84
Dashboard /wp-admin3.31 ▼0.0351.72 ▼16.68
Posts /wp-admin/edit.php3.42 ▲0.0755.75 ▲4.17
Add New Post /wp-admin/post-new.php5.91 ▲0.0390.89 ▼8.81
Media Library /wp-admin/upload.php3.23 ▲0.0132.74 ▼6.62

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

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

Browser metrics Passed 4 tests

Dusupay Woocommerce Gateway: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲5914.39 ▲0.195.28 ▲3.7390.54 ▲47.66
Dashboard /wp-admin2,200 ▲235.58 ▲0.0781.84 ▼9.6038.71 ▼3.85
Posts /wp-admin/edit.php2,102 ▲22.18 ▲0.1736.16 ▼1.6031.46 ▼6.87
Add New Post /wp-admin/post-new.php1,528 ▼723.13 ▲5.12666.39 ▲44.6155.40 ▼14.84
Media Library /wp-admin/upload.php1,396 ▼44.17 ▼0.1599.47 ▼6.3845.87 ▼1.48

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dusupay-payment-gateway-for-woocommerce/dusupay_js_css.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dusupay-payment-gateway-for-woocommerce/dusupay.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Installed Plugin.), #2 (Configure Woocommerce > Settings > Payments.), #3 (Checkout Page.)
  • Tags: Please reduce the number of tags, currently 20 tag instead of maximum 10
You can look at the official readme.txt

dusupay-payment-gateway-for-woocommerce/dusupay.php 92% from 13 tests

The primary PHP file in "Dusupay Woocommerce Gateway" version 2.0.6 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("dusupay-payment-gateway-for-woocommerce.php" instead of "dusupay.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected5,527 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
SVG6002,886
JavaScript53821571,606
PHP213443696
CSS66819339

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity47.00
▷ Minimum class complexity47.00
▷ Maximum class complexity47.00
Average method complexity3.30
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/images/glassy.png8.12KB3.45KB▼ 57.46%
img/dusupaybtn6.png4.55KB2.14KB▼ 53.04%
img/logo.png18.44KB7.50KB▼ 59.35%
img/payicon.png0.85KB1.02KB0.00%