84% display-stock-status-for-woocommerce

Code Review | Display Stock Status For Woocommerce

WordPress plugin Display Stock Status For Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: display-stock-sta...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 18, 2022
  • Latest release: Sep 26, 2023
  • Number of updates: 4
  • Update frequency: every 78.0 days
  • Top authors: silverplugins217 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /267 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
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.18ms] Passed 4 tests

An overview of server-side resources used by Display Stock Status For Woocommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.86 ▼1.88
Dashboard /wp-admin3.31 ▲0.0049.94 ▲0.94
Posts /wp-admin/edit.php3.36 ▲0.0045.34 ▼6.08
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.93 ▼17.71
Media Library /wp-admin/upload.php3.23 ▲0.0036.32 ▲2.32

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Display Stock Status For Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲9913.30 ▼1.091.84 ▲0.2445.72 ▼2.40
Dashboard /wp-admin2,209 ▲185.88 ▲1.06111.35 ▲9.8142.86 ▼1.15
Posts /wp-admin/edit.php2,071 ▼182.00 ▼0.0043.93 ▲2.6135.24 ▼2.32
Add New Post /wp-admin/post-new.php1,533 ▼023.17 ▼0.06639.82 ▲22.2555.01 ▼7.93
Media Library /wp-admin/upload.php1,379 ▼124.20 ▼0.0599.24 ▼3.6240.63 ▼2.26

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/display-stock-status-for-woocommerce/main/backend/DSSFW_admin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/display-stock-status-for-woocommerce/main/resources/DSSFW-language.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/display-stock-status-for-woocommerce/main/resources/DSSFW-load-js-css.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/display-stock-status-for-woocommerce/main/frontend/DSSFW_front.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/display-stock-status-for-woocommerce/main/resources/DSSFW-installation-require.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Contributors: Contributors not specified
Please take inspiration from this readme.txt

display-stock-status-for-woocommerce/display-stock-status-main.php 92% from 13 tests

Analyzing the main PHP file in "Display Stock Status For Woocommerce" version 1.0
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("display-stock-status-for-woocommerce.php" instead of "display-stock-status-main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected5,942 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
SVG2002,959
CSS4713112,358
PHP73920328
JavaScript155146297

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin