78% image-hover-effects-for-woocommerce-products

Code Review | Image Hover Effects For WooCommerce Products

WordPress plugin Image Hover Effects For WooCommerce Products scored78%from 54 tests.

About plugin

  • Plugin page: image-hover-effec...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.0
  • WordPress version: 6.3.1
  • First release: Apr 22, 2020
  • Latest release: Jun 4, 2022
  • Number of updates: 10
  • Update frequency: every 77.4 days
  • Top authors: Labibahmed42 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /5,424 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
Install script ran successfully

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

Server-side resources used by Image Hover Effects For WooCommerce Products
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0239.48 ▼6.31
Dashboard /wp-admin3.34 ▲0.0351.05 ▼5.77
Posts /wp-admin/edit.php3.39 ▲0.0251.04 ▼5.75
Add New Post /wp-admin/post-new.php5.92 ▲0.0388.46 ▼30.41
Media Library /wp-admin/upload.php3.26 ▲0.0238.15 ▼0.11

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Image Hover Effects For WooCommerce Products
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.25 ▼0.411.74 ▼0.0339.69 ▼5.52
Dashboard /wp-admin2,211 ▲345.56 ▼0.1391.05 ▼2.4242.11 ▼1.13
Posts /wp-admin/edit.php2,116 ▲162.00 ▲0.0134.93 ▼8.4438.89 ▲1.35
Add New Post /wp-admin/post-new.php1,540 ▲1423.18 ▼0.19673.46 ▼15.1367.63 ▲15.84
Media Library /wp-admin/upload.php1,416 ▲164.12 ▼0.07103.16 ▼3.5442.09 ▼5.78

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/image-hover-effects-for-woocommerce-products/includes/render-woo-hover.php
  • 27× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/image-hover-effects-for-woocommerce-products/includes/templates/effect8.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_product() in wp-content/plugins/image-hover-effects-for-woocommerce-products/includes/templates/effect3.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_product() in wp-content/plugins/image-hover-effects-for-woocommerce-products/includes/templates/effect10.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_product() in wp-content/plugins/image-hover-effects-for-woocommerce-products/includes/templates/effect8.php:10
    • > PHP Notice
      Undefined variable: saved_effects in wp-content/plugins/image-hover-effects-for-woocommerce-products/includes/render-woo-hover.php on line 5
    • > PHP Notice
      Undefined variable: wdo_product in wp-content/plugins/image-hover-effects-for-woocommerce-products/includes/templates/effect8.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/image-hover-effects-for-woocommerce-products/includes/templates/effect8.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/image-hover-effects-for-woocommerce-products/includes/admin-settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-hover-effects-for-woocommerce-products/index.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_get_product() in wp-content/plugins/image-hover-effects-for-woocommerce-products/includes/templates/effect7.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed: You can look at the official readme.txt

image-hover-effects-for-woocommerce-products/index.php 85% from 13 tests

The main PHP script in "Image Hover Effects For WooCommerce Products" version 1.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("image-hover-effects-for-woocommerce-products.php" instead of "index.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin23,592 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
CSS63,0122213,277
SVG30129,299
PHP159928893
JavaScript2276123

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
15 PNG files occupy 0.10MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
admin/images/ui-icons_ef8c08_256x240.png4.44KB4.17KB▼ 6.02%
admin/images/ui-bg_highlight-soft_75_ffe45c_1x100.png0.32KB0.18KB▼ 42.38%
admin/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
admin/images/ui-bg_highlight-soft_100_eeeeee_1x100.png0.27KB0.14KB▼ 47.84%