89% yith-color-and-label-variations-for-woocommerce

Code Review | YITH Color and Label Variations for WooCommerce

WordPress plugin YITH Color and Label Variations for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: yith-color-and-la...
  • Plugin version: 2.2.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 8.1-6.4
  • WordPress version: 6.3.1
  • First release: Oct 11, 2018
  • Latest release: Nov 20, 2023
  • Number of updates: 115
  • Update frequency: every 16.2 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

10,000+ active /235,580 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
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.22ms] Passed 4 tests

An overview of server-side resources used by YITH Color and Label Variations for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.92 ▼0.90
Dashboard /wp-admin3.32 ▲0.0244.54 ▼1.55
Posts /wp-admin/edit.php3.37 ▲0.0247.38 ▲3.45
Add New Post /wp-admin/post-new.php5.90 ▲0.0284.17 ▼7.87
Media Library /wp-admin/upload.php3.25 ▲0.0233.08 ▲1.44

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 328 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
yit_recently_activated
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for YITH Color and Label Variations for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5314.74 ▲0.481.94 ▲0.1541.05 ▼2.06
Dashboard /wp-admin2,198 ▲205.62 ▼0.0493.04 ▼23.1240.56 ▼3.90
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0139.06 ▲5.0535.38 ▼0.94
Add New Post /wp-admin/post-new.php1,526 ▼1823.27 ▼1.96587.79 ▼64.6356.20 ▼0.62
Media Library /wp-admin/upload.php1,403 ▲34.19 ▼0.0198.88 ▲1.9143.34 ▲0.87

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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • yit_recently_activated
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% 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
5 plugin tags: woocommcere, variable product, yith, color and label variations, variations

yith-color-and-label-variations-for-woocommerce/init.php 77% from 13 tests

The main PHP script in "YITH Color and Label Variations for WooCommerce" version 2.2.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("yith-color-and-label-variations-for-woocommerce.php" instead of "init.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 359 characters long)
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.7" instead of "8.1")

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 detected41,061 lines of code in 253 files:
LanguageFilesBlank linesComment linesLines of code
PHP1682,7165,46415,045
JavaScript491,3458429,366
CSS201,6792649,267
PO File71,6322,0354,417
SVG8012,926
XML112940

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity42.86
▷ Minimum class complexity1.00
▷ Maximum class complexity336.00
Average method complexity4.03
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes29
▷ Abstract classes13.45%
▷ Concrete classes2896.55%
▷ Final classes00.00%
Methods385
▷ Static methods4912.73%
▷ Public methods31080.52%
▷ Protected methods5514.29%
▷ Private methods205.19%
Functions146
▷ Named functions13491.78%
▷ Anonymous functions128.22%
Constants17
▷ Global constants1482.35%
▷ Class constants317.65%
▷ Public constants3100.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
54 PNG files occupy 0.96MB with 0.33MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin-fw/assets/images/x.png0.70KB0.71KB0.00%
assets/images/04-icon.png1.42KB0.64KB▼ 55.01%
assets/images/02-bg.png5.21KB2.67KB▼ 48.61%
plugin-fw/assets/images/sleep.png0.11KB0.11KB▼ 5.13%
assets/images/05.png45.62KB16.14KB▼ 64.62%