10% boleto-pag-seguro-direto

Code Review | Boleto Pag Seguro Direto

WordPress plugin Boleto Pag Seguro Direto scored10%from 54 tests.

About plugin

  • Plugin page: boleto-pag-seguro...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.6
  • WordPress version: 6.3.1
  • First release: Aug 20, 2018
  • Latest release: Oct 12, 2020
  • Number of updates: 345
  • Update frequency: every 2.3 days
  • Top authors: clodoaldoevangelista (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /15,661 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/boleto-pag-seguro-direto/BoletoPagSeguroDireto_Plugin.php+31
    count(): Parameter must be an array or an object that implements Countable

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.00ms] Passed 4 tests

An overview of server-side resources used by Boleto Pag Seguro Direto
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.39 ▼7.15
Dashboard /wp-admin3.33 ▲0.0348.96 ▲2.41
Posts /wp-admin/edit.php3.44 ▲0.0946.63 ▼5.18
Add New Post /wp-admin/post-new.php5.91 ▲0.0386.95 ▼10.00
Media Library /wp-admin/upload.php3.25 ▲0.0234.11 ▼1.65
Boleto Pag Seguro Direto /wp-admin/plugins.php?page=BoletoPagSeguroDireto_PluginSettings3.2231.32

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 15 new options
New WordPress options
theysaidso_admin_options
BoletoPagSeguroDireto_Plugin_CTextInput
BoletoPagSeguroDireto_Plugin_BTextInput
BoletoPagSeguroDireto_Plugin__installed
can_compress_scripts
BoletoPagSeguroDireto_Plugin_GTextInput
widget_recent-comments
BoletoPagSeguroDireto_Plugin_ETextInput
BoletoPagSeguroDireto_Plugin_FTextInput
db_upgraded
...

Browser metrics Passed 4 tests

An overview of browser requirements for Boleto Pag Seguro Direto
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.61 ▼0.771.61 ▼0.5842.21 ▼4.94
Dashboard /wp-admin2,210 ▲225.84 ▲0.95103.06 ▼8.5643.42 ▲0.70
Posts /wp-admin/edit.php2,090 ▲11.97 ▼0.0036.29 ▼1.8135.64 ▼1.09
Add New Post /wp-admin/post-new.php1,536 ▲2223.36 ▲1.60671.72 ▼11.1557.85 ▲8.46
Media Library /wp-admin/upload.php1,389 ▲44.20 ▲0.0496.46 ▼6.1541.75 ▼3.58
Boleto Pag Seguro Direto /wp-admin/plugins.php?page=BoletoPagSeguroDireto_PluginSettings1,1292.0730.0131.61

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 15 options
    • BoletoPagSeguroDireto_Plugin_ETextInput
    • theysaidso_admin_options
    • BoletoPagSeguroDireto_Plugin__installed
    • widget_recent-posts
    • widget_theysaidso_widget
    • BoletoPagSeguroDireto_Plugin__version
    • BoletoPagSeguroDireto_Plugin_CTextInput
    • BoletoPagSeguroDireto_Plugin_ATextInput
    • BoletoPagSeguroDireto_Plugin_GTextInput
    • BoletoPagSeguroDireto_Plugin_DTextInput
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 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
Please fix the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/boleto-pag-seguro-direto/boleto/pages/form-dados-do-boleto-confirma.php
    • > /wp-content/plugins/boleto-pag-seguro-direto/boleto/pages/form-dados-do-boleto.php
    • > /wp-content/plugins/boleto-pag-seguro-direto/boleto/pages/formata.php
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      include_once(): Failed opening 'BOLETO_PAG_SEGURO_DIRETO_DIRBoletoPagSeguroDireto_ShortCodeLoader.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/boleto-pag-seguro-direto/boleto/shortcodes/form-dados-do-boleto-confirma.php on line 2
    • > PHP Warning
      Use of undefined constant BOLETO_PAG_SEGURO_DIRETO_DIR - assumed 'BOLETO_PAG_SEGURO_DIRETO_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/boleto-pag-seguro-direto/boleto/shortcodes/form-dados-do-boleto.php on line 2
    • > PHP Warning
      include_once(BOLETO_PAG_SEGURO_DIRETO_DIRBoletoPagSeguroDireto_ShortCodeLoader.php): failed to open stream: No such file or directory in wp-content/plugins/boleto-pag-seguro-direto/boleto/shortcodes/form-dados-do-boleto.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'BoletoPagSeguroDireto_ShortCodeLoader' not found in wp-content/plugins/boleto-pag-seguro-direto/boleto/shortcodes/form-dados-do-boleto-confirma.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'BoletoPagSeguroDireto_ShortCodeLoader' not found in wp-content/plugins/boleto-pag-seguro-direto/boleto/shortcodes/form-dados-do-boleto.php:3
    • > PHP Warning
      include(): Failed opening 'BOLETO_PAG_SEGURO_DIRETO_DIRboleto/pages/config/Url.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/boleto-pag-seguro-direto/boleto/pages/core/PagSeguro.php on line 3
    • > PHP Warning
      Use of undefined constant BOLETO_PAG_SEGURO_DIRETO_DIR - assumed 'BOLETO_PAG_SEGURO_DIRETO_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/boleto-pag-seguro-direto/boleto/shortcodes/PagamentoBoleto.php on line 2
    • > PHP Warning
      include(BOLETO_PAG_SEGURO_DIRETO_DIRboleto/pages/config/Url.php): failed to open stream: No such file or directory in wp-content/plugins/boleto-pag-seguro-direto/boleto/pages/core/PagSeguro.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'BoletoPagSeguroDireto_ShortCodeLoader' not found in wp-content/plugins/boleto-pag-seguro-direto/boleto/shortcodes/PagamentoBoleto.php:4
    • > PHP Warning
      include_once(): Failed opening 'BOLETO_PAG_SEGURO_DIRETO_DIRBoletoPagSeguroDireto_ShortCodeLoader.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/boleto-pag-seguro-direto/boleto/shortcodes/PagamentoBoleto.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: paypal, donate, boleto online, recebimentos de doaes, donation...

boleto-pag-seguro-direto/boleto-pag-seguro-direto.php 92% from 13 tests

The main file in "Boleto Pag Seguro Direto" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 488 characters long)

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 detected2,333 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP293147051,855
PO File2182234478

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.31
Average class complexity9.20
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes213.33%
▷ Concrete classes1386.67%
▷ Final classes00.00%
Methods124
▷ Static methods118.87%
▷ Public methods9072.58%
▷ Protected methods3225.81%
▷ Private methods21.61%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants880.00%
▷ Class constants220.00%
▷ Public constants2100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/icon-128x128.png7.09KB3.45KB▼ 51.36%