78% woo-boleto-paghiper

Code Review | WooCommerce Boleto e PIX PagHiper

WordPress plugin WooCommerce Boleto e PIX PagHiper scored78%from 54 tests.

About plugin

  • Plugin page: woo-boleto-paghiper
  • Plugin version: 2.3.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Jun 12, 2018
  • Latest release: Nov 1, 2023
  • Number of updates: 50
  • Update frequency: every 39.4 days
  • Top authors: henriqueccruz (100%)

Code review

54 tests

User reviews

33 reviews

Install metrics

2,000+ active /21,141 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by WooCommerce Boleto e PIX PagHiper
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1040.94 ▲1.47
Dashboard /wp-admin3.41 ▲0.0649.59 ▼11.98
Posts /wp-admin/edit.php3.52 ▲0.1748.62 ▲3.38
Add New Post /wp-admin/post-new.php5.99 ▲0.1085.30 ▼12.38
Media Library /wp-admin/upload.php3.33 ▲0.1036.52 ▲2.28

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 274 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Boleto e PIX PagHiper
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.28 ▼0.091.74 ▲0.0144.94 ▲1.06
Dashboard /wp-admin2,206 ▲265.60 ▼0.0887.98 ▼3.1741.19 ▲2.78
Posts /wp-admin/edit.php2,112 ▲121.99 ▼0.0035.50 ▼2.1332.73 ▼4.73
Add New Post /wp-admin/post-new.php1,555 ▲1824.99 ▲7.08634.51 ▲1.7661.10 ▼2.81
Media Library /wp-admin/upload.php1,408 ▲54.20 ▲0.01105.46 ▼1.9846.79 ▲0.26

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
Please take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/woo-boleto-paghiper/assets/php/barcode.php
    • > /wp-content/plugins/woo-boleto-paghiper/includes/paghiper-php-sdk/fix-scoper-autoload.php
  • 95× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/woo-boleto-paghiper/includes/paghiper-php-sdk/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'PagHiperSDK\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/woo-boleto-paghiper/includes/paghiper-php-sdk/build/vendor/guzzlehttp/psr7/src/CachingStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'PagHiperSDK\\Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/woo-boleto-paghiper/includes/paghiper-php-sdk/build/vendor/guzzlehttp/psr7/src/UploadedFile.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/woo-boleto-paghiper/uninstall.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/woo-boleto-paghiper/includes/paghiper-php-sdk/vendor/psr/http-message/src/ResponseInterface.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/woo-boleto-paghiper/includes/paghiper-php-sdk/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'PagHiperSDK\\GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/woo-boleto-paghiper/includes/paghiper-php-sdk/build/vendor/guzzlehttp/promises/src/Coroutine.php:43
    • > PHP Fatal error
      Uncaught Error: Interface 'PagHiperSDK\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/woo-boleto-paghiper/includes/paghiper-php-sdk/build/vendor/guzzlehttp/psr7/src/DroppingStream.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PagHiperSDK\\GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/woo-boleto-paghiper/includes/paghiper-php-sdk/build/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/woo-boleto-paghiper/includes/paghiper-php-sdk/vendor/guzzlehttp/psr7/src/InflateStream.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: pix, gateway, boleto, pagamento, paghiper...

woo-boleto-paghiper/woocommerce-paghiper.php 77% from 13 tests

Analyzing the main PHP file in "WooCommerce Boleto e PIX PagHiper" version 2.3.2
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-boleto-paghiper.php" instead of "woocommerce-paghiper.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("6.0" instead of "4.0.0")
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin21,605 lines of code in 245 files:
LanguageFilesBlank linesComment linesLines of code
PHP2152,82410,22217,456
Markdown121,04503,299
JSON900800
YAML17034
make1409
JavaScript5005
CSS2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity14.47
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces17
Interfaces28
Traits4
Classes144
▷ Abstract classes00.00%
▷ Concrete classes144100.00%
▷ Final classes1611.11%
Methods1,390
▷ Static methods14510.43%
▷ Public methods1,15382.95%
▷ Protected methods100.72%
▷ Private methods22716.33%
Functions308
▷ Named functions12941.88%
▷ Anonymous functions17958.12%
Constants117
▷ Global constants00.00%
▷ Class constants117100.00%
▷ Public constants117100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
16 PNG files occupy 0.19MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/billet-reserved.png10.07KB5.04KB▼ 49.93%
assets/images/ico_2-qr.png3.66KB3.75KB0.00%
assets/images/boleto-ok.png7.43KB3.27KB▼ 55.99%
assets/images/pix-cancelled.png23.46KB11.58KB▼ 50.66%
assets/images/billet-ok.png12.43KB5.71KB▼ 54.01%