78% yith-woocommerce-zoom-magnifier

Code Review | YITH WooCommerce Product Gallery & Image Zoom

WordPress plugin YITH WooCommerce Product Gallery & Image Zoom scored78%from 54 tests.

About plugin

  • Plugin page: yith-woocommerce-...
  • Plugin version: 2.27.0
  • PHP version: 7.4.16
  • WordPress compatibility: 8.1-6.4
  • WordPress version: 6.3.1
  • First release: May 23, 2013
  • Latest release: Nov 20, 2023
  • Number of updates: 242
  • Update frequency: every 15.8 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

69 reviews

Install metrics

40,000+ active /2,805,839 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

An overview of server-side resources used by YITH WooCommerce Product Gallery & Image Zoom
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.30 ▼4.60
Dashboard /wp-admin3.34 ▼0.0148.66 ▼11.41
Posts /wp-admin/edit.php3.39 ▲0.0349.34 ▲1.11
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.37 ▼8.12
Media Library /wp-admin/upload.php3.26 ▲0.0334.80 ▲1.26

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

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

Browser metrics Passed 4 tests

A check of browser resources used by YITH WooCommerce Product Gallery & Image Zoom
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.37 ▲0.021.64 ▼0.1540.31 ▼1.61
Dashboard /wp-admin2,198 ▲245.58 ▼0.0991.27 ▼5.5543.28 ▼2.31
Posts /wp-admin/edit.php2,107 ▲71.99 ▼0.1237.27 ▼5.5232.43 ▼5.02
Add New Post /wp-admin/post-new.php1,532 ▲623.27 ▲0.11686.70 ▲39.2362.61 ▲8.87
Media Library /wp-admin/upload.php1,406 ▲34.25 ▲0.0796.13 ▼5.4142.07 ▼2.44

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • yit_recently_activated
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% 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 fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/yith-woocommerce-zoom-magnifier/lib/compatibility/class-yith-wczm-compatibility.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'ElementorPro\\Modules\\Woocommerce\\Widgets\\Product_Images' not found in wp-content/plugins/yith-woocommerce-zoom-magnifier/lib/compatibility/elementor/class-yith-wczm-product-images-widget.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/yith-woocommerce-zoom-magnifier/templates/admin/premium.php:172

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: slider, carousel, woocommerce, magnifier, zoom

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

The main file in "YITH WooCommerce Product Gallery & Image Zoom" v. 2.27.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 299 characters long)
  • Requires at least: The required version number did not match the one declared in readme.txt ("6.2" instead of "8.1")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("yith-woocommerce-zoom-magnifier.php" instead of "init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin47,039 lines of code in 273 files:
LanguageFilesBlank linesComment linesLines of code
PHP1792,8315,57815,775
JavaScript562,2861,21114,060
CSS211,7192609,425
PO File81,8862,5234,813
SVG8012,926
XML112940

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity37.82
▷ Minimum class complexity1.00
▷ Maximum class complexity336.00
Average method complexity3.96
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes33
▷ Abstract classes13.03%
▷ Concrete classes3296.97%
▷ Final classes00.00%
Methods397
▷ Static methods5313.35%
▷ Public methods32481.61%
▷ Protected methods5213.10%
▷ Private methods215.29%
Functions140
▷ Named functions13294.29%
▷ Anonymous functions85.71%
Constants22
▷ Global constants2195.45%
▷ Class constants14.55%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
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/images/banner-premium.png10.78KB5.54KB▼ 48.66%
plugin-fw/assets/css/jquery-ui/images/ui-icons_888888_256x240.png3.69KB4.18KB0.00%
plugin-fw/assets/images/ui-icons_888888_256x240.png6.83KB4.17KB▼ 38.92%
plugin-fw/assets/images/licence-error.png1.61KB0.94KB▼ 41.62%
plugin-fw/assets/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%