71% guntab-payment-gateway

Code Review | GunTab Payment Gateway

WordPress plugin GunTab Payment Gateway scored71%from 54 tests.

About plugin

  • Plugin page: guntab-payment-ga...
  • Plugin version: 0.1.6
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7
  • WordPress version: 6.3.1
  • First release: Apr 21, 2021
  • Latest release: Feb 15, 2023
  • Number of updates: 30
  • Update frequency: every 22.7 days
  • Top authors: guntab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,762 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.21MB] [CPU: ▼7.22ms] Passed 4 tests

Server-side resources used by GunTab Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2240.27 ▼0.53
Dashboard /wp-admin3.57 ▲0.2246.90 ▼16.04
Posts /wp-admin/edit.php3.61 ▲0.2649.24 ▲0.79
Add New Post /wp-admin/post-new.php6.09 ▲0.2081.75 ▼13.10
Media Library /wp-admin/upload.php3.43 ▲0.2035.98 ▲5.05
Settings /wp-admin/admin.php?page=guntab-settings3.4634.73
Log /wp-admin/admin.php?page=guntab-log3.3933.14
Tools /wp-admin/admin.php?page=guntab-tools3.4132.79

Server storage [IO: ▲0.23MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • You have illegally modified 1 file (0.02KB) outside of "wp-content/plugins/guntab-payment-gateway/" and "wp-content/uploads/"
    • (new file) wp-content/dragon-config/dragon.php
Filesystem: 37 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
guntab_webhook_key
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for GunTab Payment Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,952 ▲20613.59 ▼0.785.47 ▲3.6343.15 ▲0.24
Dashboard /wp-admin2,244 ▲565.84 ▲0.8999.52 ▼16.5538.25 ▼9.41
Posts /wp-admin/edit.php2,127 ▲382.03 ▼0.0239.41 ▲2.2135.17 ▼2.78
Add New Post /wp-admin/post-new.php1,568 ▲4918.23 ▼4.75633.52 ▲51.2659.46 ▲13.38
Media Library /wp-admin/upload.php1,426 ▲414.21 ▲0.0196.39 ▼6.2144.51 ▲0.95
Settings /wp-admin/admin.php?page=guntab-settings9502.0523.6030.98
Log /wp-admin/admin.php?page=guntab-log8512.0222.2625.08
Tools /wp-admin/admin.php?page=guntab-tools8202.0324.1328.19

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • guntab_webhook_key
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=guntab-log
    • > Warning in wp-content/plugins/guntab-payment-gateway/vendor/guntab/dragon-framework/src/Pages/AdminLog.php+16
    file_get_contents(wp-content/plugins/guntab-payment-gateway/plugin.log): failed to open stream: No such file or directory

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/guntab-payment-gateway/tests/bootstrap.php
  • 44× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Dragon\\Hooking\\FrontEndPluginHooks' not found in wp-content/plugins/guntab-payment-gateway/app/FrontEndPluginHooks.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/guntab-payment-gateway/vendor/guntab/dragon-framework/src/Abstracts/WidgetAbstract.php:5
    • > PHP Notice
      Undefined variable: pageData in wp-content/plugins/guntab-payment-gateway/vendor/guntab/dragon-framework/resources/views/Table/AdminTable.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Dragon\\Abstracts\\PageAbstract' not found in wp-content/plugins/guntab-payment-gateway/vendor/guntab/dragon-framework/src/Abstracts/OptionsAbstract.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Dragon\\Abstracts\\ArrayDotFileAbstract' not found in wp-content/plugins/guntab-payment-gateway/vendor/guntab/dragon-framework/src/ConfigFile.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GunTab\\Api\\GunTab\\Abstracts\\Invoice' not found in wp-content/plugins/guntab-payment-gateway/app/Api/GunTab/RequestObjects/Invoice.php:7
    • > PHP Warning
      array_key_exists() expects parameter 2 to be array, unknown given in wp-content/plugins/guntab-payment-gateway/vendor/guntab/dragon-framework/resources/views/Table/Details.php on line 9
    • > PHP Fatal error
      Uncaught RuntimeException: vendor/autoload.php could not be found. Did you run `php composer.phar install`? in wp-content/plugins/guntab-payment-gateway/vendor/bin/doctrine-dbal.php:22
    • > PHP Notice
      Undefined variable: pageData in wp-content/plugins/guntab-payment-gateway/vendor/guntab/dragon-framework/resources/views/Table/Details.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/guntab-payment-gateway/vendor/guntab/dragon-framework/tests/ConfigTest.php:5

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 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: escrow, ammo, firearms, ammunition, payments...

guntab-payment-gateway/guntab-gateway.php 69% from 13 tests

The main PHP script in "GunTab Payment Gateway" version 0.1.6 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Requires PHP: The required version number must match the one declared in readme.txt ("7.0" instead of "7.2")
  • Description: Keep the plugin description shorter than 140 characters (currently 152 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("guntab-payment-gateway.php" instead of "guntab-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin43,526 lines of code in 98 files:
LanguageFilesBlank linesComment linesLines of code
PHP8939,62025,46243,106
CSS1260147
Bourne Shell22211125
JSON30081
JavaScript210143
XML10024

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity5.24
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces17
Interfaces1
Traits0
Classes74
▷ Abstract classes1317.57%
▷ Concrete classes6182.43%
▷ Final classes00.00%
Methods272
▷ Static methods16761.40%
▷ Public methods18066.18%
▷ Protected methods3011.03%
▷ Private methods6222.79%
Functions19
▷ Named functions1052.63%
▷ Anonymous functions947.37%
Constants19
▷ Global constants00.00%
▷ Class constants19100.00%
▷ Public constants19100.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
4 PNG files occupy 0.18MB with 0.08MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png67.39KB27.45KB▼ 59.26%
assets/screenshot-3.png27.28KB11.67KB▼ 57.24%
resources/img/guntab-icon.png1.56KB1.46KB▼ 6.20%
assets/screenshot-2.png92.46KB36.76KB▼ 60.24%