84% pagfort-boleto

Code Review | Pagfort Boleto Bancário para WooCommerce

WordPress plugin Pagfort Boleto Bancário para WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: pagfort-boleto
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.4.2
  • WordPress version: 6.3.1
  • First release: Jul 1, 2020
  • Latest release: Aug 10, 2020
  • Number of updates: 12
  • Update frequency: every 3.7 days
  • Top authors: pagfort (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /439 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

Server-side resources used by Pagfort Boleto Bancário para WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.39 ▼6.30
Dashboard /wp-admin3.31 ▲0.0043.31 ▼3.79
Posts /wp-admin/edit.php3.36 ▲0.0045.74 ▼1.27
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.50 ▼18.41
Media Library /wp-admin/upload.php3.23 ▲0.0034.93 ▼1.02

Server storage [IO: ▲3.94MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 191 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Pagfort Boleto Bancário para WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.26 ▼1.121.54 ▼0.2640.34 ▼7.02
Dashboard /wp-admin2,206 ▲185.91 ▼0.00108.60 ▲9.5436.74 ▼6.90
Posts /wp-admin/edit.php2,089 ▼02.03 ▼0.0241.74 ▲0.9136.10 ▼0.82
Add New Post /wp-admin/post-new.php1,519 ▼2323.28 ▲4.95628.37 ▲24.9447.41 ▼6.91
Media Library /wp-admin/upload.php1,388 ▲34.17 ▼0.0397.57 ▲4.9941.71 ▲1.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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
Please take a closer look at the following
  • 62× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      require_once(../lib/nusoap.php): failed to open stream: No such file or directory in wp-content/plugins/pagfort-boleto/vendor/econea/nusoap/samples/wsdlclient6.php on line 12
    • > PHP Warning
      require_once(../lib/nusoap.php): failed to open stream: No such file or directory in wp-content/plugins/pagfort-boleto/vendor/econea/nusoap/samples/wsdlclient3c.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'Picqer\\Barcode\\BarcodeGenerator' not found in wp-content/plugins/pagfort-boleto/vendor/picqer/php-barcode-generator/src/BarcodeGeneratorJPG.php:7
    • > PHP Warning
      require_once(../lib/nusoap.php): failed to open stream: No such file or directory in wp-content/plugins/pagfort-boleto/vendor/econea/nusoap/samples/getfile2client.php on line 12
    • > PHP Warning
      require_once(../lib/nusoap.php): failed to open stream: No such file or directory in wp-content/plugins/pagfort-boleto/vendor/econea/nusoap/samples/wsdlclient11.php on line 14
    • > PHP Warning
      require_once(../lib/nusoap.php): failed to open stream: No such file or directory in wp-content/plugins/pagfort-boleto/vendor/econea/nusoap/samples/wsdlclient9.php on line 12
    • > PHP Fatal error
      require_once(): Failed opening required '../lib/nusoap.php' (include_path='.:/usr/share/php') in wp-content/plugins/pagfort-boleto/vendor/econea/nusoap/samples/wsdlclient3c.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/pagfort-boleto/templates/woocommerce/checkout/pagfort-boleto/bank-slip/thankyou.php:3
    • > PHP Warning
      require_once(../lib/nusoap.php): failed to open stream: No such file or directory in wp-content/plugins/pagfort-boleto/vendor/econea/nusoap/samples/wsdlclient14.php on line 12
    • > PHP Fatal error
      require_once(): Failed opening required '../lib/nusoap.php' (include_path='.:/usr/share/php') in wp-content/plugins/pagfort-boleto/vendor/econea/nusoap/samples/wsdlclient8.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: spc protesto nacional, boleto, woocommerce, boleto bancrio, payment bank slip...

pagfort-boleto/pagfort-boleto.php 85% from 13 tests

"Pagfort Boleto Bancário para WooCommerce" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Git Repository: Please remove the Git repository from this plugin
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "3.0.0")

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
No dangerous file extensions were detected43,943 lines of code in 124 files:
LanguageFilesBlank linesComment linesLines of code
HTML363,09946930,790
PHP629173,92611,470
JavaScript84110461
Markdown41670388
PO File1177267325
JSON400214
CSS4419169
SVG20074
YAML2112828
XML10024

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.39
Average class complexity47.64
▷ Minimum class complexity1.00
▷ Maximum class complexity390.00
Average method complexity6.94
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes39
▷ Abstract classes12.56%
▷ Concrete classes3897.44%
▷ Final classes00.00%
Methods309
▷ Static methods154.85%
▷ Public methods24679.61%
▷ Protected methods4313.92%
▷ Private methods206.47%
Functions13
▷ Named functions1076.92%
▷ Anonymous functions323.08%
Constants33
▷ Global constants00.00%
▷ Class constants33100.00%
▷ Public constants33100.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
46 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/econea/nusoap/docs/media/images/Tplus.png0.22KB0.13KB▼ 41.89%
vendor/econea/nusoap/docs/media/images/blank.png0.14KB0.09KB▼ 32.64%
vendor/econea/nusoap/docs/media/images/Global.png0.70KB0.57KB▼ 17.98%
vendor/econea/nusoap/docs/media/images/function_folder.png0.59KB0.47KB▼ 21.16%
vendor/econea/nusoap/docs/media/images/AbstractPrivateClass.png0.83KB0.63KB▼ 23.35%