89% woocommerce-product-stock-alert

Code Review | Product Stock Manager & Notifier for WooCommerce

WordPress plugin Product Stock Manager & Notifier for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: woocommerce-produ...
  • Plugin version: 2.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4.1
  • WordPress version: 6.3.1
  • First release: May 23, 2015
  • Latest release: Nov 21, 2023
  • Number of updates: 57
  • Update frequency: every 54.5 days
  • Top authors: Dualcube (68.42%)wcmp (22.81%)abhirup23 (7.02%)purnendu (7.02%)

Code review

54 tests

User reviews

51 reviews

Install metrics

6,000+ active /108,262 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.13MB] [CPU: ▲0.74ms] Passed 4 tests

Server-side resources used by Product Stock Manager & Notifier for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1340.28 ▲0.07
Dashboard /wp-admin3.43 ▲0.1347.11 ▼3.92
Posts /wp-admin/edit.php3.55 ▲0.1951.41 ▲3.78
Add New Post /wp-admin/post-new.php6.01 ▲0.1396.04 ▲3.47
Media Library /wp-admin/upload.php3.35 ▲0.1335.10 ▲3.32

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 66 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Product Stock Manager & Notifier for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲4114.21 ▼0.171.66 ▼0.3245.24 ▲1.32
Dashboard /wp-admin2,208 ▲285.62 ▲0.0189.51 ▼3.5739.34 ▼2.48
Posts /wp-admin/edit.php2,117 ▲171.96 ▼0.0039.78 ▲0.1136.27 ▲1.83
Add New Post /wp-admin/post-new.php1,539 ▲1323.39 ▼0.37634.05 ▲18.0451.51 ▲3.55
Media Library /wp-admin/upload.php1,407 ▲134.18 ▲0.0294.75 ▼4.6540.92 ▼0.76

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
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: wordpress, out of stock, woocommerce, stock alert, stock...

woocommerce-product-stock-alert/product_stock_alert.php 85% from 13 tests

Analyzing the main PHP file in "Product Stock Manager & Notifier for WooCommerce" version 2.2.0
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 174 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-product-stock-alert.php" instead of "product_stock_alert.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected37,882 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
JSON30019,618
CSS631111,435
PHP273885332,638
JavaScript11150352,395
Sass1303171,701
JSX17276
SVG10019

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity21.00
▷ Minimum class complexity2.00
▷ Maximum class complexity61.00
Average method complexity4.30
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods97
▷ Static methods55.15%
▷ Public methods9597.94%
▷ Protected methods22.06%
▷ Private methods00.00%
Functions24
▷ Named functions2395.83%
▷ Anonymous functions14.17%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/placeholder.png2.75KB2.92KB0.00%
assets/images/fpd/grid.png2.69KB0.13KB▼ 95.17%