84% hide-out-of-stock-by-category

Code Review | Hide Out Of Stock By Category

WordPress plugin Hide Out Of Stock By Category scored 84% from 54 tests.

About plugin

  • Plugin page: hide-out-of-stock...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.4
  • WordPress version: 6.3.1
  • First release: Apr 15, 2020
  • Latest release: Apr 15, 2020
  • Number of updates: 13
  • Update frequency: N/A
  • Top authors: nerdywp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 817 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 gracefully, with no errors

Server metrics [RAM: ▼0.14MB] [CPU: ▼11.75ms] Passed 4 tests

This is a short check of server-side resources used by Hide Out Of Stock By Category
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.82 ▼0.6416.42 ▼21.72
Dashboard /wp-admin3.33 ▲0.0249.20 ▲0.45
Posts /wp-admin/edit.php3.38 ▲0.0245.96 ▼3.94
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.52 ▼19.46
Media Library /wp-admin/upload.php3.25 ▲0.0233.24 ▼1.86

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Hide Out Of Stock By Category
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲8613.71 ▼0.661.84 ▼0.5645.70 ▲5.03
Dashboard /wp-admin2,213 ▲255.85 ▼0.0599.60 ▼10.2038.25 ▼1.14
Posts /wp-admin/edit.php2,099 ▲72.04 ▲0.0037.66 ▼1.6839.06 ▲4.80
Add New Post /wp-admin/post-new.php1,424 ▼10922.58 ▼0.69554.33 ▼27.2641.10 ▼6.13
Media Library /wp-admin/upload.php1,392 ▲14.20 ▲0.0496.73 ▲0.5238.68 ▼2.13

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hide-out-of-stock-by-category/whc.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: ecommerce, category, hide, out of stock, woocommerce

hide-out-of-stock-by-category/whc.php 92% from 13 tests

The entry point to "Hide Out Of Stock By Category" version 1.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("hide-out-of-stock-by-category.php" instead of "whc.php")

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
No dangerous file extensions were detected123 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12118123

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.28
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 functions5100.00%
▷ Anonymous functions00.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
PNG images were not found in this plugin