78% woo-correios-calculo-de-frete-na-pagina-do-produto

Code Review | WooCommerce Correios - Cálculo de Frete na Página do Produto

WordPress plugin WooCommerce Correios - Cálculo de Frete na Página do Produto scored78%from 54 tests.

About plugin

  • Plugin page: woo-correios-calc...
  • Plugin version: 3.3.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3.2
  • WordPress version: 6.3.1
  • First release: Mar 21, 2018
  • Latest release: Oct 25, 2023
  • Number of updates: 67
  • Update frequency: every 30.5 days
  • Top authors: lucasbustamante (100%)

Code review

54 tests

User reviews

31 reviews

Install metrics

4,000+ active /136,865 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼6.08ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Correios - Cálculo de Frete na Página do Produto
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.63 ▲2.58
Dashboard /wp-admin3.31 ▼0.0443.46 ▼11.34
Posts /wp-admin/edit.php3.36 ▲0.0049.40 ▼1.83
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.78 ▼12.16
Media Library /wp-admin/upload.php3.23 ▲0.0035.36 ▲1.00

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 92 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

WooCommerce Correios - Cálculo de Frete na Página do Produto: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.061.74 ▲0.1842.49 ▲1.15
Dashboard /wp-admin2,192 ▲155.49 ▼0.1380.45 ▼5.9937.57 ▼3.21
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0438.54 ▼1.4535.45 ▼6.00
Add New Post /wp-admin/post-new.php1,531 ▲323.17 ▲0.06653.68 ▼25.9349.32 ▼3.68
Media Library /wp-admin/upload.php1,400 ▼04.16 ▼0.0594.48 ▼1.3942.00 ▼3.38

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/woo-correios-calculo-de-frete-na-pagina-do-produto/vendor/enshrined/svg-sanitize/src/svg-scanner.php
  • 19× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'enshrined\\svgSanitize\\data\\TagInterface' not found in wp-content/plugins/woo-correios-calculo-de-frete-na-pagina-do-produto/vendor/enshrined/svg-sanitize/tests/Fixtures/TestAllowedTags.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'enshrined\\svgSanitize\\data\\TagInterface' not found in wp-content/plugins/woo-correios-calculo-de-frete-na-pagina-do-produto/vendor/enshrined/svg-sanitize/src/data/AllowedTags.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-correios-calculo-de-frete-na-pagina-do-produto/vendor/enshrined/svg-sanitize/tests/AllowedTagsTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'CFPP\\Shipping\\ShippingMethods\\Handler' not found in wp-content/plugins/woo-correios-calculo-de-frete-na-pagina-do-produto/src/Shipping/ShippingMethods/Handlers/WC_Correios_Through_Webservice.php:10
    • > PHP Warning
      array_values() expects parameter 1 to be array, null given in wp-content/plugins/woo-correios-calculo-de-frete-na-pagina-do-produto/vendor/enshrined/svg-sanitize/src/svg-scanner.php on line 65
    • > PHP Fatal error
      Uncaught Error: Class 'CFPP\\Shipping\\ShippingMethods\\Handler' not found in wp-content/plugins/woo-correios-calculo-de-frete-na-pagina-do-produto/src/Shipping/ShippingMethods/Handlers/WC_Correios_Shipping_Carta_Registrada.php:10
    • > PHP Fatal error
      Trait 'CFPP\\Shipping\\ShippingMethods\\Traits\\ValidateRequestTrait' not found in wp-content/plugins/woo-correios-calculo-de-frete-na-pagina-do-produto/src/Shipping/ShippingMethods/Handler.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'CFPP\\Exceptions\\CFPPException' not found in wp-content/plugins/woo-correios-calculo-de-frete-na-pagina-do-produto/src/Exceptions/ValidationErrorException.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/woo-correios-calculo-de-frete-na-pagina-do-produto/views/product-page-cfpp.php:1
    • > PHP Fatal error
      Uncaught Error: Interface 'CFPP\\Shipping\\ShippingMethods\\PackageInterface' not found in wp-content/plugins/woo-correios-calculo-de-frete-na-pagina-do-produto/src/Shipping/ShippingMethods/Packages/CorreiosPackage.php:13

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: woocomerce correios, woocommerce correios produto, woocommerce

woo-correios-calculo-de-frete-na-pagina-do-produto/woo-correios-calculo-de-frete-na-pagina-do-produto.php 92% from 13 tests

"WooCommerce Correios - Cálculo de Frete na Página do Produto" version 3.3.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Git Repository: Please remove the Git repository from this plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected4,973 lines of code in 100 files:
LanguageFilesBlank linesComment linesLines of code
PHP667571,8493,703
SVG18108468
JavaScript33574319
PO File13752135
JSON300107
CSS12079
Markdown249072
YAML33050
XML35040

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity8.12
▷ Minimum class complexity1.00
▷ Maximum class complexity91.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity84.00
Code structure
Namespaces15
Interfaces3
Traits1
Classes53
▷ Abstract classes11.89%
▷ Concrete classes5298.11%
▷ Final classes00.00%
Methods248
▷ Static methods6225.00%
▷ Public methods19377.82%
▷ Protected methods3413.71%
▷ Private methods218.47%
Functions13
▷ Named functions17.69%
▷ Anonymous functions1292.31%
Constants6
▷ Global constants233.33%
▷ Class constants466.67%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
.wordpress-org/icon-256x256.png86.17KB9.59KB▼ 88.87%
.wordpress-org/icon-128x128.png2.47KB1.62KB▼ 34.58%