74% ni-woocommerce-stock

Code Review | Ni WooCommerce Stock Alert Notification

WordPress plugin Ni WooCommerce Stock Alert Notification scored74%from 54 tests.

About plugin

  • Plugin page: ni-woocommerce-stock
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 17, 2018
  • Latest release: Feb 19, 2023
  • Number of updates: 16
  • Update frequency: every 110.6 days
  • Top authors: anzia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,050 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.48ms] Passed 4 tests

Server-side resources used by Ni WooCommerce Stock Alert Notification
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0620.63 ▼18.46
Dashboard /wp-admin3.33 ▲0.0344.96 ▼4.08
Posts /wp-admin/edit.php3.45 ▲0.0945.74 ▲0.27
Add New Post /wp-admin/post-new.php5.91 ▲0.0380.88 ▼7.80
Media Library /wp-admin/upload.php3.26 ▲0.0333.32 ▼3.56
Setting /wp-admin/admin.php?page=ni-niwoostock-setting3.2937.20
Product Stock /wp-admin/admin.php?page=ni-product-stock3.3734.26
Register Email /wp-admin/admin.php?page=product-register-email3.2831.01
Dashboard /wp-admin/admin.php?page=niwoostock3.3035.24

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 37 new files
Database: 1 new table, 6 new options
New tables
wp_niwoostock
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Ni WooCommerce Stock Alert Notification
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,496 ▼23913.57 ▼0.720.55 ▼1.0319.84 ▼21.09
Dashboard /wp-admin2,237 ▲494.82 ▼0.06109.40 ▲7.9139.79 ▼4.17
Posts /wp-admin/edit.php2,120 ▲342.01 ▼0.0440.77 ▲3.7634.18 ▲0.70
Add New Post /wp-admin/post-new.php1,539 ▲617.45 ▼5.99680.24 ▲4.4771.69 ▲13.92
Media Library /wp-admin/upload.php1,413 ▲224.22 ▼0.0096.45 ▼0.5142.86 ▼3.07
Setting /wp-admin/admin.php?page=ni-niwoostock-setting1,3602.4352.7826.58
Product Stock /wp-admin/admin.php?page=ni-product-stock9781.9934.5429.67
Register Email /wp-admin/admin.php?page=product-register-email9472.1232.4629.70
Dashboard /wp-admin/admin.php?page=niwoostock9862.0526.3029.76

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_niwoostock
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

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 Passed 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
The SRP test was a success

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=niwoostock
    • > Network (severe)
    wp-content/plugins/ni-woocommerce-stock/admin/css/jquery-ui?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Dashboard show product information), #2 (Register email report), #3 (Stock report), #4 (Product email and product notes.), #5 (Customer out of stock product email.), #6 (Setting option.)
The official readme.txt is a good inspiration

ni-woocommerce-stock/ni-woocommerce-stock.php Passed 13 tests

The primary PHP file in "Ni WooCommerce Stock Alert Notification" version 1.1.2 is used by WordPress to initiate all plugin functionality
111 characters long description:
Ni WooCommerce Stock alert plugin help you to retain your valuable customer when store product is out of stock.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin8,047 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS5951013,917
SVG1002,671
PHP10167601,271
JavaScript64667188

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity13.20
▷ Minimum class complexity2.00
▷ Maximum class complexity26.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods54
▷ Static methods11.85%
▷ Public methods54100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
9 PNG files occupy 0.18MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png30.84KB18.27KB▼ 40.76%
screenshot-2.png12.53KB8.04KB▼ 35.86%
screenshot-4.png54.41KB21.46KB▼ 60.55%
screenshot-5.png14.09KB8.55KB▼ 39.28%
admin/css/images/ui-icons_555555_256x240.png6.84KB4.18KB▼ 38.84%