77% ezusy-image-swatches-for-variable-product

Code Review | Ezusy - Image Swatches for Variable Product

WordPress plugin Ezusy - Image Swatches for Variable Product scored77%from 54 tests.

About plugin

  • Plugin page: ezusy-image-swatc...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Aug 8, 2019
  • Latest release: Nov 2, 2022
  • Number of updates: 25
  • Update frequency: every 47.3 days
  • Top authors: duongvantuyen (92%)ezusy (12%)

Code review

54 tests

User reviews

6 reviews

Install metrics

500+ active /10,548 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼3.09ms] Passed 4 tests

A check of server-side resources used by Ezusy - Image Swatches for Variable Product
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.00 ▼0.47
Dashboard /wp-admin3.40 ▲0.0950.36 ▼0.29
Posts /wp-admin/edit.php3.51 ▲0.1549.17 ▲0.17
Add New Post /wp-admin/post-new.php6.00 ▲0.1188.88 ▼11.75
Media Library /wp-admin/upload.php3.32 ▲0.0934.29 ▲1.86
Ezusy /wp-admin/options-general.php?page=ezusy-setting-admin3.2939.28

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
ezusy_settings_reviews
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Ezusy - Image Swatches for Variable Product
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲15113.66 ▼0.725.10 ▲3.3547.54 ▲2.39
Dashboard /wp-admin2,211 ▲235.83 ▲0.9199.97 ▼17.5138.82 ▼5.21
Posts /wp-admin/edit.php2,100 ▲112.03 ▼0.0339.54 ▼0.9432.67 ▼1.58
Add New Post /wp-admin/post-new.php1,539 ▲2018.51 ▼4.47617.19 ▼32.1750.39 ▲0.75
Media Library /wp-admin/upload.php1,396 ▲84.22 ▼0.0599.86 ▼1.8142.64 ▼0.28
Ezusy /wp-admin/options-general.php?page=ezusy-setting-admin8242.0226.4235.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • ezusy_settings_reviews
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ezusy-image-swatches-for-variable-product/public/partials/ezusy-public-display.php
    • > /wp-content/plugins/ezusy-image-swatches-for-variable-product/admin/partials/ezusy-admin-display.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ezusy-image-swatches-for-variable-product/includes/functions.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/ezusy-image-swatches-for-variable-product/includes/settings.php:250

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

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed: You can look at the official readme.txt

ezusy-image-swatches-for-variable-product/ezusy.php 77% from 13 tests

This is the main PHP file of "Ezusy - Image Swatches for Variable Product" version 1.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0.0" instead of "4.0")
  • Main file name: The principal plugin file should be the same as the plugin slug ("ezusy-image-swatches-for-variable-product.php" instead of "ezusy.php")

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
Everything looks great! No dangerous files found in this plugin393 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP14176553388
JavaScript22274
CSS2041

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity2.75
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods42
▷ Static methods37.14%
▷ Public methods3788.10%
▷ Protected methods00.00%
▷ Private methods511.90%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
No PNG images were found in this plugin