83% brankas-payment-for-woocommerce

Code Review | Brankas Payment for WooCommerce

WordPress plugin Brankas Payment for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: brankas-payment-f...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 18, 2022
  • Latest release: Jan 17, 2023
  • Number of updates: 10
  • Update frequency: every 12.3 days
  • Top authors: brankasmkp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /201 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

Analyzing server-side resources used by Brankas Payment for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.24 ▼1.69
Dashboard /wp-admin3.32 ▲0.0154.05 ▲4.43
Posts /wp-admin/edit.php3.37 ▲0.0143.51 ▲0.28
Add New Post /wp-admin/post-new.php5.90 ▲0.0199.19 ▲3.06
Media Library /wp-admin/upload.php3.24 ▲0.0131.30 ▼0.59

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Brankas Payment for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.081.69 ▼0.1043.11 ▼8.72
Dashboard /wp-admin2,209 ▲214.80 ▼1.0599.68 ▼5.5939.88 ▼0.19
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0335.73 ▲0.8033.01 ▼2.26
Add New Post /wp-admin/post-new.php1,533 ▲1423.03 ▼0.39624.36 ▼3.5574.11 ▲20.33
Media Library /wp-admin/upload.php1,388 ▼04.26 ▲0.0598.38 ▼0.7541.05 ▼2.87

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
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/brankas-payment-for-woocommerce/includes/class-wc-payment-gateway-brankas.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/brankas-payment-for-woocommerce/includes/brankas-checkout-validation.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/brankas-payment-for-woocommerce/includes/brankas-checkout-select-source-field.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Contributors: Plugin contributors field is missing
The official readme.txt is a good inspiration

brankas-payment-for-woocommerce/brankas-payments-woocommerce.php 92% from 13 tests

The main file in "Brankas Payment for WooCommerce" v. 1.3.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("brankas-payment-for-woocommerce.php" instead of "brankas-payments-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin573 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP8104268525
JavaScript12023
CSS12021
SVG1004

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity15.00
▷ Minimum class complexity5.00
▷ Maximum class complexity25.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods1453.85%
▷ Protected methods1246.15%
▷ Private methods00.00%
Functions12
▷ Named functions1191.67%
▷ Anonymous functions18.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 1.03MB with 0.73MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/pics/Picture3.png89.63KB25.47KB▼ 71.58%
assets/pics/Picture2.png247.33KB75.95KB▼ 69.29%
assets/pics/Picture1.png155.90KB46.58KB▼ 70.12%
assets/pics/Picture4.png140.26KB39.06KB▼ 72.15%
assets/pics/Picture6.png158.74KB49.68KB▼ 68.70%