84% woo-switcher-of-variants

Code Review | WooCommerce - Switcher of variants

WordPress plugin WooCommerce - Switcher of variants scored84%from 54 tests.

About plugin

  • Plugin page: woo-switcher-of-v...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9
  • WordPress version: 6.3.1
  • First release: May 15, 2018
  • Latest release: May 15, 2018
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: damianaquiine (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /591 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼11.68ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce - Switcher of variants
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0725.15 ▼21.50
Dashboard /wp-admin3.32 ▲0.0248.14 ▼2.59
Posts /wp-admin/edit.php3.37 ▲0.0148.99 ▼2.90
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.32 ▼19.71
Media Library /wp-admin/upload.php3.25 ▲0.0141.24 ▲3.67

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce - Switcher of variants
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,456 ▼30514.33 ▼0.050.54 ▼1.3918.69 ▼26.30
Dashboard /wp-admin2,200 ▲195.60 ▼0.1287.62 ▼15.0638.50 ▼9.23
Posts /wp-admin/edit.php2,099 ▼12.03 ▲0.0135.04 ▼7.3834.70 ▲0.36
Add New Post /wp-admin/post-new.php1,528 ▲223.60 ▲0.48686.50 ▼32.0366.21 ▲5.09
Media Library /wp-admin/upload.php1,402 ▼14.22 ▲0.04112.22 ▲9.4148.53 ▲4.58

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-switcher-of-variants/woo_change_variants.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === woo-switcher-of-variants === )
The official readme.txt might help

woo-switcher-of-variants/woo_change_variants.php 92% from 13 tests

The primary PHP file in "WooCommerce - Switcher of variants" version 1.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woo-switcher-of-variants.php" instead of "woo_change_variants.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin82 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP216980
CSS1001
JavaScript1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.29MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png12.67KB5.97KB▼ 52.85%
assets/thumbnail.png7.04KB3.60KB▼ 48.90%
assets/icon-256x256.png32.54KB14.18KB▼ 56.42%
assets/banner-772x250.png73.55KB33.58KB▼ 54.35%
assets/banner-1544x500.png174.21KB86.38KB▼ 50.41%