83% voice-pay-gateway

Code Review | Voice Pay Gateway

WordPress plugin Voice Pay Gateway scored 83% from 54 tests.

About plugin

  • Plugin page: voice-pay-gateway
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.9
  • WordPress version: 6.3.1
  • First release: Dec 22, 2021
  • Latest release: Jan 31, 2022
  • Number of updates: 6
  • Update frequency: every 10.3 days
  • Top authors: navoo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 243 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.59ms] Passed 4 tests

Server-side resources used by Voice Pay Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0343.30 ▲0.65
Dashboard /wp-admin3.33 ▲0.0345.16 ▼2.15
Posts /wp-admin/edit.php3.38 ▲0.0346.86 ▼2.57
Add New Post /wp-admin/post-new.php5.91 ▲0.0383.80 ▼15.54
Media Library /wp-admin/upload.php3.25 ▲0.0232.74 ▼2.08

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

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

Browser metrics Passed 4 tests

Voice Pay 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,800 ▲6513.32 ▼1.121.75 ▼0.0443.34 ▼1.23
Dashboard /wp-admin2,203 ▲155.84 ▼0.0695.97 ▼6.9540.33 ▼0.93
Posts /wp-admin/edit.php2,089 ▲31.97 ▼0.0635.96 ▲0.5832.50 ▼2.76
Add New Post /wp-admin/post-new.php1,533 ▲223.20 ▲0.23669.21 ▼12.0051.00 ▼3.57
Media Library /wp-admin/upload.php1,388 ▼04.20 ▼0.0297.16 ▼5.4243.95 ▼2.52

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/voice-pay-gateway/includes/class-voice-pay-gateway.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/voice-pay-gateway/woocommerce-gateway-voice-pay.php:16

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% 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 need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === voice-pay-gateway === )
  • Contributors: Plugin contributors field is missing
The official readme.txt might help

voice-pay-gateway/woocommerce-gateway-voice-pay.php 85% from 13 tests

The main PHP script in "Voice Pay Gateway" version 2.0.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("voice-pay-gateway.php" instead of "woocommerce-gateway-voice-pay.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected231 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP463106231

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity5.33
▷ Minimum class complexity2.00
▷ Maximum class complexity11.00
Average method complexity2.18
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods11
▷ Static methods654.55%
▷ Public methods1090.91%
▷ Protected methods19.09%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
There are no PNG files in this plugin