83% kangu

Code Review | Kangu para WooCommerce

WordPress plugin Kangu para WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: kangu
  • Plugin version: 2.2.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8
  • WordPress version: 5.8.1
  • First release: Jul 27, 2021
  • Latest release: Feb 4, 2022
  • Number of updates: 19
  • Update frequency: every 10.5 days
  • Top authors: gokangu (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active / 3,061 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

Server-side resources used by Kangu para WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.98 ▲0.1532.98 ▲7.14
Dashboard /wp-admin3.20 ▲0.1437.32 ▼6.00
Posts /wp-admin/edit.php3.31 ▲0.2137.52 ▲1.75
Add New Post /wp-admin/post-new.php5.11 ▼0.3360.68 ▼589.29
Media Library /wp-admin/upload.php3.15 ▲0.1430.06 ▲1.23
Fretes Kangu /wp-admin/admin.php?page=kangu3.1823.08

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: no files
Database: no new tables, 1 new option
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

Kangu para WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,867 ▲26616.26 ▲0.5810.80 ▲4.4676.37 ▲0.15
Dashboard /wp-admin2,959 ▲646.53 ▲0.36115.48 ▼18.57166.37 ▼10.74
Posts /wp-admin/edit.php2,770 ▲303.52 ▲0.2966.20 ▲0.57151.60 ▲11.00
Add New Post /wp-admin/post-new.php45 ▼3,6530.94 ▼17.690.05 ▼429.0648.62 ▼121.35
Media Library /wp-admin/upload.php1,779 ▲305.83 ▲0.30142.86 ▼3.09197.61 ▲5.93
Fretes Kangu /wp-admin/admin.php?page=kangu1,1753.1157.48100.32

Uninstaller [IO: ✅] [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
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • recovery_mode_email_last_sent

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/kangu/view/admin-ajax.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/kangu/index.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/kangu/view/kangu-side-box-orders.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/kangu/view/shipping-setting.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/kangu/lib/main.php:21
    • > PHP Notice
      Undefined variable: has_kangu in wp-content/plugins/kangu/view/kangu-side-box-orders.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/kangu/view/kangu-side-box-tracking.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/kangu/view/shipping-calculator.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/kangu/view/shipping-methods.php:75
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/kangu/view/kangu-box-tracking.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #10, #11, #12, #13, #14, #15, #16, #2, #3, #4, #5, #6, #7, #8, #9 in kangu/assets to your readme.txt
Please take inspiration from this readme.txt

kangu/index.php 85% from 13 tests

The entry point to "Kangu para WooCommerce" version 2.2.5 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("kangu.php" instead of "index.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.0" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected1,812 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP11206711,222
CSS5750451
JavaScript77299
SVG10140

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity62.00
▷ Minimum class complexity18.00
▷ Maximum class complexity106.00
Average method complexity4.30
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods37
▷ Static methods410.81%
▷ Public methods37100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin