94% in-stock-layered-nav-for-woocommerce

Code Review | In Stock Layered Nav for WooCommerce

WordPress plugin In Stock Layered Nav for WooCommerce scored 94% from 53 tests.

About plugin

  • Plugin page: in-stock-layered-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5
  • WordPress version: 5.8.1
  • First release: Apr 4, 2016
  • Latest release: Apr 5, 2016
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: desrosj (100%)

Code review

53 tests

User reviews

1 review

Install metrics

30+ active / 1,868 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

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

An overview of server-side resources used by In Stock Layered Nav for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.83 ▲0.1134.43 ▲16.04
Dashboard /wp-admin3.06 ▲0.0043.99 ▲1.90
Posts /wp-admin/edit.php3.11 ▲0.0043.27 ▲1.55
Add New Post /wp-admin/post-new.php5.42 ▼0.0188.41 ▼1,107.29
Media Library /wp-admin/upload.php3.00 ▼0.0130.59 ▼4.85

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by In Stock Layered Nav for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,673 ▲6715.68 ▼0.229.01 ▼0.5045.41 ▼0.59
Dashboard /wp-admin2,930 ▲806.03 ▲0.22136.51 ▼1.55108.33 ▲0.20
Posts /wp-admin/edit.php2,703 ▼32.69 ▲0.0175.82 ▲9.2188.22 ▼12.43
Add New Post /wp-admin/post-new.php1,653 ▲218.90 ▲1.50361.44 ▼12.65107.93 ▲1.53
Media Library /wp-admin/upload.php1,772 ▼05.02 ▲0.00150.44 ▲11.95109.10 ▼11.97

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

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)
Good news, no errors were detected

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 take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/in-stock-layered-nav-for-woocommerce/in-stock-layered-nav-for-woocommerce.php:18

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: stock, layered nav, faceted search, woocommerce

in-stock-layered-nav-for-woocommerce/in-stock-layered-nav-for-woocommerce.php Passed 13 tests

The entry point to "In Stock Layered Nav for WooCommerce" version 1.0 is a PHP file that has certain tags in its header comment area
98 characters long description:
Hides products that are out of stock for the size attribute when viewing that size's catalog page.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin192 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15560192

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.65
Average class complexity38.00
▷ Minimum class complexity38.00
▷ Maximum class complexity38.00
Average method complexity5.11
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected