77% yith-woocommerce-catalog-mode

Code Review | YITH WooCommerce Catalog Mode

WordPress plugin YITH WooCommerce Catalog Mode scored77%from 54 tests.

About plugin

  • Plugin page: yith-woocommerce-...
  • Plugin version: 2.28.0
  • PHP version: 7.4.16
  • WordPress compatibility: 8.1.0-6.4
  • WordPress version: 6.3.1
  • First release: Feb 19, 2015
  • Latest release: Nov 14, 2023
  • Number of updates: 136
  • Update frequency: every 23.5 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

38 reviews

Install metrics

60,000+ active /1,649,523 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
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by YITH WooCommerce Catalog Mode
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.23 ▼1.47
Dashboard /wp-admin3.33 ▼0.0146.08 ▼9.65
Posts /wp-admin/edit.php3.38 ▲0.0344.94 ▼1.28
Add New Post /wp-admin/post-new.php5.91 ▲0.0393.86 ▲3.37
Media Library /wp-admin/upload.php3.26 ▲0.0333.90 ▼1.10

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 369 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
yit_recently_activated

Browser metrics Passed 4 tests

Checking browser requirements for YITH WooCommerce Catalog Mode
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.34 ▼0.011.64 ▼0.0143.01 ▲1.58
Dashboard /wp-admin2,201 ▲205.57 ▼0.1383.24 ▼36.1139.61 ▼4.67
Posts /wp-admin/edit.php2,107 ▲101.95 ▲0.0137.89 ▲0.6232.44 ▲0.73
Add New Post /wp-admin/post-new.php1,541 ▲1524.97 ▲1.39674.73 ▼40.9565.07 ▲12.57
Media Library /wp-admin/upload.php1,403 ▲34.25 ▲0.0799.39 ▼5.1343.40 ▼2.15

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
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • yit_recently_activated

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/yith-woocommerce-catalog-mode/plugin-fw/tests/bootstrap.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'YITH_Plugin_FW_Panels_Helper' not found in wp-content/plugins/yith-woocommerce-catalog-mode/plugin-fw/tests/framework/plugin-options/wc-panel-options.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/yith-woocommerce-catalog-mode/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 a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 26 tag instead of maximum 10
You can look at the official readme.txt

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

"YITH WooCommerce Catalog Mode" version 2.28.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("6.2" instead of "8.1.0")
  • Description: Please keep the plugin description shorter than 140 characters (currently 387 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("yith-woocommerce-catalog-mode.php" instead of "init.php")

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
There were no executable files found in this plugin45,805 lines of code in 318 files:
LanguageFilesBlank linesComment linesLines of code
PHP1722,7935,56615,235
JavaScript671,4981,04210,351
CSS211,6612449,185
PO File61,5661,9204,307
Sass34652153,432
SVG8012,926
JSON300128
Bourne Shell12211121
XML212955
YAML1131152
Dockerfile1507
INI1105
SQL1151

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity45.17
▷ Minimum class complexity1.00
▷ Maximum class complexity336.00
Average method complexity4.23
▷ Minimum method complexity1.00
▷ Maximum method complexity81.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes30
▷ Abstract classes13.33%
▷ Concrete classes2996.67%
▷ Final classes00.00%
Methods399
▷ Static methods5413.53%
▷ Public methods32681.70%
▷ Protected methods5313.28%
▷ Private methods205.01%
Functions142
▷ Named functions13494.37%
▷ Anonymous functions85.63%
Constants20
▷ Global constants1995.00%
▷ Class constants15.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
29 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin-fw/assets/css/jquery-ui/images/ui-icons_cd0a0a_256x240.png3.69KB4.18KB0.00%
plugin-fw/assets/images/no-sidebar.png0.92KB0.08KB▼ 90.72%
plugin-fw/assets/css/jquery-ui/images/ui-icons_888888_256x240.png3.69KB4.18KB0.00%
plugin-fw/assets/images/sidebar-right.png0.95KB0.11KB▼ 87.91%
plugin-fw/assets/css/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png0.08KB0.08KB0.00%