83% wc-out-of-stock-message

Code Review | Out of Stock Message for WooCommerce

WordPress plugin Out of Stock Message for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: wc-out-of-stock-m...
  • Plugin version: 1.0.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 30, 2021
  • Latest release: Jul 13, 2022
  • Number of updates: 26
  • Update frequency: every 16.9 days
  • Top authors: coderstime (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

2,000+ active /11,039 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼1.65ms] Passed 4 tests

A check of server-side resources used by Out of Stock Message for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1036.37 ▼2.63
Dashboard /wp-admin3.41 ▲0.1149.21 ▼0.60
Posts /wp-admin/edit.php3.52 ▲0.1750.86 ▲4.76
Add New Post /wp-admin/post-new.php5.99 ▲0.1092.17 ▼8.14
Media Library /wp-admin/upload.php3.33 ▲0.1036.36 ▲5.85

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

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

Browser metrics Passed 4 tests

Out of Stock Message for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7413.19 ▼1.111.66 ▼0.0440.73 ▼6.14
Dashboard /wp-admin2,226 ▲415.90 ▲1.04101.02 ▼4.4942.41 ▲3.96
Posts /wp-admin/edit.php2,111 ▲222.16 ▲0.1741.69 ▲5.2636.80 ▲2.42
Add New Post /wp-admin/post-new.php1,557 ▲3818.07 ▼4.98629.88 ▲16.9964.98 ▲23.86
Media Library /wp-admin/upload.php1,408 ▲234.21 ▼0.01103.98 ▼0.8543.90 ▲0.69

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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 server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wc-out-of-stock-message/widget-out-of-stock.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 79% 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 need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Requires at least: Invalid version format
The official readme.txt might help

wc-out-of-stock-message/out-of-stock-msg.php 69% from 13 tests

The main file in "Out of Stock Message for WooCommerce" v. 1.0.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wc-out-of-stock-message.php" instead of "out-of-stock-msg.php")
  • Domain Path: The domain path folder does not exist ("/languages")
  • Description: Please keep the plugin description shorter than 140 characters (currently 494 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin1,077 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP6197240860
JavaScript41516215
CSS20102

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity17.33
▷ Minimum class complexity5.00
▷ Maximum class complexity36.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods36
▷ Static methods00.00%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants4
▷ Global constants4100.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
No PNG images were found in this plugin