89% yith-woocommerce-compare

Code Review | YITH WooCommerce Compare

WordPress plugin YITH WooCommerce Compare scored89%from 54 tests.

About plugin

  • Plugin page: yith-woocommerce-...
  • Plugin version: 2.33.0
  • PHP version: 7.4.16
  • WordPress compatibility: 8.0-6.4
  • WordPress version: 6.3.1
  • First release: Jun 24, 2013
  • Latest release: Nov 20, 2023
  • Number of updates: 197
  • Update frequency: every 19.3 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

34 reviews

Install metrics

200,000+ active /9,497,639 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

This is a short check of server-side resources used by YITH WooCommerce Compare
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.93 ▲4.07
Dashboard /wp-admin3.31 ▲0.0143.91 ▼1.38
Posts /wp-admin/edit.php3.36 ▲0.0144.91 ▲1.06
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.79 ▼7.74
Media Library /wp-admin/upload.php3.23 ▲0.0131.76 ▲0.68

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 400 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
yit_recently_activated
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for YITH WooCommerce Compare
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲5914.67 ▲0.402.05 ▲0.2544.16 ▼0.04
Dashboard /wp-admin2,204 ▲275.59 ▼0.0989.57 ▲1.9339.67 ▼1.25
Posts /wp-admin/edit.php2,107 ▲71.94 ▼0.0739.48 ▲2.9536.72 ▼1.00
Add New Post /wp-admin/post-new.php1,532 ▲623.35 ▲0.08628.15 ▲16.7160.32 ▲18.22
Media Library /wp-admin/upload.php1,409 ▲94.18 ▼0.0298.50 ▼0.8144.31 ▲2.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • yit_recently_activated

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: compare products, woocommerce compare, product compare, yith, product comparison

yith-woocommerce-compare/init.php 77% from 13 tests

Analyzing the main PHP file in "YITH WooCommerce Compare" version 2.33.0
It is important to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("6.2" instead of "8.0")
  • Main file name: Name the main plugin file the same as the plugin slug ("yith-woocommerce-compare.php" instead of "init.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 317 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected45,785 lines of code in 280 files:
LanguageFilesBlank linesComment linesLines of code
PHP1712,8855,64816,052
JavaScript541,3678769,661
CSS281,7062649,487
PO File172,9343,8067,613
SVG8012,926
XML212946

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity44.39
▷ Minimum class complexity1.00
▷ Maximum class complexity336.00
Average method complexity4.17
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes13.23%
▷ Concrete classes3096.77%
▷ Final classes00.00%
Methods413
▷ Static methods5312.83%
▷ Public methods34082.32%
▷ Protected methods5312.83%
▷ Private methods204.84%
Functions137
▷ Named functions12893.43%
▷ Anonymous functions96.57%
Constants18
▷ Global constants1794.44%
▷ Class constants15.56%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
87 PNG files occupy 1.29MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/socials/behance.png2.24KB2.23KB0.48%
assets/images/04-bg.png6.93KB3.78KB▼ 45.47%
plugin-fw/assets/images/sleep.png0.11KB0.11KB▼ 5.13%
assets/images/08.png82.76KB29.18KB▼ 64.74%
plugin-fw/assets/css/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png0.08KB0.08KB0.00%