77% woo-hutkigrosh-gateway

Code Review | WooCommerce Hutkigrosh Gateway

WordPress plugin WooCommerce Hutkigrosh Gateway scored77%from 54 tests.

About plugin

  • Plugin page: woo-hutkigrosh-ga...
  • Plugin version: 4.0.1
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Oct 31, 2018
  • Latest release: Aug 7, 2023
  • Number of updates: 69
  • Update frequency: every 25.3 days
  • Top authors: nmekh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,007 total downloads

Benchmarks

Plugin footprint 83% 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.01MB] [CPU: ▼5.70ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Hutkigrosh Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.52 ▼0.19
Dashboard /wp-admin3.32 ▲0.0148.16 ▼0.03
Posts /wp-admin/edit.php3.37 ▲0.0150.45 ▼1.68
Add New Post /wp-admin/post-new.php5.90 ▲0.0195.21 ▼20.91
Media Library /wp-admin/upload.php3.24 ▲0.0135.45 ▲1.08

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 690 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Hutkigrosh Gateway
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▼0.311.61 ▼0.1742.52 ▼1.61
Dashboard /wp-admin2,198 ▲245.60 ▲0.0788.98 ▼9.9441.33 ▼6.30
Posts /wp-admin/edit.php2,100 ▼01.95 ▼0.0538.91 ▼0.6235.47 ▼5.60
Add New Post /wp-admin/post-new.php1,526 ▼223.03 ▲0.24642.97 ▲16.0374.88 ▲21.77
Media Library /wp-admin/upload.php1,397 ▲34.18 ▼0.0098.14 ▼2.7740.58 ▼4.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
  • 18× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/woo-hutkigrosh-gateway/vendor/apache/log4php/src/examples/php/layout_html.php
    • > /wp-content/plugins/woo-hutkigrosh-gateway/vendor/apache/log4php/package.php
    • > /wp-content/plugins/woo-hutkigrosh-gateway/vendor/apache/log4php/src/examples/php/renderer_default.php
    • > /wp-content/plugins/woo-hutkigrosh-gateway/vendor/apache/log4php/src/examples/php/layout_simple.php
    • > /wp-content/plugins/woo-hutkigrosh-gateway/vendor/apache/log4php/src/examples/php/configurator_basic.php
    • > /wp-content/plugins/woo-hutkigrosh-gateway/vendor/apache/log4php/src/examples/php/mdc.php
    • > /wp-content/plugins/woo-hutkigrosh-gateway/vendor/apache/log4php/src/examples/php/filter_stringmatch.php
    • > /wp-content/plugins/woo-hutkigrosh-gateway/vendor/apache/log4php/src/examples/php/filter_levelmatch.php
    • > /wp-content/plugins/woo-hutkigrosh-gateway/vendor/apache/log4php/src/examples/php/layout_pattern.php
    • > /wp-content/plugins/woo-hutkigrosh-gateway/vendor/apache/log4php/src/examples/php/configurator_php.php
  • 395× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Test\\TestUtil' not found in wp-content/plugins/woo-hutkigrosh-gateway/vendor/tecnickcom/tc-lib-color/test/Model/CmykTest.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Com\\Tecnick\\Color\\Model' not found in wp-content/plugins/woo-hutkigrosh-gateway/vendor/tecnickcom/tc-lib-color/src/Model/Rgb.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'esas\\cmsgate\\hro\\HROTuner' not found in wp-content/plugins/woo-hutkigrosh-gateway/vendor/esas/cmsgate-hutkigrosh-lib/src/esas/cmsgate/hutkigrosh/hro/sections/HeaderSectionLogoContactsHROTunerHutkigrosh.php:12
    • > PHP Notice
      2023-10-15 23:13:37.863 DEBUG [1027895] root: Hello PHP! in wp-content/plugins/woo-hutkigrosh-gateway/vendor/apache/log4php/src/main/php/appenders/LoggerAppenderPhp.php on line 46
    • > PHP Fatal error
      Uncaught Error: Class 'esas\\cmsgate\\PaysystemConnector' not found in wp-content/plugins/woo-hutkigrosh-gateway/vendor/esas/cmsgate-hutkigrosh-lib/src/esas/cmsgate/hutkigrosh/PaysystemConnectorHutkigrosh.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'esas\\cmsgate\\hro\\HRO' not found in wp-content/plugins/woo-hutkigrosh-gateway/vendor/esas/cmsgate-core/src/esas/cmsgate/hro/panels/MessagesPanelHRO.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'LoggerPatternConverter' not found in wp-content/plugins/woo-hutkigrosh-gateway/vendor/apache/log4php/src/main/php/pattern/LoggerPatternConverterMessage.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'esas\\cmsgate\\view\\admin\\fields\\ConfigField' not found in wp-content/plugins/woo-hutkigrosh-gateway/vendor/esas/cmsgate-core/src/esas/cmsgate/view/admin/fields/ConfigFieldText.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-hutkigrosh-gateway/vendor/tecnickcom/tc-lib-barcode/test/Linear/CodeOneOneTest.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Com\\Tecnick\\Barcode\\Type\\Linear' not found in wp-content/plugins/woo-hutkigrosh-gateway/vendor/tecnickcom/tc-lib-barcode/src/Type/Linear/PharmaTwoTracks.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention: You can take inspiration from this readme.txt

woo-hutkigrosh-gateway/cmsgate-woocommerce-hutkigrosh-hooks.php 77% from 13 tests

The main PHP script in "WooCommerce Hutkigrosh Gateway" version 4.0.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.6" instead of "3.0.0")
  • 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
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woo-hutkigrosh-gateway.php" instead of "cmsgate-woocommerce-hutkigrosh-hooks.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected48,484 lines of code in 624 files:
LanguageFilesBlank linesComment linesLines of code
PHP5335,36617,84626,974
JavaScript132,2712,1218,950
XML497976395,123
CSS7925634,934
JSON800637
Velocity Template Language11139435
make396120323
Maven13021305
Markdown3900284
SVG200250
Ant11930140
DTD1255469
YAML211060

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.27
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces69
Interfaces48
Traits0
Classes432
▷ Abstract classes6013.89%
▷ Concrete classes37286.11%
▷ Final classes00.00%
Methods2,546
▷ Static methods45717.95%
▷ Public methods2,21987.16%
▷ Protected methods25710.09%
▷ Private methods702.75%
Functions10
▷ Named functions660.00%
▷ Anonymous functions440.00%
Constants309
▷ Global constants123.88%
▷ Class constants29796.12%
▷ Public constants297100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/apache/log4php/src/site/resources/images/logos/maven-feather.png3.25KB2.04KB▼ 37.24%
vendor/esas/cmsgate-hutkigrosh-lib/static/image/ps_icons.png3.42KB2.02KB▼ 40.78%
vendor/apache/log4php/src/site/resources/img/glyphicons-halflings-white.png8.57KB9.20KB0.00%
vendor/apache/log4php/src/site/resources/img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%