68% hbl-payment-for-woocommerce

Code Review | Add Himalayan Bank Payment In WooCommerce (HBL Payment)

WordPress plugin Add Himalayan Bank Payment In WooCommerce (HBL Payment) scored68%from 54 tests.

About plugin

  • Plugin page: hbl-payment-for-w...
  • Plugin version: 2.1.0
  • PHP compatiblity: 8.1.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Jun 26, 2021
  • Latest release: Jan 29, 2023
  • Number of updates: 21
  • Update frequency: every 27.8 days
  • Top authors: sanzeeb3 (85.71%)lijnam (19.05%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /1,177 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Add Himalayan Bank Payment In WooCommerce (HBL Payment)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0040.47 ▼1.45
Dashboard /wp-admin3.35 ▼0.0448.80 ▼19.03
Posts /wp-admin/edit.php3.40 ▲0.0047.30 ▼1.07
Add New Post /wp-admin/post-new.php5.93 ▲0.0083.43 ▼8.66
Media Library /wp-admin/upload.php3.27 ▲0.0040.17 ▲2.72

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 3,047 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Add Himalayan Bank Payment In WooCommerce (HBL Payment)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.081.59 ▼0.1942.88 ▼2.54
Dashboard /wp-admin2,186 ▲95.50 ▼0.1785.14 ▼5.5640.26 ▲0.58
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0534.87 ▼2.3035.78 ▼3.14
Add New Post /wp-admin/post-new.php1,526 ▼023.20 ▲0.10690.66 ▼19.6456.43 ▲7.43
Media Library /wp-admin/upload.php1,397 ▼34.11 ▼0.08109.89 ▲5.1548.48 ▲1.17

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Please take a closer look at the following
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/hbl-payment-for-woocommerce/vendor/symfony/error-handler/Resources/assets/images/symfony-ghost.svg.php
    • > /wp-content/plugins/hbl-payment-for-woocommerce/vendor/symfony/error-handler/Resources/views/logs.html.php
    • > /wp-content/plugins/hbl-payment-for-woocommerce/vendor/symfony/error-handler/Resources/views/trace.html.php
    • > /wp-content/plugins/hbl-payment-for-woocommerce/vendor/symfony/http-kernel/Resources/welcome.html.php
  • 1248× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Safe\\Exceptions\\SafeExceptionInterface' not found in wp-content/plugins/hbl-payment-for-woocommerce/vendor/thecodingmachine/safe/generated/Exceptions/HashException.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\Exceptions\\RuntimeException' not found in wp-content/plugins/hbl-payment-for-woocommerce/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Jose\\Bundle\\JoseFramework\\DependencyInjection\\Source\\Source' not found in wp-content/plugins/hbl-payment-for-woocommerce/vendor/web-token/jwt-framework/src/Bundle/JoseFramework/DependencyInjection/Source/NestedToken/NestedToken.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\HttpFoundation\\Exception\\RequestExceptionInterface' not found in wp-content/plugins/hbl-payment-for-woocommerce/vendor/symfony/http-foundation/Exception/SessionNotFoundException.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Jose\\Component\\Console\\GeneratorCommand' not found in wp-content/plugins/hbl-payment-for-woocommerce/vendor/web-token/jwt-framework/src/Component/Console/OctKeyGeneratorCommand.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Exception\\ExceptionInterface' not found in wp-content/plugins/hbl-payment-for-woocommerce/vendor/symfony/translation/Exception/InvalidArgumentException.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\Exceptions\\BadMethodCallException' not found in wp-content/plugins/hbl-payment-for-woocommerce/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/hbl-payment-for-woocommerce/vendor/web-token/jwt-framework/tests/EncryptionAlgorithm/Experimental/RSAOAEPKeyEncryptionTest.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Config\\Resource\\ResourceInterface' not found in wp-content/plugins/hbl-payment-for-woocommerce/vendor/symfony/config/Resource/SelfCheckingResourceInterface.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Config\\Definition\\Exception\\Exception' not found in wp-content/plugins/hbl-payment-for-woocommerce/vendor/symfony/config/Definition/Exception/InvalidDefinitionException.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed: Please take inspiration from this readme.txt

hbl-payment-for-woocommerce/hbl-payment-for-woocommerce.php Passed 13 tests

"Add Himalayan Bank Payment In WooCommerce (HBL Payment)" version 2.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
55 characters long description:
Accept payment from Himalayan Bank in your online store

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Almost there! Just fix the following issues
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/hbl-payment-for-woocommerce/vendor/bin/carbon.bat
      • wp-content/plugins/hbl-payment-for-woocommerce/vendor/nesbot/carbon/bin/carbon.bat
      • wp-content/plugins/hbl-payment-for-woocommerce/vendor/bin/patch-type-declarations.bat
      • wp-content/plugins/hbl-payment-for-woocommerce/vendor/bin/var-dump-server.bat
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/hbl-payment-for-woocommerce/vendor/web-token/jwt-framework/tests/Component/KeyManagement/Chain/google.crt
      • wp-content/plugins/hbl-payment-for-woocommerce/vendor/web-token/jwt-framework/tests/Component/Console/Sample/google.crt
      • wp-content/plugins/hbl-payment-for-woocommerce/vendor/web-token/jwt-framework/tests/Bundle/JoseFramework/config/keys/google.crt
    • .exe - Executable in Windows
      • wp-content/plugins/hbl-payment-for-woocommerce/vendor/symfony/console/Resources/bin/hiddeninput.exe
169,841 lines of code in 2,642 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,43132,44495,075155,935
JSON65205,560
XSD4121503,163
Markdown801,09002,879
Twig251201,063
CSS4285481
YAML17410418
JavaScript23815254
Bourne Again Shell1101460
DOS Batch40019
SVG9009

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 152)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity10.42
▷ Minimum class complexity1.00
▷ Maximum class complexity582.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity152.00
Code structure
Namespaces241
Interfaces180
Traits58
Classes1,389
▷ Abstract classes876.26%
▷ Concrete classes1,30293.74%
▷ Final classes29922.96%
Methods8,838
▷ Static methods1,09312.37%
▷ Public methods7,10380.37%
▷ Protected methods7788.80%
▷ Private methods95710.83%
Functions1,766
▷ Named functions1,28272.59%
▷ Anonymous functions48427.41%
Constants602
▷ Global constants203.32%
▷ Class constants58296.68%
▷ Public constants47080.76%

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
PNG images were not found in this plugin