83% variationpress

Code Review | VariationPress for WooCommerce

WordPress plugin VariationPress for WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: variationpress
  • Plugin version: 1.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.7.1
  • WordPress version: 6.3.1
  • First release: May 6, 2021
  • Latest release: May 26, 2021
  • Number of updates: 8
  • Update frequency: every 2.6 days
  • Top authors: sainwp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,575 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.01MB] [CPU: ▼11.08ms] Passed 4 tests

Analyzing server-side resources used by VariationPress for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.65 ▼4.00
Dashboard /wp-admin3.31 ▲0.0145.32 ▼10.46
Posts /wp-admin/edit.php3.36 ▲0.0145.43 ▼8.72
Add New Post /wp-admin/post-new.php5.89 ▲0.0184.72 ▼21.15
Media Library /wp-admin/upload.php3.23 ▲0.0139.27 ▲0.15

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

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

Browser metrics Passed 4 tests

A check of browser resources used by VariationPress for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.27 ▼1.311.63 ▼0.7244.81 ▼28.47
Dashboard /wp-admin2,222 ▲484.85 ▼0.96116.44 ▼10.1146.13 ▼1.75
Posts /wp-admin/edit.php2,105 ▲161.97 ▼0.0136.15 ▼6.2238.53 ▼2.68
Add New Post /wp-admin/post-new.php1,549 ▲2823.32 ▲0.23683.57 ▼17.3651.66 ▼7.39
Media Library /wp-admin/upload.php1,398 ▲104.21 ▲0.06109.80 ▼5.5547.31 ▼10.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means 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 fix the following
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant SAVP_FILE - assumed 'SAVP_FILE' (this will throw an Error in a future version of PHP) in wp-content/plugins/variationpress/includes/class-settings.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/variationpress/includes/class-product-meta.php:12
    • > PHP Warning
      Use of undefined constant SAVP_FILE - assumed 'SAVP_FILE' (this will throw an Error in a future version of PHP) in wp-content/plugins/variationpress/includes/class-settings.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/variationpress/includes/class-settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/variationpress/includes/class-variation-metabox.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/variationpress/includes/class-admin-product.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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
Attributes that require attention:
  • Screenshots: Screenshot #1 (Variations on frontend) image missing
You can take inspiration from this readme.txt

variationpress/variationpress.php 85% from 13 tests

This is the main PHP file of "VariationPress for WooCommerce" version 1.1.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected22,408 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript163,59591015,985
PHP135113382,430
CSS133451662,129
Sass37851,054
HTML1110338
JSON100190
LESS1115152
SVG5372122
Ruby1208

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity34.75
▷ Minimum class complexity1.00
▷ Maximum class complexity118.00
Average method complexity4.18
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes112.50%
Methods85
▷ Static methods89.41%
▷ Public methods8296.47%
▷ Protected methods33.53%
▷ Private methods00.00%
Functions8
▷ Named functions8100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/photoswipe/default-skin/default-skin.png0.53KB0.72KB0.00%