83% dialog-ez-cash-payment-gateway-for-woocommerce

Code Review | Dialog eZ Cash payment gateway for Woocommerce

WordPress plugin Dialog eZ Cash payment gateway for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: dialog-ez-cash-pa...
  • Plugin version: 1.0.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.7
  • WordPress version: 6.3.1
  • First release: Feb 25, 2017
  • Latest release: Jun 15, 2021
  • Number of updates: 26
  • Update frequency: every 60.3 days
  • Top authors: maduka (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /2,179 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.05MB] [CPU: ▼3.36ms] Passed 4 tests

A check of server-side resources used by Dialog eZ Cash payment gateway for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.56 ▲1.1050.43 ▲8.18
Dashboard /wp-admin4.40 ▲1.0657.79 ▼9.52
Posts /wp-admin/edit.php4.45 ▲1.1055.13 ▲1.39
Add New Post /wp-admin/post-new.php6.92 ▲1.0394.75 ▼13.47
Media Library /wp-admin/upload.php4.26 ▲1.0348.80 ▲10.56

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

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

Browser metrics Passed 4 tests

Dialog eZ Cash payment gateway for Woocommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.22 ▼0.132.03 ▲0.3142.69 ▼1.63
Dashboard /wp-admin2,195 ▲185.52 ▼0.1581.16 ▼11.6636.25 ▼9.01
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0134.87 ▼3.8434.17 ▼4.46
Add New Post /wp-admin/post-new.php1,526 ▼023.25 ▲0.20646.02 ▼42.7453.61 ▲0.55
Media Library /wp-admin/upload.php1,400 ▼04.24 ▲0.00100.09 ▼18.1345.64 ▼5.47

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/dialog-ez-cash-payment-gateway-for-woocommerce/woocommerce-ezcash.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
Please take inspiration from this readme.txt

dialog-ez-cash-payment-gateway-for-woocommerce/woocommerce-ezcash.php 85% from 13 tests

The entry point to "Dialog eZ Cash payment gateway for Woocommerce" version 1.0.7 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("dialog-ez-cash-payment-gateway-for-woocommerce.php" instead of "woocommerce-ezcash.php")
  • Requires at least: Required version must match the one declared in readme.txt ("4.4" instead of "3.1")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin20,635 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP253,42112,60820,635

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 108)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity148.71
▷ Minimum class complexity1.00
▷ Maximum class complexity656.00
Average method complexity6.65
▷ Minimum method complexity1.00
▷ Maximum method complexity108.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes00.00%
Methods627
▷ Static methods10.16%
▷ Public methods627100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants233
▷ Global constants233100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
ezcash.png1.87KB1.61KB▼ 14.05%