83% woo-show-stock

Code Review | Show Stock Status for WooCommerce

WordPress plugin Show Stock Status for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: woo-show-stock
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.2.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.1.1
  • WordPress version: 6.3.1
  • First release: Jun 21, 2017
  • Latest release: Jan 4, 2023
  • Number of updates: 24
  • Update frequency: every 84.8 days
  • Top authors: niloybrightvessel (54.17%)brightvesseldev (50%)

Code review

54 tests

User reviews

29 reviews

Install metrics

2,000+ active /20,518 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.93ms] Passed 4 tests

Analyzing server-side resources used by Show Stock Status for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0342.39 ▲0.57
Dashboard /wp-admin3.34 ▼0.0146.72 ▼15.57
Posts /wp-admin/edit.php3.39 ▲0.0350.81 ▲1.94
Add New Post /wp-admin/post-new.php5.92 ▲0.0382.05 ▼2.77
Media Library /wp-admin/upload.php3.26 ▲0.0333.08 ▼1.94

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Show Stock Status for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.44 ▼0.201.79 ▼0.0744.40 ▲0.66
Dashboard /wp-admin2,206 ▲214.85 ▼0.00111.76 ▼2.2739.53 ▼6.81
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0437.02 ▼1.6133.63 ▼0.35
Add New Post /wp-admin/post-new.php1,514 ▼017.68 ▲0.21692.30 ▲6.6159.91 ▲1.07
Media Library /wp-admin/upload.php1,388 ▲34.18 ▼0.0493.62 ▼9.0540.74 ▼2.69

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • bpwcss_installed
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woo-show-stock/main.php:112

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: custom, stock, show stock, stock status, status

woo-show-stock/main.php 77% from 13 tests

This is the main PHP file of "Show Stock Status for WooCommerce" version 1.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woo-show-stock.php" instead of "main.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("4.0" instead of "4.9")
  • Requires PHP: Required version does not match the one declared in readme.txt ("5.6" instead of "7.2.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected159 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12742159

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.58
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%
Functions6
▷ Named functions6100.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 were not PNG files found in your plugin