93% woo-based-stock-bar

Code Review | Woo based Stock Bar

WordPress plugin Woo based Stock Bar scored 93% from 54 tests.

About plugin

  • Plugin page: woo-based-stock-bar
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.3.1
  • WordPress version: 5.8.1
  • First release: Nov 21, 2015
  • Latest release: Nov 21, 2015
  • Number of updates: 3
  • Update frequency: every 24.7 days
  • Top authors: shasvb1108 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 648 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼142.33ms] Passed 4 tests

This is a short check of server-side resources used by Woo based Stock Bar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1632.08 ▲4.55
Dashboard /wp-admin3.09 ▲0.0442.53 ▼3.75
Posts /wp-admin/edit.php3.15 ▲0.0445.22 ▲0.40
Add New Post /wp-admin/post-new.php5.45 ▲0.0290.90 ▼567.42
Media Library /wp-admin/upload.php3.04 ▲0.0432.44 ▲1.44

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Woo based Stock Bar
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,705 ▲10915.80 ▲0.278.04 ▼0.3548.95 ▼3.72
Dashboard /wp-admin2,973 ▲426.06 ▲0.14141.50 ▲3.40107.88 ▼6.22
Posts /wp-admin/edit.php2,739 ▼02.69 ▲0.0164.04 ▼5.0186.50 ▼4.08
Add New Post /wp-admin/post-new.php1,500 ▼018.58 ▼0.27363.75 ▼13.40108.32 ▼9.83
Media Library /wp-admin/upload.php1,807 ▼05.00 ▼0.02153.67 ▼9.05120.33 ▲0.72

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

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 | 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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/woo-based-stock-bar/index.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === woo-based-stock-bar === )
  • Screenshots: Please add an image for screenshot #1 (Woocommerce product stock bar)
You can take inspiration from this readme.txt

woo-based-stock-bar/index.php 92% from 13 tests

"Woo based Stock Bar" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-based-stock-bar.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected378 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP13123319
CSS14359

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.92
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity8.25
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
Woo based product stock bar.png1.47KB0.73KB▼ 50.30%