83% woo-in-stock-notifier

Code Review | Woo In-Stock Notifier

WordPress plugin Woo In-Stock Notifier scored83%from 54 tests.

About plugin

  • Plugin page: woo-in-stock-noti...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5.0-5.8
  • WordPress version: 6.3.1
  • First release: Aug 16, 2017
  • Latest release: Nov 8, 2021
  • Number of updates: 16
  • Update frequency: every 96.6 days
  • Top authors: gk.loveweb (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

40+ active /2,270 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

A check of server-side resources used by Woo In-Stock Notifier
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.51 ▲1.74
Dashboard /wp-admin3.31 ▼0.0444.46 ▼13.02
Posts /wp-admin/edit.php3.36 ▲0.0044.95 ▼2.19
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.17 ▼14.83
Media Library /wp-admin/upload.php3.23 ▲0.0031.33 ▼0.18

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Woo In-Stock Notifier
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.27 ▼1.111.77 ▲0.1043.38 ▼1.06
Dashboard /wp-admin2,203 ▲154.84 ▼1.06109.15 ▲9.7142.18 ▼2.62
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0234.13 ▼5.4133.82 ▲1.96
Add New Post /wp-admin/post-new.php1,533 ▲923.27 ▲0.15638.28 ▼5.1853.55 ▼12.42
Media Library /wp-admin/upload.php1,382 ▼94.20 ▼0.1296.20 ▼1.1840.61 ▼0.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-in-stock-notifier/instock-init.php on line 35
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/woo-in-stock-notifier/instock-init.php on line 35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/woo-in-stock-notifier/templates/email/wsn-email-template.php:10
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-in-stock-notifier/instock-init.php on line 35

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention: The official readme.txt might help

woo-in-stock-notifier/instock-init.php 69% from 13 tests

The main file in "Woo In-Stock Notifier" v. 1.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Requires at least: Required version must match the one declared in readme.txt ("5.2" instead of "2.5.0")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-in-stock-notifier.php" instead of "instock-init.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: The description should be shorter than 140 characters (currently 151 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin1,233 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP113817631,229
CSS2422
JavaScript2022

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity20.33
▷ Minimum class complexity2.00
▷ Maximum class complexity51.00
Average method complexity3.97
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods39
▷ Static methods37.69%
▷ Public methods39100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
PNG images were not found in this plugin