73% toret-product-stock-alert-lite

Code Review | Toret Product Stock Alert For WooCommerce Lite

WordPress plugin Toret Product Stock Alert For WooCommerce Lite scored73%from 54 tests.

About plugin

  • Plugin page: toret-product-sto...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.9
  • WordPress version: 6.3.1
  • First release: May 19, 2018
  • Latest release: May 20, 2018
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: Musilda (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /542 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼8.12ms] Passed 4 tests

A check of server-side resources used by Toret Product Stock Alert For WooCommerce Lite
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▼0.0023.69 ▼19.60
Dashboard /wp-admin3.39 ▲0.0945.09 ▼2.62
Posts /wp-admin/edit.php3.51 ▲0.1551.73 ▲1.60
Add New Post /wp-admin/post-new.php5.97 ▲0.0981.09 ▼11.87
Media Library /wp-admin/upload.php3.32 ▲0.0936.91 ▲1.68
Product Stock Alert /wp-admin/options-general.php?page=toret-product-stock-alert3.3233.30

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

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

Browser metrics Passed 4 tests

Toret Product Stock Alert For WooCommerce Lite: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,471 ▼27513.13 ▼1.220.55 ▼1.2816.74 ▼27.92
Dashboard /wp-admin2,215 ▲244.89 ▼0.05104.98 ▲2.7235.67 ▼8.88
Posts /wp-admin/edit.php2,098 ▲62.05 ▲0.0539.05 ▼4.4535.42 ▼2.33
Add New Post /wp-admin/post-new.php1,533 ▲1923.52 ▲6.11665.44 ▼20.3563.51 ▲4.17
Media Library /wp-admin/upload.php1,388 ▼04.23 ▲0.1095.98 ▼6.4446.60 ▼0.46
Product Stock Alert /wp-admin/options-general.php?page=toret-product-stock-alert9272.0330.0231.19

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_stock_alert
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

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)
Good news, no errors were detected

SRP 50% from 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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/toret-product-stock-alert-lite/admin/views/admin.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Donate link: Please fix this invalid url: ""
Please take inspiration from this readme.txt

toret-product-stock-alert-lite/toret-product-stock-alert-lite.php 85% from 13 tests

The principal PHP file in "Toret Product Stock Alert For WooCommerce Lite" v. 1.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Requires at least: Required version must match the one declared in readme.txt ("4.0" instead of "3.0.0")

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 detected2,371 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript22871841,143
PHP13245357684
CSS22615458
PO File111924386

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity12.75
▷ Minimum class complexity2.00
▷ Maximum class complexity42.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods32
▷ Static methods721.88%
▷ Public methods2784.38%
▷ Protected methods00.00%
▷ Private methods515.62%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin