90% stock-triggers-for-woocommerce

Code Review | Stock Triggers for WooCommerce

WordPress plugin Stock Triggers for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: stock-triggers-fo...
  • Plugin version: 1.6.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Jan 20, 2021
  • Latest release: Sep 26, 2023
  • Number of updates: 26
  • Update frequency: every 37.7 days
  • Top authors: algoritmika (76.92%)wpcodefactory (26.92%)

Code review

54 tests

User reviews

5 reviews

Install metrics

70+ active /2,088 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.01MB] [CPU: ▼4.92ms] Passed 4 tests

Server-side resources used by Stock Triggers for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.25 ▼6.22
Dashboard /wp-admin3.32 ▲0.0251.42 ▼3.15
Posts /wp-admin/edit.php3.37 ▲0.0147.63 ▼0.51
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.35 ▼9.54
Media Library /wp-admin/upload.php3.24 ▲0.0137.90 ▼0.78

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Stock Triggers for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▼0.321.66 ▼0.0842.22 ▼2.45
Dashboard /wp-admin2,195 ▲185.59 ▼0.0589.18 ▼11.1942.55 ▲0.31
Posts /wp-admin/edit.php2,100 ▲31.98 ▼0.0238.90 ▲2.7336.42 ▲3.29
Add New Post /wp-admin/post-new.php1,535 ▲918.42 ▼4.71603.27 ▼91.4363.38 ▲0.83
Media Library /wp-admin/upload.php1,403 ▲34.20 ▼0.1196.02 ▼3.4241.94 ▼3.90

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: woo commerce, stock, woocommerce

stock-triggers-for-woocommerce/stock-triggers-for-woocommerce.php Passed 13 tests

"Stock Triggers for WooCommerce" version 1.6.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
66 characters long description:
Automatic product stock increase/decrease actions for WooCommerce.

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
No dangerous file extensions were detected758 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP8127419626
PO File14966132

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity12.00
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity3.03
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes114.29%
Methods38
▷ Static methods12.63%
▷ Public methods38100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected