72% digiwallet-for-woocommerce

Code Review | DigiWallet for WooCommerce

WordPress plugin DigiWallet for WooCommerce scored72%from 54 tests.

About plugin

  • Plugin page: digiwallet-for-wo...
  • Plugin version: 5.2.3 - 22-08-2023 S...
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8+
  • WordPress version: 6.3.1
  • First release: Nov 13, 2018
  • Latest release: Aug 30, 2023
  • Number of updates: 40
  • Update frequency: every 44.3 days
  • Top authors: eplugin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /4,318 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▲3.64ms] Passed 4 tests

A check of server-side resources used by DigiWallet for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0550.33 ▲10.75
Dashboard /wp-admin3.35 ▲0.0467.77 ▲15.88
Posts /wp-admin/edit.php3.40 ▲0.0456.40 ▼0.37
Add New Post /wp-admin/post-new.php5.93 ▲0.0490.91 ▼9.41
Media Library /wp-admin/upload.php3.27 ▲0.0449.18 ▲13.58

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 245 new files
Database: 1 new table, 6 new options
New tables
wp_woocommerce_digiwallet
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

DigiWallet for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲3414.41 ▼0.192.23 ▲0.3253.88 ▲8.78
Dashboard /wp-admin2,201 ▲245.62 ▲0.0194.14 ▲5.6844.34 ▲2.94
Posts /wp-admin/edit.php2,109 ▲92.00 ▲0.0035.87 ▼2.6933.75 ▲0.60
Add New Post /wp-admin/post-new.php1,532 ▲622.86 ▼0.32674.81 ▲46.8054.25 ▼0.25
Media Library /wp-admin/upload.php1,406 ▲64.24 ▲0.13110.18 ▲6.1351.08 ▲1.87

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_woocommerce_digiwallet
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 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 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
The following issues need your attention
  • 77× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'DigiwalletGuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/digiwallet-for-woocommerce/vendor/guzzlehttp/promises/src/EachPromise.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'DigiwalletGuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/digiwallet-for-woocommerce/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'DigiwalletGuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/digiwallet-for-woocommerce/vendor/guzzlehttp/promises/src/FulfilledPromise.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'DigiwalletGuzzleHttp\\Promise\\TaskQueueInterface' not found in wp-content/plugins/digiwallet-for-woocommerce/vendor/guzzlehttp/promises/src/TaskQueue.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_DigiWallet' not found in wp-content/plugins/digiwallet-for-woocommerce/includes/WC_Gateway_DigiWallet_Bancontact.php:3
    • > PHP Fatal error
      Cannot declare class Error, because the name is already in use in wp-content/plugins/digiwallet-for-woocommerce/vendor/symfony/polyfill-php70/Resources/stubs/Error.php on line 0
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_DigiWallet' not found in wp-content/plugins/digiwallet-for-woocommerce/includes/WC_Gateway_DigiWallet_Paysafecard.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/digiwallet-for-woocommerce/vendor/psr/http-message/src/ResponseInterface.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/digiwallet-for-woocommerce/vendor/digiwallet/transaction-client/src/Request/CreateTransactionInterface.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Digiwallet\\Packages\\Transaction\\Client\\InvoiceLine\\InvoiceLineInterface' not found in wp-content/plugins/digiwallet-for-woocommerce/vendor/digiwallet/transaction-client/src/InvoiceLine/InvoiceLine.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 76% from 29 tests

readme.txt 75% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: These screenshots need descriptions #2, #3, #4, #5 in digiwallet-for-woocommerce/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • Tested up to: Invalid plugin version format
  • Requires php: Invalid plugin version format
The official readme.txt might help

digiwallet-for-woocommerce/digiwallet.php 77% from 13 tests

The main file in "DigiWallet for WooCommerce" v. 5.2.3 - 22-08-2023 S... serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • 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
  • Main file name: The principal plugin file should be the same as the plugin slug ("digiwallet-for-woocommerce.php" instead of "digiwallet.php")
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "5.2.3 - 22-08-2023 S...")

Code Analysis 97% from 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 plugin33,803 lines of code in 194 files:
LanguageFilesBlank linesComment linesLines of code
PHP1572,5566,26828,936
Markdown161,07003,372
JSON13101,114
PO File272108319
CSS10020
XML10019
Dockerfile18010
make24010
Bourne Shell1203

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity14.66
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces18
Interfaces23
Traits2
Classes101
▷ Abstract classes00.00%
▷ Concrete classes101100.00%
▷ Final classes1514.85%
Methods889
▷ Static methods11112.49%
▷ Public methods73282.34%
▷ Protected methods141.57%
▷ Private methods14316.09%
Functions169
▷ Named functions8147.93%
▷ Anonymous functions8852.07%
Constants195
▷ Global constants4322.05%
▷ Class constants15277.95%
▷ Public constants152100.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
26 PNG files occupy 0.13MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/admin_header.png5.82KB2.63KB▼ 54.73%
assets/images/MRC_24.png3.70KB1.09KB▼ 70.56%
assets/images/AFP_60.png4.23KB2.30KB▼ 45.58%
assets/images/BW_60.png6.68KB3.19KB▼ 52.32%
assets/images/AFP_24.png4.23KB2.30KB▼ 45.58%