84% display-product-variations-dropdown-on-shop-page

Code Review | Display product variations dropdown on shop page

WordPress plugin Display product variations dropdown on shop page scored84%from 54 tests.

About plugin

  • Plugin page: display-product-v...
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Jul 11, 2020
  • Latest release: May 12, 2023
  • Number of updates: 16
  • Update frequency: every 64.8 days
  • Top authors: anzia (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /7,888 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.35ms] Passed 4 tests

Server-side resources used by Display product variations dropdown on shop page
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.40 ▼9.60
Dashboard /wp-admin3.37 ▲0.0644.29 ▼4.39
Posts /wp-admin/edit.php3.48 ▲0.1247.88 ▼0.41
Add New Post /wp-admin/post-new.php5.95 ▲0.0691.88 ▲2.66
Media Library /wp-admin/upload.php3.29 ▲0.0632.78 ▼2.99
Setting /wp-admin/admin.php?page=niwoovd-setting3.2831.72
Dashboard /wp-admin/admin.php?page=niwoovd-dashboard3.5531.27

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 26 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
recovery_mode_email_last_sent
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Display product variations dropdown on shop page
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6914.48 ▼0.141.10 ▼0.6144.80 ▼2.45
Dashboard /wp-admin2,226 ▲354.90 ▲0.01109.12 ▼24.0142.15 ▼19.59
Posts /wp-admin/edit.php2,112 ▲232.01 ▼0.0240.05 ▲6.1234.97 ▼0.83
Add New Post /wp-admin/post-new.php1,552 ▲1823.34 ▲0.28605.24 ▼82.7856.61 ▲2.91
Media Library /wp-admin/upload.php1,414 ▲264.22 ▲0.04100.29 ▼1.6643.71 ▼3.21
Setting /wp-admin/admin.php?page=niwoovd-setting8911.9528.8660.56
Dashboard /wp-admin/admin.php?page=niwoovd-dashboard1,4282.1813.4652.65

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=niwoovd-dashboard
    • > Error in wp-content/plugins/display-product-variations-dropdown-on-shop-page/includes/ni-variation-dropdown-dashboard.php+274
    Uncaught Error: Call to undefined function wc_price() in wp-content/plugins/display-product-variations-dropdown-on-shop-page/includes/ni-variation-dropdown-dashboard.php:274
    Stack trace:
    #0 wp-content/plugins/display-product-variations-dropdown-on-shop-page/includes/ni-variation-dropdown-shop-page-init.php(80): Ni_Variation_Dropdown_Dashboard->page_init()
    #1 wp-includes/class-wp-hook.php(310): Ni_Variation_Dropdown_Shop_Page_Init->add_page()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

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:
  • Screenshots: Please add images for these screenshots: #1 (Dashboard sales summary), #2 (Variation dropdown on shop page), #3 (Variation dropdown on shop page with product attribute), #4 (Setting)
The official readme.txt is a good inspiration

display-product-variations-dropdown-on-shop-page/display-variation-dropdown-on-shop-page.php 92% from 13 tests

The main file in "Display product variations dropdown on shop page" v. 1.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
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 ("display-product-variations-dropdown-on-shop-page.php" instead of "display-variation-dropdown-on-shop-page.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin5,523 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
CSS4113943,926
PHP5239621,480
JavaScript9613101
HTML1109
SVG1007

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity17.40
▷ Minimum class complexity4.00
▷ Maximum class complexity44.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods39
▷ Static methods12.56%
▷ Public methods39100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
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
5 PNG files occupy 0.44MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png15.89KB8.60KB▼ 45.89%
screenshot-3.png101.13KB34.10KB▼ 66.28%
screenshot-1.png229.42KB94.23KB▼ 58.93%
admin/css/lib/images/ui-icons_444444_256x240.png3.19KB3.49KB0.00%
screenshot-2.png101.60KB34.01KB▼ 66.53%