83% genie-business-payment-gateway

Code Review | Genie Business Payment Gateway for WooCommerce

WordPress plugin Genie Business Payment Gateway for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: genie-business-pa...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.0
  • WordPress version: 6.3.1
  • First release: Aug 26, 2022
  • Latest release: Mar 27, 2023
  • Number of updates: 12
  • Update frequency: every 17.8 days
  • Top authors: dialoggeniebiz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /766 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.38ms] Passed 4 tests

A check of server-side resources used by Genie Business Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.29 ▼1.47
Dashboard /wp-admin3.31 ▲0.0147.11 ▼0.07
Posts /wp-admin/edit.php3.37 ▲0.0145.54 ▲0.19
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.73 ▼4.18
Media Library /wp-admin/upload.php3.24 ▲0.0139.81 ▲4.80

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 192 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Genie Business Payment Gateway for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.69 ▲0.051.54 ▼0.1142.60 ▲2.93
Dashboard /wp-admin2,198 ▲185.63 ▲0.0481.53 ▼11.1336.00 ▼2.21
Posts /wp-admin/edit.php2,103 ▲31.94 ▼0.1035.84 ▼0.9532.97 ▼5.10
Add New Post /wp-admin/post-new.php1,535 ▲918.28 ▼4.93610.14 ▲8.9980.96 ▲20.43
Media Library /wp-admin/upload.php1,394 ▼04.18 ▼0.04103.38 ▲4.8542.54 ▼0.24

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • 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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 50× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/genie-business-payment-gateway/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/genie-business-payment-gateway/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/genie-business-payment-gateway/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/genie-business-payment-gateway/vendor/guzzlehttp/psr7/src/NoSeekStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/genie-business-payment-gateway/vendor/guzzlehttp/psr7/src/Stream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/genie-business-payment-gateway/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/genie-business-payment-gateway/vendor/guzzlehttp/psr7/src/AppendStream.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/genie-business-payment-gateway/inc/webhook-handler.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/genie-business-payment-gateway/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/genie-business-payment-gateway/vendor/guzzlehttp/promises/src/EachPromise.php:9

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (The settings screen for your plugin, easily select sandbox or production and add your specific keys.), #2 (Payment method selection for easy checkout.)
Please take inspiration from this readme.txt

genie-business-payment-gateway/geniebiz-woocommerce.php 85% from 13 tests

The main PHP file in "Genie Business Payment Gateway for WooCommerce" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("genie-business-payment-gateway.php" instead of "geniebiz-woocommerce.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 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
There were no executable files found in this plugin33,047 lines of code in 178 files:
LanguageFilesBlank linesComment linesLines of code
PHP1422,4546,46827,899
Markdown151,22603,593
JSON11101,190
XML200173
YAML522391
PO File1272782
Dockerfile18010
make1409

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity16.09
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.24
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces17
Interfaces15
Traits2
Classes97
▷ Abstract classes00.00%
▷ Concrete classes97100.00%
▷ Final classes2424.74%
Methods812
▷ Static methods16720.57%
▷ Public methods65680.79%
▷ Protected methods40.49%
▷ Private methods15218.72%
Functions160
▷ Named functions7043.75%
▷ Anonymous functions9056.25%
Constants165
▷ Global constants4124.85%
▷ Class constants12475.15%
▷ Public constants124100.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
There are no PNG files in this plugin