83% instock-products-for-woocommerce

Code Review | Instock Products for Woocommerce

WordPress plugin Instock Products for Woocommerce scored 83% from 54 tests.

About plugin

  • Plugin page: instock-products-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Dec 28, 2022
  • Latest release: Dec 28, 2022
  • Number of updates: 11
  • Update frequency: N/A
  • Top authors: smartsoftfirm (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 136 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▲6.12ms] Passed 4 tests

A check of server-side resources used by Instock Products for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0636.95 ▼2.87
Dashboard /wp-admin3.35 ▲0.0548.06 ▲5.04
Posts /wp-admin/edit.php3.47 ▲0.1145.86 ▲2.74
Add New Post /wp-admin/post-new.php5.95 ▲0.07131.34 ▲46.64
Media Library /wp-admin/upload.php3.28 ▲0.0549.84 ▲19.56

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Instock Products for Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲13013.57 ▼0.755.12 ▲3.2140.87 ▼11.83
Dashboard /wp-admin2,207 ▲225.77 ▼0.0294.86 ▼12.8939.19 ▼0.41
Posts /wp-admin/edit.php2,090 ▲42.00 ▲0.0033.90 ▼1.6232.55 ▼0.86
Add New Post /wp-admin/post-new.php1,358 ▼16117.73 ▼5.35839.47 ▲200.5794.86 ▲47.47
Media Library /wp-admin/upload.php1,392 ▲14.26 ▲0.12169.90 ▲65.2193.24 ▲43.52

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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 items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/instock-products-for-woocommerce/public/partials/instock-products-woocommerce-public-display.php
    • > /wp-content/plugins/instock-products-for-woocommerce/admin/partials/instock-products-woocommerce-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention: Please take inspiration from this readme.txt

instock-products-for-woocommerce/instock-products-woocommerce.php 85% from 13 tests

The primary PHP file in "Instock Products for Woocommerce" version 1.0.0 is used by WordPress to initiate all plugin functionality
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 ("instock-products-for-woocommerce.php" instead of "instock-products-woocommerce.php")
  • Description: The description should be shorter than 140 characters (currently 179 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin184 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12122533178
JavaScript24546
CSS2080

PHP code Passed 2 tests

This is a short overview 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.10
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected