84% variations-on-product-page

Code Review | Variations On Product Page

WordPress plugin Variations On Product Page scored84%from 54 tests.

About plugin

  • Plugin page: variations-on-pro...
  • Plugin version: 1.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 6.3.1
  • First release: Dec 2, 2018
  • Latest release: Dec 2, 2018
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: R3dC0d3 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /447 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼6.88ms] Passed 4 tests

This is a short check of server-side resources used by Variations On Product Page
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.27 ▼2.93
Dashboard /wp-admin3.36 ▲0.0649.73 ▼3.28
Posts /wp-admin/edit.php3.48 ▲0.1245.72 ▼5.28
Add New Post /wp-admin/post-new.php5.94 ▲0.0591.13 ▼16.01
Media Library /wp-admin/upload.php3.29 ▲0.0537.44 ▲3.82
Product Variations /wp-admin/admin.php?page=variations-on-product3.2531.47

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Variations On Product Page
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.29 ▼1.081.77 ▲0.2444.42 ▲6.12
Dashboard /wp-admin2,206 ▲215.77 ▼0.0598.98 ▼1.5138.78 ▼3.88
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0236.25 ▼2.8733.59 ▼10.18
Add New Post /wp-admin/post-new.php1,533 ▲1423.26 ▼0.32649.42 ▲42.5548.73 ▼14.45
Media Library /wp-admin/upload.php1,391 ▲64.23 ▼0.04101.62 ▲0.2444.31 ▲2.66
Product Variations /wp-admin/admin.php?page=variations-on-product8102.0325.0724.14

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

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
Good news, no errors were detected

SRP 50% 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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/variations-on-product-page/variations-on-product.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/variations-on-product-page/settings.php:204

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

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
Attributes that require attention:
  • Contributors: The plugin contributors field is missing
The official readme.txt is a good inspiration

variations-on-product-page/variations-on-product.php 92% from 13 tests

The main PHP script in "Variations On Product Page" version 1.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("variations-on-product-page.php" instead of "variations-on-product.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected333 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP23551264
JavaScript118269

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions00.00%
▷ Anonymous functions11100.00%
Constants3
▷ Global constants3100.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