78% woo-out-of-stock-products

Code Review | Woo Out Of Stock Products

WordPress plugin Woo Out Of Stock Products scored78%from 54 tests.

About plugin

  • Plugin page: woo-out-of-stock-...
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9.4
  • WordPress version: 6.3.1
  • First release: Oct 1, 2015
  • Latest release: Mar 22, 2018
  • Number of updates: 68
  • Update frequency: every 13.4 days
  • Top authors: amg26 (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

2,000+ active /32,283 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▲0.46ms] Passed 4 tests

This is a short check of server-side resources used by Woo Out Of Stock Products
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0453.69 ▲15.00
Dashboard /wp-admin3.35 ▲0.0449.06 ▲0.74
Posts /wp-admin/edit.php3.40 ▲0.0448.69 ▲1.13
Add New Post /wp-admin/post-new.php5.93 ▲0.0489.63 ▼2.55
Media Library /wp-admin/upload.php3.27 ▲0.0435.62 ▲2.50
Out of Stock Report /wp-admin/edit.php?post_type=product&page=outofstock-stats3.0425.09

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woo Out Of Stock Products
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,922 ▲18713.60 ▼0.5410.89 ▲9.1655.64 ▲7.65
Dashboard /wp-admin2,207 ▲195.84 ▼0.22101.19 ▼0.7038.28 ▼6.71
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0539.62 ▲3.5634.18 ▼1.35
Add New Post /wp-admin/post-new.php1,518 ▼123.33 ▲0.04679.04 ▲39.7054.09 ▲3.31
Media Library /wp-admin/upload.php1,392 ▲44.21 ▲0.0396.02 ▼3.4141.09 ▼2.15
Out of Stock Report /wp-admin/edit.php?post_type=product&page=outofstock-stats280.440.083.55

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/woo-out-of-stock-products/admin/admin.php
    • > /wp-content/plugins/woo-out-of-stock-products/inc/shortcode.php
    • > /wp-content/plugins/woo-out-of-stock-products/woo-out-of-stock-products.php
    • > /wp-content/plugins/woo-out-of-stock-products/admin/woo-settings-tab.php
    • > /wp-content/plugins/woo-out-of-stock-products/inc/script-styles.php
    • > /wp-content/plugins/woo-out-of-stock-products/admin/class-outofstock-settings.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit.php?post_type=product&page=outofstock-stats
    • > Network (severe)
    wp-admin/edit.php?post_type=product&page=outofstock-stats - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: These screenshots lack descriptions #4, #5, #6, #0 in woo-out-of-stock-products/assets to your readme.txt
  • Donate link: Please fix this invalid url: "andrewgunn.org"
The official readme.txt is a good inspiration

woo-out-of-stock-products/woo-out-of-stock-products.php Passed 13 tests

This is the main PHP file of "Woo Out Of Stock Products" version 2.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
139 characters long description:
Dynamically display a custom uploaded or default "Out of Stock" image overlay for products in your WooCommerce store that are out of stock.

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 plugin251 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP76799229
CSS27520
JavaScript1232

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.29
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.32MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/sold-out-banner.png49.84KB47.08KB▼ 5.54%
assets/banner-diagnoal.png17.01KB6.28KB▼ 63.07%
assets/stamp-semi-diagonal.png59.85KB18.82KB▼ 68.55%
assets/sign-pin.png35.33KB12.04KB▼ 65.92%
assets/sold-out-stamp.png161.89KB60.92KB▼ 62.37%