77% yayswatches

Code Review | YaySwatches - Variation Swatches for WooCommerce

WordPress plugin YaySwatches - Variation Swatches for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: yayswatches
  • Plugin version: 1.7.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3.2
  • WordPress version: 6.3.1
  • First release: Jul 15, 2022
  • Latest release: Nov 2, 2023
  • Number of updates: 20
  • Update frequency: every 23.8 days
  • Top authors: yaycommerce (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /4,135 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.13MB] [CPU: ▼5.93ms] Passed 4 tests

Analyzing server-side resources used by YaySwatches - Variation Swatches for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1350.47 ▲5.44
Dashboard /wp-admin3.45 ▲0.1045.26 ▼17.04
Posts /wp-admin/edit.php3.56 ▲0.2052.53 ▲5.49
Add New Post /wp-admin/post-new.php6.05 ▲0.1684.55 ▼10.66
Media Library /wp-admin/upload.php3.37 ▲0.1435.71 ▼1.47
Help /wp-admin/admin.php?page=yaycommerce-help3.1725.52
Other plugins /wp-admin/admin.php?page=yaycommerce-other-plugins3.3432.67

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for YaySwatches - Variation Swatches for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲12014.35 ▲0.071.97 ▼0.6637.86 ▼5.61
Dashboard /wp-admin2,250 ▲735.66 ▲0.0391.31 ▼5.5442.10 ▲1.34
Posts /wp-admin/edit.php2,161 ▲612.02 ▲0.0149.62 ▲13.4739.80 ▲3.08
Add New Post /wp-admin/post-new.php1,558 ▲3223.42 ▲0.52604.30 ▼86.1352.54 ▲3.80
Media Library /wp-admin/upload.php1,455 ▲614.22 ▲0.02100.57 ▼4.6044.38 ▲2.25
Help /wp-admin/admin.php?page=yaycommerce-help280.420.063.88
Other plugins /wp-admin/admin.php?page=yaycommerce-other-plugins1,1242.3631.7329.81

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Trait 'Yay_Swatches\\Utils\\SingletonTrait' not found in wp-content/plugins/yayswatches/includes/Engine/Hooks.php on line 7
    • > PHP Notice
      Undefined variable: recommendedPlugins in wp-content/plugins/yayswatches/includes/YayCommerceMenu/views/other-plugins-content.php on line 22
    • > PHP Fatal error
      Trait 'Yay_Swatches\\Utils\\SingletonTrait' not found in wp-content/plugins/yayswatches/includes/Engine/ActDeact.php on line 9
    • > PHP Fatal error
      Trait 'Yay_Swatches\\Utils\\SingletonTrait' not found in wp-content/plugins/yayswatches/includes/Initialize.php on line 9

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=yaycommerce-help
    • > Network (severe)
    wp-admin/admin.php?page=yaycommerce-help - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: image swatches, color swatches, woocommerce variation swatches, woocommerce color swatches, woocommerce swatches...

yayswatches/yay-swatches.php 69% from 13 tests

The entry point to "YaySwatches - Variation Swatches for WooCommerce" version 1.7.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "4.7")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("yayswatches.php" instead of "yay-swatches.php")
  • Requires PHP: The required version number did not match the one declared in readme.txt ("5.3" instead of "5.4")

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
There were no executable files found in this plugin6,488 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript649193,334
PHP232741362,460
CSS46511687
SVG5007

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity10.73
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces8
Interfaces0
Traits1
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods87
▷ Static methods3641.38%
▷ Public methods7687.36%
▷ Protected methods1112.64%
▷ Private methods00.00%
Functions6
▷ Named functions116.67%
▷ Anonymous functions583.33%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin