68% back-in-stock-notifications-for-woocommerce

Code Review | Back in stock notifications for WooCommerce

WordPress plugin Back in stock notifications for WooCommerce scored68%from 54 tests.

About plugin

  • Plugin page: back-in-stock-not...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8.6-6.3.2
  • WordPress version: 6.3.1
  • First release: Feb 28, 2023
  • Latest release: Oct 17, 2023
  • Number of updates: 7
  • Update frequency: every 33.0 days
  • Top authors: wpsimplesolutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /169 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Back in stock notifications for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.86 ▲1.4061.00 ▲12.61
Dashboard /wp-admin4.70 ▲1.3962.75 ▲14.76
Posts /wp-admin/edit.php4.75 ▲1.3957.60 ▲6.37
Add New Post /wp-admin/post-new.php7.22 ▲1.3396.36 ▼1.25
Media Library /wp-admin/upload.php4.56 ▲1.3353.45 ▲18.32
Scheduled Actions /wp-admin/tools.php?page=action-scheduler4.7255.47

Server storage [IO: ▲1.25MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 260 new files
Database: 5 new tables, 10 new options
New tables
wp_actionscheduler_groups
wp_actionscheduler_actions
wp_actionscheduler_claims
wp_actionscheduler_logs
wp_wsnm_actions
New WordPress options
action_scheduler_lock_async-request-runner
widget_theysaidso_widget
widget_recent-comments
db_upgraded
schema-ActionScheduler_LoggerSchema
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
schema-ActionScheduler_StoreSchema
action_scheduler_hybrid_store_demarkation

Browser metrics Passed 4 tests

This is an overview of browser requirements for Back in stock notifications for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.35 ▼0.072.09 ▼0.5043.19 ▼2.30
Dashboard /wp-admin2,210 ▲305.58 ▼0.0496.97 ▼4.8742.83 ▼0.44
Posts /wp-admin/edit.php2,115 ▲152.17 ▲0.1637.66 ▼0.7034.68 ▼1.27
Add New Post /wp-admin/post-new.php1,549 ▲1418.06 ▼0.23630.02 ▼51.5562.53 ▼8.69
Media Library /wp-admin/upload.php1,418 ▲214.19 ▼0.0499.91 ▼3.0043.10 ▼1.19
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,2631.9630.0028.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie tables were found after uninstall: 5 tables
    • wp_actionscheduler_claims
    • wp_actionscheduler_actions
    • wp_actionscheduler_logs
    • wp_actionscheduler_groups
    • wp_wsnm_actions
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • action_scheduler_lock_async-request-runner
    • schema-ActionScheduler_LoggerSchema
    • schema-ActionScheduler_StoreSchema
    • widget_recent-posts
    • db_upgraded
    • action_scheduler_hybrid_store_demarkation
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/back-in-stock-notifications-for-woocommerce/admin/parts/settings-page-footer.php
    • > /wp-content/plugins/back-in-stock-notifications-for-woocommerce/trunk/admin/parts/settings-page-footer.php
  • 106× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/back-in-stock-notifications-for-woocommerce/public/parts/pre-form-content.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/back-in-stock-notifications-for-woocommerce/trunk/public/parts/pre-form-content.php:1
    • > PHP Warning
      Use of undefined constant WSNM_URL - assumed 'WSNM_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/back-in-stock-notifications-for-woocommerce/admin/parts/settings-page-header.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/back-in-stock-notifications-for-woocommerce/public/parts/form-modal.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_RecurringSchedule' not found in wp-content/plugins/back-in-stock-notifications-for-woocommerce/trunk/packages/action-scheduler/classes/schedules/ActionScheduler_CronSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Logger' not found in wp-content/plugins/back-in-stock-notifications-for-woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_wpCommentLogger.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_SimpleSchedule' not found in wp-content/plugins/back-in-stock-notifications-for-woocommerce/packages/action-scheduler/classes/schedules/ActionScheduler_CanceledSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_AdminView_Deprecated' not found in wp-content/plugins/back-in-stock-notifications-for-woocommerce/packages/action-scheduler/classes/ActionScheduler_AdminView.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_SimpleSchedule' not found in wp-content/plugins/back-in-stock-notifications-for-woocommerce/trunk/packages/action-scheduler/classes/schedules/ActionScheduler_CanceledSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Store' not found in wp-content/plugins/back-in-stock-notifications-for-woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore.php:6

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt is a good inspiration

back-in-stock-notifications-for-woocommerce/woo-stock-notify-me.php 92% from 13 tests

"Back in stock notifications for WooCommerce" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("back-in-stock-notifications-for-woocommerce.php" instead of "woo-stock-notify-me.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected8,619 lines of code in 117 files:
LanguageFilesBlank linesComment linesLines of code
PHP1051,7235,3467,563
PO File2216248602
Sass310291
JavaScript233127
SVG10032
CSS4034

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity10.87
▷ Minimum class complexity1.00
▷ Maximum class complexity81.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces2
Interfaces6
Traits0
Classes172
▷ Abstract classes3017.44%
▷ Concrete classes14282.56%
▷ Final classes00.00%
Methods1,338
▷ Static methods1329.87%
▷ Public methods1,02476.53%
▷ Protected methods26820.03%
▷ Private methods463.44%
Functions58
▷ Named functions4272.41%
▷ Anonymous functions1627.59%
Constants78
▷ Global constants1215.38%
▷ Class constants6684.62%
▷ Public constants66100.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 images were found in this plugin