83% freteclick

Code Review | Frete Click

WordPress plugin Frete Click scored83%from 54 tests.

About plugin

  • Plugin page: freteclick
  • Plugin version: 1.1.20
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: Aug 22, 2020
  • Latest release: Aug 9, 2022
  • Number of updates: 30
  • Update frequency: every 24.4 days
  • Top authors: freteclick (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,822 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
Install script ran successfully

Server metrics [RAM: ▼0.16MB] [CPU: ▼15.86ms] Passed 4 tests

Server-side resources used by Frete Click
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.59 ▼1.05
Dashboard /wp-admin3.20 ▼0.1033.28 ▼15.85
Posts /wp-admin/edit.php3.27 ▼0.0934.61 ▼12.92
Add New Post /wp-admin/post-new.php5.44 ▼0.4466.18 ▼30.67
Media Library /wp-admin/upload.php3.21 ▼0.0231.72 ▼3.99

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

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

Browser metrics Passed 4 tests

Frete Click: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.58 ▼0.831.96 ▼0.0045.65 ▲2.60
Dashboard /wp-admin2,206 ▲154.86 ▼0.95111.25 ▲7.3042.38 ▼2.62
Posts /wp-admin/edit.php2,089 ▼32.01 ▼0.0335.33 ▼5.5134.99 ▼1.28
Add New Post /wp-admin/post-new.php1,514 ▼017.86 ▲0.17662.82 ▼3.7360.61 ▲13.59
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.0394.11 ▼0.8241.07 ▼2.88

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 54× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Polyfill\\Intl\ormalizer\ormalizer' not found in wp-content/plugins/freteclick/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function is_type() on null in wp-content/plugins/freteclick/views/templates/display_product_layout.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/freteclick/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/freteclick/vendor/guzzlehttp/psr7/src/LimitStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/freteclick/vendor/guzzlehttp/psr7/src/CachingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/freteclick/vendor/psr/http-message/src/ServerRequestInterface.php:43
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/freteclick/vendor/guzzlehttp/psr7/src/NoSeekStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/freteclick/vendor/guzzlehttp/psr7/src/UploadedFile.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/freteclick/vendor/guzzlehttp/psr7/src/InflateStream.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/freteclick/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Contributors: Contributors not specified
  • Requires php: Invalid version format
You can take inspiration from this readme.txt

freteclick/freteclick.php Passed 13 tests

"Frete Click" version 1.1.20's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
64 characters long description:
Plugin para cotação de fretes utilizando a API da Frete Click.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin33,696 lines of code in 194 files:
LanguageFilesBlank linesComment linesLines of code
PHP1572,5946,31528,666
Markdown151,17403,490
JSON11101,160
JavaScript12112208
YAML522391
CSS23256
Dockerfile18010
make1409
SVG1006

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity14.85
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces20
Interfaces16
Traits2
Classes106
▷ Abstract classes00.00%
▷ Concrete classes106100.00%
▷ Final classes2523.58%
Methods856
▷ Static methods19522.78%
▷ Public methods70882.71%
▷ Protected methods70.82%
▷ Private methods14116.47%
Functions166
▷ Named functions7444.58%
▷ Anonymous functions9255.42%
Constants195
▷ Global constants7739.49%
▷ Class constants11860.51%
▷ Public constants118100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) logo.png4.66KB0.00KB▼ 100.00%
(invalid) views/img/PAC.png3.57KB0.00KB▼ 100.00%
views/img/SEDEX.png16.15KB7.51KB▼ 53.46%