78% woocommerce-image-zoom

Code Review | Product Image Zoom for WooCommerce - Zoom Product Image on Hover - Product Gallery & Image Zoom

WordPress plugin Product Image Zoom for WooCommerce - Zoom Product Image on Hover - Product Gallery & Image Zoom scored78%from 54 tests.

About plugin

  • Plugin page: woocommerce-image...
  • Plugin version: 1.05.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Mar 19, 2015
  • Latest release: Oct 22, 2023
  • Number of updates: 87
  • Update frequency: every 36.1 days
  • Top authors: wpbean (100%)

Code review

54 tests

User reviews

24 reviews

Install metrics

10,000+ active /262,139 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼1.50ms] Passed 4 tests

An overview of server-side resources used by Product Image Zoom for WooCommerce - Zoom Product Image on Hover - Product Gallery & Image Zoom
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1641.50 ▲4.13
Dashboard /wp-admin3.45 ▲0.1049.34 ▼7.42
Posts /wp-admin/edit.php3.56 ▲0.2044.50 ▼1.20
Add New Post /wp-admin/post-new.php6.05 ▲0.1685.47 ▲2.28
Media Library /wp-admin/upload.php3.37 ▲0.1436.90 ▲0.36

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 75 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Product Image Zoom for WooCommerce - Zoom Product Image on Hover - Product Gallery & Image Zoom
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,978 ▲23213.51 ▼0.849.31 ▲7.6538.17 ▼5.16
Dashboard /wp-admin2,272 ▲955.52 ▼0.1673.94 ▼16.2044.03 ▲0.01
Posts /wp-admin/edit.php2,176 ▲762.15 ▲0.2132.04 ▼4.5738.06 ▲2.95
Add New Post /wp-admin/post-new.php1,654 ▲12818.90 ▼4.65610.97 ▼63.5842.70 ▼20.65
Media Library /wp-admin/upload.php1,487 ▲844.14 ▼0.0887.05 ▼7.0946.30 ▲6.98

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
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 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
Please take a closer look at the following
  • 10× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/woocommerce-image-zoom/inc/jquery-migrate-helper/admin/header.php
    • > /wp-content/plugins/woocommerce-image-zoom/inc/jquery-migrate-helper/templates/admin-notices/deprecated-scripts.php
    • > /wp-content/plugins/woocommerce-image-zoom/inc/jquery-migrate-helper/templates/email/automatic-downgrade.php
    • > /wp-content/plugins/woocommerce-image-zoom/inc/jquery-migrate-helper/admin/logs.php
    • > /wp-content/plugins/woocommerce-image-zoom/inc/jquery-migrate-helper/templates/admin-notices/no-longer-needed.php
    • > /wp-content/plugins/woocommerce-image-zoom/inc/jquery-migrate-helper/admin/settings.php
    • > /wp-content/plugins/woocommerce-image-zoom/inc/jquery-migrate-helper/enable-jquery-migrate-helper.php
    • > /wp-content/plugins/woocommerce-image-zoom/inc/jquery-migrate-helper/class-jquery-migrate-helper.php
    • > /wp-content/plugins/woocommerce-image-zoom/inc/jquery-migrate-helper/templates/email/weekly.php
    • > /wp-content/plugins/woocommerce-image-zoom/inc/jquery-migrate-helper/templates/admin-notices/welcome.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WPB_WIZ_WeDevs_Settings_API' not found in wp-content/plugins/woocommerce-image-zoom/admin/plugin-settings.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes: You can take inspiration from this readme.txt

woocommerce-image-zoom/main.php 92% from 13 tests

The entry point to "Product Image Zoom for WooCommerce - Zoom Product Image on Hover - Product Gallery & Image Zoom" version 1.05.3 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woocommerce-image-zoom.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin5,474 lines of code in 66 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript457099133,435
PHP195497621,930
CSS264109

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity29.20
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods71
▷ Static methods2636.62%
▷ Public methods6591.55%
▷ Protected methods34.23%
▷ Private methods34.23%
Functions22
▷ Named functions2090.91%
▷ Anonymous functions29.09%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/css/fancybox_sprite@2x.png6.40KB5.76KB▼ 9.96%