72% yith-essential-kit-for-woocommerce-1

Code Review | YITH Essential Kit for WooCommerce #1

WordPress plugin YITH Essential Kit for WooCommerce #1 scored72%from 54 tests.

About plugin

  • Plugin page: yith-essential-ki...
  • Plugin version: 2.26.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: Aug 14, 2015
  • Latest release: Nov 22, 2023
  • Number of updates: 294
  • Update frequency: every 10.3 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

9,000+ active /623,656 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲1.79MB] [CPU: ▲7.31ms] 75% from 4 tests

Server-side resources used by YITH Essential Kit for WooCommerce #1
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 6,885.90ms on /wp-admin/admin.php?page=yith-jetpack-modules1)
PageMemory (MB)CPU Time (ms)
Home /5.27 ▲1.8049.37 ▲6.61
Dashboard /wp-admin5.72 ▲2.3772.02 ▲10.07
Posts /wp-admin/edit.php5.18 ▲1.8266.32 ▲18.44
Add New Post /wp-admin/post-new.php7.67 ▲1.7895.33 ▼5.00
Media Library /wp-admin/upload.php4.99 ▲1.7649.52 ▲17.57
YITH Essential Kit Migration /wp-admin/index.php?page=yith-essential-kit-migration-page4.9446.91
System Status /wp-admin/admin.php?page=yith_system_info5.09904.99
YITH Essential Kit for WooCommerce #1 /wp-admin/admin.php?page=yith-jetpack-modules15.416,885.90

Server storage [IO: ▲3.35MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 381 new files
Database: no new tables, 8 new options
New WordPress options
yit_recently_activated
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
yith_system_info
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

YITH Essential Kit for WooCommerce #1: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,253 ▲50614.43 ▲0.031.54 ▼0.1339.23 ▼3.70
Dashboard /wp-admin2,640 ▲4665.88 ▲0.2398.77 ▲11.92103.90 ▲63.44
Posts /wp-admin/edit.php2,154 ▲511.97 ▲0.0037.61 ▼0.8634.33 ▲2.90
Add New Post /wp-admin/post-new.php1,728 ▲20222.19 ▼1.11625.64 ▼45.4848.27 ▼3.71
Media Library /wp-admin/upload.php1,451 ▲514.23 ▲0.0399.21 ▼13.8763.88 ▲14.97
YITH Essential Kit Migration /wp-admin/index.php?page=yith-essential-kit-migration-page8441.9924.0226.54
System Status /wp-admin/admin.php?page=yith_system_info1,3052.0126.9752.01
YITH Essential Kit for WooCommerce #1 /wp-admin/admin.php?page=yith-jetpack-modules11,6262.0522.4847.94

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • yith_system_info
    • theysaidso_admin_options
    • yit_recently_activated
    • widget_recent-comments
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/index.php?page=yith-essential-kit-migration-page
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/yith-essential-kit-for-woocommerce-1/plugin-fw/tests/bootstrap.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Upgrader_Skin' not found in wp-content/plugins/yith-essential-kit-for-woocommerce-1/class-yith-essential-kit-upgrader-skin.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'YITH_Plugin_FW_Panels_Helper' not found in wp-content/plugins/yith-essential-kit-for-woocommerce-1/plugin-fw/tests/framework/plugin-options/wc-panel-options.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yith-essential-kit-for-woocommerce-1/migration.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/yith-essential-kit-for-woocommerce-1/plugin-fw/tests/unit-tests/class-yith-plugin-fw-tests-plugin-panel-wc.php:11

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

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

yith-essential-kit-for-woocommerce-1/init.php 85% from 13 tests

The primary PHP file in "YITH Essential Kit for WooCommerce #1" version 2.26.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("yith-essential-kit-for-woocommerce-1.php" instead of "init.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 345 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected45,482 lines of code in 320 files:
LanguageFilesBlank linesComment linesLines of code
PHP1732,7515,47915,399
JavaScript691,4961,04510,364
CSS201,6442518,908
PO File61,5601,9084,295
Sass34614153,221
SVG8012,926
JSON300128
Bourne Shell12211121
XML212955
YAML1131152
Dockerfile1507
INI1105
SQL1151

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity40.06
▷ Minimum class complexity1.00
▷ Maximum class complexity335.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes13.23%
▷ Concrete classes3096.77%
▷ Final classes00.00%
Methods398
▷ Static methods5313.32%
▷ Public methods32581.66%
▷ Protected methods5313.32%
▷ Private methods205.03%
Functions139
▷ Named functions13194.24%
▷ Anonymous functions85.76%
Constants22
▷ Global constants1568.18%
▷ Class constants731.82%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
35 compressed PNG files occupy 0.07MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/crown.png1.11KB0.43KB▼ 61.25%
plugin-fw/assets/css/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png0.08KB0.08KB0.00%
plugin-fw/assets/css/jquery-ui/images/ui-icons_454545_256x240.png3.69KB4.18KB0.00%
plugin-fw/assets/images/sleep.png0.11KB0.11KB▼ 5.13%
plugin-fw/assets/css/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png0.08KB0.10KB0.00%