84% custom-product-stock-statuses-for-woocommerce

Code Review | Custom Product Stock Statuses for WooCommerce

WordPress plugin Custom Product Stock Statuses for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: custom-product-st...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-5.8
  • WordPress version: 6.3.1
  • First release: Sep 2, 2021
  • Latest release: Sep 2, 2021
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: opr18 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /375 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.00MB] [CPU: ▼5.81ms] Passed 4 tests

An overview of server-side resources used by Custom Product Stock Statuses for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0041.69 ▲3.66
Dashboard /wp-admin3.31 ▼0.0344.05 ▼15.52
Posts /wp-admin/edit.php3.37 ▲0.0144.82 ▼1.37
Add New Post /wp-admin/post-new.php5.89 ▲0.0177.27 ▼8.75
Media Library /wp-admin/upload.php3.24 ▲0.0137.12 ▲2.40
Custom stock statuses /wp-admin/admin.php?page=custom-stock-statuses3.2028.90

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Custom Product Stock Statuses for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2914.74 ▲0.351.75 ▼0.0143.44 ▲4.23
Dashboard /wp-admin2,203 ▲185.82 ▲0.0199.43 ▼2.1738.51 ▲0.72
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0056.18 ▲20.2837.11 ▲4.90
Add New Post /wp-admin/post-new.php1,514 ▼517.65 ▼5.63671.30 ▼5.5357.63 ▼3.70
Media Library /wp-admin/upload.php1,388 ▲34.21 ▲0.0299.29 ▼7.4145.20 ▼2.94
Custom stock statuses /wp-admin/admin.php?page=custom-stock-statuses7732.0228.3227.83

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
  • 1× 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/custom-product-stock-statuses-for-woocommerce/custom-product-stock-statuses-for-woocommerce.php:19

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: woocommerce, custom stock status, stock, woo commerce, products

custom-product-stock-statuses-for-woocommerce/custom-product-stock-statuses-for-woocommerce.php 85% from 13 tests

The entry point to "Custom Product Stock Statuses for WooCommerce" version 1.0.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages/")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.0" instead of "2.6")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin61 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP181761

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.07
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%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin