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

Code Review | Ezusy - Image Swatches for Variable Product

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

About plugin

  • Plugin page: ezusy-image-swatc...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 5.8.1
  • First release: Aug 8, 2019
  • Latest release: Aug 30, 2021
  • Number of updates: 24
  • Update frequency: every 31.4 days
  • Top authors: duongvantuyen (95.83%)ezusy (8.33%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active / 8,907 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼147.14ms] Passed 4 tests

An overview of server-side resources used by Ezusy - Image Swatches for Variable Product
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.0929.07 ▲3.06
Dashboard /wp-admin3.15 ▲0.0933.44 ▼6.65
Posts /wp-admin/edit.php3.26 ▲0.1639.31 ▼1.15
Add New Post /wp-admin/post-new.php5.51 ▲0.0778.54 ▼581.03
Media Library /wp-admin/upload.php3.09 ▲0.0926.30 ▲0.27
Ezusy /wp-admin/options-general.php?page=ezusy-setting-admin3.0620.64

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 1 new option
New WordPress options
ezusy_settings_reviews

Browser metrics Passed 4 tests

An overview of browser requirements for Ezusy - Image Swatches for Variable Product
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,792 ▲19115.65 ▲0.5312.43 ▲7.5678.05 ▼7.17
Dashboard /wp-admin2,939 ▲406.19 ▲0.03117.53 ▼17.26167.99 ▼18.49
Posts /wp-admin/edit.php2,749 ▲93.24 ▲0.0066.16 ▲0.74139.44 ▼5.36
Add New Post /wp-admin/post-new.php3,743 ▼6518.59 ▼0.48532.27 ▲46.12185.16 ▲14.92
Media Library /wp-admin/upload.php1,761 ▲95.52 ▲0.02156.58 ▲11.70204.35 ▲23.22
Ezusy /wp-admin/options-general.php?page=ezusy-setting-admin1,0812.3952.55127.49

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 1 option in the database
    • ezusy_settings_reviews

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/ezusy-image-swatches-for-variable-product/admin/partials/ezusy-admin-display.php
    • > /wp-content/plugins/ezusy-image-swatches-for-variable-product/public/partials/ezusy-public-display.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > 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
    • > 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

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

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 your attention: Please take inspiration from this readme.txt

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

The main PHP file in "Ezusy - Image Swatches for Variable Product" ver. 1.0.5 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ezusy-image-swatches-for-variable-product.php" instead of "ezusy.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0.0" instead of "4.0")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
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

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin