93% variation-stock-inventory

Code Review | Variation Stock Inventory

WordPress plugin Variation Stock Inventory scored 93% from 54 tests.

About plugin

  • Plugin page: variation-stock-i...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4
  • WordPress version: 5.8.1
  • First release: May 6, 2020
  • Latest release: May 6, 2020
  • Number of updates: 4
  • Update frequency: every 1.0 days
  • Top authors: sahiljb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 261 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼140.13ms] Passed 4 tests

Analyzing server-side resources used by Variation Stock Inventory
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1836.27 ▲9.77
Dashboard /wp-admin3.12 ▲0.0745.30 ▲7.98
Posts /wp-admin/edit.php3.23 ▲0.1341.70 ▼3.49
Add New Post /wp-admin/post-new.php5.48 ▲0.0589.26 ▼559.43
Media Library /wp-admin/upload.php3.07 ▲0.0634.04 ▼5.59

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Variation Stock Inventory
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,816 ▲22016.27 ▲0.6714.26 ▲5.7744.87 ▼0.29
Dashboard /wp-admin2,977 ▲466.08 ▲0.14142.59 ▼9.92105.70 ▲3.14
Posts /wp-admin/edit.php2,743 ▲42.71 ▼0.0065.70 ▲1.2588.08 ▼1.13
Add New Post /wp-admin/post-new.php1,687 ▲1518.49 ▼0.25384.69 ▼50.85105.59 ▼0.21
Media Library /wp-admin/upload.php1,811 ▲45.04 ▼0.00161.73 ▲17.57111.01 ▼8.99

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/variation-stock-inventory/admin/partials/woocom-variation-stock-inventory-admin-display.php
    • > /wp-content/plugins/variation-stock-inventory/public/partials/woocom-variation-stock-inventory-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% 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
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === variation-stock-inventory === )
  • Screenshots: Add a description for screenshot #1 in variation-stock-inventory/assets to your readme.txt
Please take inspiration from this readme.txt

variation-stock-inventory/woocom-variation-stock-inventory.php 77% from 13 tests

Analyzing the main PHP file in "Variation Stock Inventory" version 1.0.0
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("variation-stock-inventory.php" instead of "woocom-variation-stock-inventory.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Please don't use more than 140 characters for the plugin description (currently 152 characters long)

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
Everything looks great! No dangerous files found in this plugin231 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12129559225
JavaScript24546
CSS2080

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity2.29
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.32
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin