10% compra-direta-pag-seguro-boleto

Code Review | Compra Direta Pag Seguro Boleto

WordPress plugin Compra Direta Pag Seguro Boleto scored 10% from 54 tests.

About plugin

  • Plugin page: compra-direta-pag...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.6
  • WordPress version: 5.8.1
  • First release: Apr 30, 2020
  • Latest release: Oct 12, 2020
  • Number of updates: 79
  • Update frequency: every 2.1 days
  • Top authors: clodoaldoevangelista (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 1,002 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/compra-direta-pag-seguro-boleto/CompraDiretaPagSeguroBoleto_Plugin.php+31
    count(): Parameter must be an array or an object that implements Countable

Server metrics [RAM: ▲0.20MB] [CPU: ▼143.61ms] Passed 4 tests

Analyzing server-side resources used by Compra Direta Pag Seguro Boleto
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.01 ▲0.2937.77 ▲15.56
Dashboard /wp-admin3.30 ▲0.2447.29 ▲7.87
Posts /wp-admin/edit.php3.35 ▲0.2450.90 ▲2.78
Add New Post /wp-admin/post-new.php5.59 ▲0.1691.15 ▼582.25
Media Library /wp-admin/upload.php3.18 ▲0.1836.48 ▼2.83
All Boletos /wp-admin/edit.php?post_type=boleto3.2233.31
Add New /wp-admin/post-new.php?post_type=boleto3.3659.15
Compra Direta Pag Seguro Boleto /wp-admin/plugins.php?page=CompraDiretaPagSeguroBoleto_PluginSettings3.1531.12

Server storage [IO: ▲0.20MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 37 new files
Database: no new tables, 10 new options
New WordPress options
CompraDiretaPagSeguroBoleto_Plugin_HTextInput
CompraDiretaPagSeguroBoleto_Plugin_GTextInput
CompraDiretaPagSeguroBoleto_Plugin_BTextInput
CompraDiretaPagSeguroBoleto_Plugin_ATextInput
CompraDiretaPagSeguroBoleto_Plugin__installed
CompraDiretaPagSeguroBoleto_Plugin_ETextInput
CompraDiretaPagSeguroBoleto_Plugin_DTextInput
CompraDiretaPagSeguroBoleto_Plugin__version
CompraDiretaPagSeguroBoleto_Plugin_CTextInput
CompraDiretaPagSeguroBoleto_Plugin_ITextInput

Browser metrics Passed 4 tests

Compra Direta Pag Seguro Boleto: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,747 ▲15115.77 ▼0.196.67 ▼1.7461.37 ▲8.24
Dashboard /wp-admin3,010 ▲765.89 ▼0.24145.55 ▼5.69120.21 ▼4.94
Posts /wp-admin/edit.php2,779 ▲402.70 ▲0.0174.17 ▼0.8296.74 ▼11.61
Add New Post /wp-admin/post-new.php1,630 ▼5318.91 ▲0.16386.33 ▼9.60121.74 ▲8.18
Media Library /wp-admin/upload.php1,847 ▲375.02 ▲0.01152.38 ▼21.44125.12 ▼3.69
All Boletos /wp-admin/edit.php?post_type=boleto1,4812.6166.2070.21
Add New /wp-admin/post-new.php?post_type=boleto3,3099.08293.40164.63
Compra Direta Pag Seguro Boleto /wp-admin/plugins.php?page=CompraDiretaPagSeguroBoleto_PluginSettings1,5502.1058.2695.56

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 10 options
    • CompraDiretaPagSeguroBoleto_Plugin__installed
    • CompraDiretaPagSeguroBoleto_Plugin_ETextInput
    • CompraDiretaPagSeguroBoleto_Plugin_GTextInput
    • CompraDiretaPagSeguroBoleto_Plugin__version
    • CompraDiretaPagSeguroBoleto_Plugin_CTextInput
    • CompraDiretaPagSeguroBoleto_Plugin_ITextInput
    • CompraDiretaPagSeguroBoleto_Plugin_ATextInput
    • CompraDiretaPagSeguroBoleto_Plugin_HTextInput
    • CompraDiretaPagSeguroBoleto_Plugin_DTextInput
    • CompraDiretaPagSeguroBoleto_Plugin_BTextInput

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/compra-direta-pag-seguro-boleto/boleto/pages/formata.php
  • 21× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/compra-direta-pag-seguro-boleto/boleto/create/actives-plugins.php on line 2
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/compra-direta-pag-seguro-boleto/boleto/create/actives-plugins.php on line 2
    • > PHP Warning
      Use of undefined constant COMPRA_DIRETA_PAG_SEGURO_BOLETO_DIR - assumed 'COMPRA_DIRETA_PAG_SEGURO_BOLETO_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/compra-direta-pag-seguro-boleto/boleto/shortcodes/form-dados-do-boleto.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'CompraDiretaPagSeguroBoleto_ShortCodeLoader' not found in wp-content/plugins/compra-direta-pag-seguro-boleto/boleto/shortcodes/pagamento-boleto.php:6
    • > PHP Warning
      include_once(): Failed opening 'COMPRA_DIRETA_PAG_SEGURO_BOLETO_DIRCompraDiretaPagSeguroBoleto_ShortCodeLoader.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/compra-direta-pag-seguro-boleto/boleto/shortcodes/form-dados-do-boleto.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/compra-direta-pag-seguro-boleto/compra-direta-pag-seguro-boleto.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'CompraDiretaPagSeguroBoleto_ShortCodeLoader' not found in wp-content/plugins/compra-direta-pag-seguro-boleto/boleto/shortcodes/politica-de-privacidade.php:6
    • > PHP Warning
      Use of undefined constant COMPRA_DIRETA_PAG_SEGURO_BOLETO_DIR - assumed 'COMPRA_DIRETA_PAG_SEGURO_BOLETO_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/compra-direta-pag-seguro-boleto/boleto/shortcodes/politica-de-privacidade.php on line 2
    • > PHP Warning
      Use of undefined constant COMPRA_DIRETA_PAG_SEGURO_BOLETO_DIR - assumed 'COMPRA_DIRETA_PAG_SEGURO_BOLETO_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/compra-direta-pag-seguro-boleto/boleto/shortcodes/pagamento-boleto.php on line 2
    • > PHP Warning
      include_once(COMPRA_DIRETA_PAG_SEGURO_BOLETO_DIRCompraDiretaPagSeguroBoleto_ShortCodeLoader.php): failed to open stream: No such file or directory in wp-content/plugins/compra-direta-pag-seguro-boleto/boleto/shortcodes/pagamento-boleto.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
  • Screenshots: Please add images for these screenshots: #1 (Log in with your Pag Seguro UOL email and your production token.), #2 (Make the data entry page available anywhere on the site using the shortcode or find the Ticket Data page created in the installation.), #3 (Generate the tickets easily without obliging your client to log into the Pag Seguro UOL.)
You can take inspiration from this readme.txt

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

"Compra Direta Pag Seguro Boleto" version 1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 366 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,798 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP291,6306412,055
PO File2307438743

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity6.30
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity1.68
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes220.00%
▷ Concrete classes880.00%
▷ Final classes00.00%
Methods76
▷ Static methods00.00%
▷ Public methods4863.16%
▷ Protected methods2836.84%
▷ Private methods00.00%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants880.00%
▷ Class constants220.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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.png6.13KB2.75KB▼ 55.19%