84% bani-payments-for-woocommerce

Code Review | Bani Payments for WooCommerce

WordPress plugin Bani Payments for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: bani-payments-for...
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Aug 24, 2022
  • Latest release: Sep 3, 2023
  • Number of updates: 12
  • Update frequency: every 32.5 days
  • Top authors: baniinc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /433 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
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼8.65ms] Passed 4 tests

Server-side resources used by Bani Payments for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.86 ▼2.45
Dashboard /wp-admin3.31 ▼0.0342.95 ▼15.41
Posts /wp-admin/edit.php3.37 ▲0.0149.12 ▼5.74
Add New Post /wp-admin/post-new.php5.90 ▲0.0190.92 ▼10.98
Media Library /wp-admin/upload.php3.24 ▲0.0137.05 ▲3.32

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Bani Payments for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.23 ▼1.061.75 ▼0.0642.37 ▲1.66
Dashboard /wp-admin2,206 ▲155.91 ▲0.99106.53 ▼1.8042.58 ▲0.58
Posts /wp-admin/edit.php2,086 ▼62.03 ▲0.0140.36 ▼0.7934.60 ▼3.25
Add New Post /wp-admin/post-new.php1,542 ▲2318.65 ▼4.69676.90 ▼4.8059.85 ▲4.64
Media Library /wp-admin/upload.php1,388 ▼34.21 ▼0.0092.47 ▼12.3243.84 ▲1.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× 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/bani-payments-for-woocommerce/includes/class-wc-payment-gateway-bani.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Contributors: The plugin contributors field is not present
The official readme.txt is a good inspiration

bani-payments-for-woocommerce/woo-bani.php 92% from 13 tests

The entry point to "Bani Payments for WooCommerce" version 1.0.4 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("bani-payments-for-woocommerce.php" instead of "woo-bani.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 detected871 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP2155168498
JavaScript5118362
SVG10011

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity57.00
▷ Minimum class complexity57.00
▷ Maximum class complexity57.00
Average method complexity4.27
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods1487.50%
▷ Protected methods212.50%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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 were not PNG files found in your plugin