73% vindi-payment-gateway

Code Review | Vindi WooCommerce 2

WordPress plugin Vindi WooCommerce 2 scored 73% from 54 tests.

About plugin

  • Plugin page: vindi-payment-gat...
  • Plugin version: 1.2.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Jul 31, 2020
  • Latest release: Aug 28, 2023
  • Number of updates: 43
  • Update frequency: every 26.4 days
  • Top authors: laertejr (60.47%)Mentores (20.93%)thiagovindi (13.95%)renanpfau (6.98%)thaisvindi (6.98%)

Code review

54 tests

User reviews

9 reviews

Install metrics

300+ active / 5,130 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼1.74MB] [CPU: ▼48.45ms] Passed 4 tests

Server-side resources used by Vindi WooCommerce 2
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.24 ▼1.229.91 ▼32.18
Dashboard /wp-admin2.26 ▼1.049.61 ▼39.05
Posts /wp-admin/edit.php2.26 ▼1.099.23 ▼37.49
Add New Post /wp-admin/post-new.php2.26 ▼3.6210.28 ▼85.08
Media Library /wp-admin/upload.php2.26 ▼0.967.14 ▼26.79

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 85 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Vindi WooCommerce 2
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,032 ▲29713.75 ▼0.638.59 ▲6.1643.29 ▼0.06
Dashboard /wp-admin2,262 ▲745.89 ▲0.08117.56 ▲2.3546.80 ▼0.74
Posts /wp-admin/edit.php2,151 ▲622.20 ▲0.1937.95 ▼2.5743.62 ▲6.26
Add New Post /wp-admin/post-new.php1,419 ▼11520.65 ▼2.50575.40 ▼47.8036.76 ▼6.25
Media Library /wp-admin/upload.php1,453 ▲654.29 ▲0.1199.11 ▲1.4343.19 ▲0.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-includes/plugin.php+1001
    Undefined offset: 0
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • 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 | 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 fix the following
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/vindi-payment-gateway/src/validators/Dependencies.php on line 6
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/vindi-payment-gateway/src/validators/Dependencies.php on line 6
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/vindi-payment-gateway/src/validators/Dependencies.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Settings_API' not found in wp-content/plugins/vindi-payment-gateway/src/includes/admin/Settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function VindiPaymentGateways\\plugin_dir_path() in wp-content/plugins/vindi-payment-gateway/src/VindiWoocommerce.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/vindi-payment-gateway/src/utils/RedirectCheckout.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/vindi-payment-gateway/src/utils/DefinitionVariables.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
You can take inspiration from this readme.txt

vindi-payment-gateway/vindi.php 85% from 13 tests

The main file in "Vindi WooCommerce 2" v. 1.2.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Domain Path: The domain path should use only dashes and lowercase characters ("./src/languages/")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("vindi-payment-gateway.php" instead of "vindi.php")

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
No dangerous file extensions were detected5,726 lines of code in 75 files:
LanguageFilesBlank linesComment linesLines of code
PHP401,0941,3974,446
Sass2726414
JavaScript79316413
CSS2156338
SVG2411115

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity22.00
▷ Minimum class complexity1.00
▷ Maximum class complexity156.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes27
▷ Abstract classes27.41%
▷ Concrete classes2592.59%
▷ Final classes00.00%
Methods252
▷ Static methods3112.30%
▷ Public methods17167.86%
▷ Protected methods3313.10%
▷ Private methods4819.05%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants17
▷ Global constants1270.59%
▷ Class constants529.41%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
src/assets/images/icon-2.png2.68KB1.55KB▼ 42.16%