89% better-variation-price-for-woocommerce

Code Review | Better Variation Price for Woocommerce

WordPress plugin Better Variation Price for Woocommerce scored89%from 54 tests.

About plugin

  • Plugin page: better-variation-...
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Apr 22, 2021
  • Latest release: Jul 14, 2022
  • Number of updates: 53
  • Update frequency: every 8.5 days
  • Top authors: josserand (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active /8,993 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

Server-side resources used by Better Variation Price for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.02 ▼0.17
Dashboard /wp-admin3.32 ▼0.0247.52 ▼11.08
Posts /wp-admin/edit.php3.37 ▲0.0246.37 ▲1.74
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.25 ▼8.77
Media Library /wp-admin/upload.php3.25 ▲0.0237.07 ▲6.06

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Better Variation Price for Woocommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲14914.80 ▲0.566.23 ▲4.4842.46 ▼3.04
Dashboard /wp-admin2,195 ▲155.56 ▼0.0690.75 ▼10.8543.91 ▼1.09
Posts /wp-admin/edit.php2,100 ▼02.16 ▲0.1437.57 ▼1.5337.27 ▲2.57
Add New Post /wp-admin/post-new.php1,534 ▲818.43 ▼5.30641.72 ▼19.5770.17 ▲5.79
Media Library /wp-admin/upload.php1,403 ▲34.18 ▼0.0193.29 ▼4.4742.74 ▲1.02

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed: Please take inspiration from this readme.txt

better-variation-price-for-woocommerce/woo-better-variation-price.php 92% from 13 tests

The main PHP file in "Better Variation Price for Woocommerce" ver. 1.2.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("better-variation-price-for-woocommerce.php" instead of "woo-better-variation-price.php")

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 detected245 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP24350129
PO File2222283
JavaScript211633

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods112.50%
▷ Public methods337.50%
▷ Protected methods00.00%
▷ Private methods562.50%
Functions7
▷ Named functions114.29%
▷ Anonymous functions685.71%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin