84% woo-custom-stock-status

Code Review | Woo Custom Stock Status

WordPress plugin Woo Custom Stock Status scored84%from 54 tests.

About plugin

  • Plugin page: woo-custom-stock-...
  • Plugin version: 1.3.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: May 17, 2016
  • Latest release: Dec 2, 2023
  • Number of updates: 46
  • Update frequency: every 59.9 days
  • Top authors: softound (100%)

Code review

54 tests

User reviews

35 reviews

Install metrics

10,000+ active /132,948 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

An overview of server-side resources used by Woo Custom Stock Status
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.86 ▲0.01
Dashboard /wp-admin3.31 ▼0.0445.44 ▼16.79
Posts /wp-admin/edit.php3.36 ▲0.0048.77 ▲0.19
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.55 ▼6.93
Media Library /wp-admin/upload.php3.23 ▲0.0033.11 ▲1.50

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Woo Custom Stock Status
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.27 ▲0.131.78 ▼0.0640.11 ▼3.51
Dashboard /wp-admin2,198 ▲205.62 ▼0.0190.70 ▼27.2939.43 ▼7.00
Posts /wp-admin/edit.php2,100 ▲32.02 ▲0.0839.05 ▲3.5834.85 ▲0.67
Add New Post /wp-admin/post-new.php1,535 ▲918.55 ▼4.83596.84 ▼6.0162.95 ▲10.66
Media Library /wp-admin/upload.php1,400 ▼04.17 ▼0.0394.31 ▼2.6441.18 ▼4.31

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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
Please fix the following
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/woo-custom-stock-status/includes/class-wc-stock-product.php
    • > /wp-content/plugins/woo-custom-stock-status/includes/class-wc-stock-setting.php
    • > /wp-content/plugins/woo-custom-stock-status/woo-custom-stock-status.php
    • > /wp-content/plugins/woo-custom-stock-status/includes/class-wc-stock-base.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #10 (Custom stock status shortcode in widget), #11 (Custom stock status shortcode in pages / posts)
The official readme.txt is a good inspiration

woo-custom-stock-status/woo-custom-stock-status.php Passed 13 tests

This is the main PHP file of "Woo Custom Stock Status" version 1.3.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
127 characters long description:
Write the custom stock status with different colors for each woocommerce product, to show in product details and listing pages.

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
Everything looks great! No dangerous files found in this plugin619 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP4178185619

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity28.75
▷ Minimum class complexity2.00
▷ Maximum class complexity52.00
Average method complexity4.58
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin