73% stock-message

Code Review | Stock Message

WordPress plugin Stock Message scored73%from 54 tests.

About plugin

  • Plugin page: stock-message
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.2-5.2
  • WordPress version: 6.3.1
  • First release: Jul 10, 2015
  • Latest release: May 31, 2019
  • Number of updates: 3
  • Update frequency: every 473.7 days
  • Top authors: aihimel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,124 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.31ms] Passed 4 tests

Server-side resources used by Stock Message
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.61 ▼3.15
Dashboard /wp-admin3.34 ▲0.0351.96 ▼2.62
Posts /wp-admin/edit.php3.39 ▲0.0350.16 ▼1.30
Add New Post /wp-admin/post-new.php5.94 ▲0.0586.37 ▼18.18
Media Library /wp-admin/upload.php3.26 ▲0.0341.39 ▲6.28
Stock Message /wp-admin/admin.php?page=woocommerce-custom-stock-message3.2333.53

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 8 new options
New WordPress options
woocommerce-custom-stock-message__in-stock-message
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
woocommerce-custom-stock-message__out-of-stock-message
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Stock Message
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.35 ▼0.132.16 ▲0.4245.43 ▼1.65
Dashboard /wp-admin2,202 ▲225.59 ▲0.0885.99 ▼5.8844.20 ▼3.08
Posts /wp-admin/edit.php2,104 ▲42.00 ▼0.0239.48 ▼2.8238.06 ▲2.23
Add New Post /wp-admin/post-new.php1,530 ▲423.51 ▼0.01685.59 ▲9.9361.93 ▲7.95
Media Library /wp-admin/upload.php1,398 ▲14.22 ▲0.0094.49 ▼5.2643.93 ▲3.33
Stock Message /wp-admin/admin.php?page=woocommerce-custom-stock-message8321.9925.2241.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/stock-message/index.php
    • > /wp-content/plugins/stock-message/stock-message.php
    • > /wp-content/plugins/stock-message/four_zero_four.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/stock-message/admin-contorl-form.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=woocommerce-custom-stock-message
    • > Network (severe)
    wp-content/plugins/woocommerce-custom-stock-message/bootstrap-3.3.5/css/bootstrap.min.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=woocommerce-custom-stock-message
    • > Network (severe)
    wp-content/plugins/woocommerce-custom-stock-message/bootstrap-3.3.5/css/bootstrap.min.js?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 your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Out Of Stock Message), #2 (In Stock Message), #3 (Admin Panel)
You can take inspiration from this readme.txt

stock-message/stock-message.php Passed 13 tests

The primary PHP file in "Stock Message" version 1.1.0 is used by WordPress to initiate all plugin functionality
65 characters long description:
Customize your out of stock message and get you visitors engaged.

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
No dangerous file extensions were detected9,379 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
CSS59227,388
JavaScript35821991,602
SVG100288
PHP43924101

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods981.82%
▷ Protected methods00.00%
▷ Private methods218.18%
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

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin