77% pure-wc-variations-swatches

Code Review | Pure WC Variation Swatches

WordPress plugin Pure WC Variation Swatches scored77%from 54 tests.

About plugin

  • Plugin page: pure-wc-variation...
  • Plugin version: 1.0.7
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Mar 1, 2023
  • Latest release: Oct 12, 2023
  • Number of updates: 16
  • Update frequency: every 14.1 days
  • Top authors: themepure (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /413 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.21MB] [CPU: ▼8.49ms] Passed 4 tests

Analyzing server-side resources used by Pure WC Variation Swatches
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2139.70 ▼11.87
Dashboard /wp-admin3.59 ▲0.2454.69 ▼15.02
Posts /wp-admin/edit.php3.64 ▲0.2854.64 ▲0.92
Add New Post /wp-admin/post-new.php6.09 ▲0.2087.19 ▼8.00
Media Library /wp-admin/upload.php3.43 ▲0.2041.34 ▲4.78

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 94 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pure WC Variation Swatches
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,943 ▲15714.73 ▲0.161.88 ▼0.1841.49 ▼1.16
Dashboard /wp-admin2,341 ▲1646.18 ▲0.61119.17 ▲23.5641.43 ▼3.72
Posts /wp-admin/edit.php2,275 ▲1753.28 ▲1.2957.19 ▲19.3536.13 ▲1.66
Add New Post /wp-admin/post-new.php1,536 ▲1023.28 ▼0.29659.05 ▲18.1836.29 ▼6.92
Media Library /wp-admin/upload.php1,409 ▲94.12 ▼0.0782.31 ▼25.9145.09 ▼2.92

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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 output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/pure-wc-variations-swatches/admin/app/app.php
    • > /wp-content/plugins/pure-wc-variations-swatches/public/partials/tp-wvs-public-display.php
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pure-wc-variations-swatches/admin/class-pure-wc-swatches-admin.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/pure-wc-variations-swatches/shortcodes/tpwvs-shortcodes.php:67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pure-wc-variations-swatches/includes/class-pure-wc-swatches.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pure-wc-variations-swatches/public/class-pure-wc-swatches-public.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/pure-wc-variations-swatches/shortcodes/pure-wc-swatches-shortcodes.php:66
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pure-wc-variations-swatches/admin/class-tp-wvs-admin.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pure-wc-variations-swatches/public/class-tp-wvs-public.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/pure-wc-variations-swatches/includes/class-tp-wvs.php:30

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 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
  • Screenshots: These screenshots do not have images: #8 (Attribute Variation Shape), #9 (Attribute Variation Display Behavior), #10 (Variation Swatches Size and Font Setting), #11 (Global Variation Image Swatches Attribute List Preview), #12 (Global Variation Color Swatches Attribute List Preview)
Please take inspiration from this readme.txt

pure-wc-variations-swatches/pure-wc-variation-swatches.php 85% from 13 tests

The principal PHP file in "Pure WC Variation Swatches" v. 1.0.7 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("pure-wc-variations-swatches.php" instead of "pure-wc-variation-swatches.php")
  • 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 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected56,216 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
JSON20042,096
CSS101,3268057,052
JavaScript107141,0534,275
PHP244701,3091,636
JSX1096421,130
SVG60027

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity13.44
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods91
▷ Static methods88.79%
▷ Public methods8189.01%
▷ Protected methods00.00%
▷ Private methods1010.99%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
10 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
build/images/refresh.4377180b.png0.73KB0.56KB▼ 23.49%
src/assets/img/features/features-3.png0.60KB0.46KB▼ 22.30%
build/images/features-1.c1b0ca19.png0.84KB0.63KB▼ 25.41%
build/images/logo.30ad9c00.png5.22KB2.72KB▼ 47.80%
build/images/features-3.955a3919.png0.60KB0.46KB▼ 22.30%