89% bancr-payment-gateway-for-woocommerce

Code Review | Bancr Payment Gateway for WooCommerce

WordPress plugin Bancr Payment Gateway for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: bancr-payment-gat...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.7.1
  • WordPress version: 6.3.1
  • First release: May 24, 2021
  • Latest release: May 24, 2021
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: bancr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /409 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼1.95ms] Passed 4 tests

An overview of server-side resources used by Bancr Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0951.16 ▲8.62
Dashboard /wp-admin3.40 ▲0.1051.05 ▲0.29
Posts /wp-admin/edit.php3.51 ▲0.1648.33 ▼0.33
Add New Post /wp-admin/post-new.php5.98 ▲0.09117.96 ▼7.91
Media Library /wp-admin/upload.php3.32 ▲0.0937.77 ▲0.15

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

Filesystem and database footprint
These are issues you should consider
  • Illegal file modification detected: 1 file (4.00KB) outside of "wp-content/plugins/bancr-payment-gateway-for-woocommerce/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
wc_bancr_version
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Bancr Payment Gateway for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲3214.41 ▲0.102.03 ▼0.1243.37 ▼3.93
Dashboard /wp-admin2,221 ▲185.77 ▲0.9198.64 ▼21.8543.37 ▲0.42
Posts /wp-admin/edit.php2,103 ▲32.00 ▼0.0136.21 ▼5.1332.67 ▼2.91
Add New Post /wp-admin/post-new.php1,548 ▲823.13 ▼0.05649.36 ▲36.3949.38 ▼11.44
Media Library /wp-admin/upload.php1,397 ▼64.16 ▼0.0698.05 ▼9.3945.75 ▼2.80

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • wc_bancr_version

Smoke tests Passed 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 Passed 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
The SRP test was a success

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

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The settings panel used to configure the gateway.), #2 (Normal checkout with Bancr.)
The official readme.txt is a good inspiration

bancr-payment-gateway-for-woocommerce/woo-gateway-bancr.php 85% from 13 tests

The main file in "Bancr Payment Gateway for WooCommerce" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("bancr-payment-gateway-for-woocommerce.php" instead of "woo-gateway-bancr.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin541 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP59481517
JavaScript10023
CSS1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity20.33
▷ Minimum class complexity14.00
▷ Maximum class complexity27.00
Average method complexity2.53
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods38
▷ Static methods410.53%
▷ Public methods2873.68%
▷ Protected methods923.68%
▷ Private methods12.63%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin