89% woo-color-swatch

Code Review | WooCommerce Variable Product With Image Swatch

WordPress plugin WooCommerce Variable Product With Image Swatch scored89%from 54 tests.

About plugin

  • Plugin page: woo-color-swatch
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7.3
  • WordPress version: 6.3.1
  • First release: Apr 14, 2017
  • Latest release: Apr 15, 2017
  • Number of updates: 9
  • Update frequency: every 0.2 days
  • Top authors: cactusthemes (88.89%)lampd (22.22%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,617 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
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by WooCommerce Variable Product With Image Swatch
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.21 ▼2.53
Dashboard /wp-admin3.32 ▲0.0245.60 ▼2.49
Posts /wp-admin/edit.php3.43 ▲0.0747.09 ▲2.27
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.45 ▼15.31
Media Library /wp-admin/upload.php3.24 ▲0.0136.57 ▲1.53

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Variable Product With Image Swatch
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,935 ▲18913.98 ▼0.408.58 ▲7.0435.73 ▼2.55
Dashboard /wp-admin2,212 ▲235.83 ▲0.88102.20 ▼20.8644.86 ▼1.08
Posts /wp-admin/edit.php2,101 ▲331.99 ▲0.0234.36 ▼0.9637.95 ▲5.36
Add New Post /wp-admin/post-new.php1,372 ▼15621.42 ▲3.36576.21 ▼40.9157.79 ▲3.64
Media Library /wp-admin/upload.php1,400 ▲124.14 ▼0.1391.30 ▼10.7644.52 ▲0.40

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3 in woo-color-swatch/assets to your readme.txt
  • Donate link: Invalid URI found ("")
You can take inspiration from this readme.txt

woo-color-swatch/main.php 92% from 13 tests

The principal PHP file in "WooCommerce Variable Product With Image Swatch" v. 1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-color-swatch.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin304 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP37561275
JavaScript19622
CSS1006
Markdown1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity13.00
▷ Minimum class complexity2.00
▷ Maximum class complexity27.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods210.00%
▷ Public methods1995.00%
▷ Protected methods00.00%
▷ Private methods15.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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
There were not PNG files found in your plugin