78% woo-checkout-braspag

Code Review | Pagador (Braspag) Checkout for WooCommerce

WordPress plugin Pagador (Braspag) Checkout for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woo-checkout-braspag
  • Plugin version: 3.2.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.5-6.3
  • WordPress version: 6.3.1
  • First release: Aug 2, 2019
  • Latest release: Oct 17, 2023
  • Number of updates: 29
  • Update frequency: every 53.0 days
  • Top authors: mariovalney (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,745 total downloads

Benchmarks

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

An overview of server-side resources used by Pagador (Braspag) Checkout for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1234.26 ▼4.45
Dashboard /wp-admin3.42 ▲0.0748.12 ▼13.44
Posts /wp-admin/edit.php3.53 ▲0.1746.87 ▼3.32
Add New Post /wp-admin/post-new.php6.00 ▲0.1182.97 ▼23.46
Media Library /wp-admin/upload.php3.34 ▲0.1135.89 ▼3.46

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Pagador (Braspag) Checkout for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲1414.17 ▼0.201.65 ▼0.2137.28 ▼4.15
Dashboard /wp-admin2,206 ▲325.55 ▼0.0183.35 ▼2.7239.32 ▼2.77
Posts /wp-admin/edit.php2,112 ▲92.01 ▲0.0136.89 ▼7.7536.35 ▼2.57
Add New Post /wp-admin/post-new.php1,537 ▲923.44 ▲0.45652.06 ▼15.9349.70 ▼9.42
Media Library /wp-admin/upload.php1,411 ▲174.24 ▼0.0193.14 ▼11.8340.57 ▼6.77

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 21× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/woo-checkout-braspag/modules/woocommerce/includes/views/meta-box/create-payment.php
    • > /wp-content/plugins/woo-checkout-braspag/modules/woocommerce/includes/braspag/models/class-wc-checkout-braspag-query.php
    • > /wp-content/plugins/woo-checkout-braspag/modules/woocommerce/includes/braspag/traits/class-wc-checkout-braspag-extradata.php
    • > /wp-content/plugins/woo-checkout-braspag/modules/woocommerce/includes/braspag/models/requests/class-wc-checkout-braspag-request-payment-wl.php
    • > /wp-content/plugins/woo-checkout-braspag/modules/woocommerce/includes/braspag/models/requests/class-wc-checkout-braspag-request-payment-bs.php
    • > /wp-content/plugins/woo-checkout-braspag/modules/woocommerce/includes/braspag/models/class-wc-checkout-braspag-customer.php
    • > /wp-content/plugins/woo-checkout-braspag/modules/dependence/class-module-dependence.php
    • > /wp-content/plugins/woo-checkout-braspag/modules/woocommerce/includes/class-wc-checkout-braspag-gateway.php
    • > /wp-content/plugins/woo-checkout-braspag/modules/woocommerce/includes/braspag/models/requests/class-wc-checkout-braspag-request-payment-cc.php
    • > /wp-content/plugins/woo-checkout-braspag/modules/woocommerce/includes/braspag/class-wc-checkout-braspag-model.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/woo-checkout-braspag/modules/woocommerce/includes/templates/payment-methods/cc-form.php:21

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 90% 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 to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Screenshot 1), #2 (Screenshot 2), #3 (Screenshot 3)
Please take inspiration from this readme.txt

woo-checkout-braspag/woo-checkout-braspag.php 85% from 13 tests

The entry point to "Pagador (Braspag) Checkout for WooCommerce" version 3.2.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.7" instead of "3.6.5")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin2,960 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP318181,8042,799
JavaScript6291694
CSS414667

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity19.28
▷ Minimum class complexity2.00
▷ Maximum class complexity67.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits1
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods135
▷ Static methods64.44%
▷ Public methods11685.93%
▷ Protected methods00.00%
▷ Private methods1914.07%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants40
▷ Global constants820.00%
▷ Class constants3280.00%
▷ Public constants32100.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
modules/woocommerce/assets/images/braspag.png11.81KB6.49KB▼ 45.02%