94% hide-categories-products-woocommerce

Code Review | Hide Categories and Products for Woocommerce

WordPress plugin Hide Categories and Products for Woocommerce scored 94% from 54 tests.

About plugin

  • Plugin page: hide-categories-p...
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.8
  • WordPress version: 5.8.1
  • First release: Dec 14, 2020
  • Latest release: Jan 25, 2022
  • Number of updates: 23
  • Update frequency: every 17.8 days
  • Top authors: leroysabrina (91.3%)bastho (13.04%)

Code review

54 tests

User reviews

5 reviews

Install metrics

3,000+ active / 8,381 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼146.82ms] Passed 4 tests

An overview of server-side resources used by Hide Categories and Products for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0430.60 ▲3.18
Dashboard /wp-admin3.10 ▲0.0329.48 ▼7.04
Posts /wp-admin/edit.php3.15 ▲0.0437.46 ▲7.16
Add New Post /wp-admin/post-new.php5.46 ▲0.0268.76 ▼585.91
Media Library /wp-admin/upload.php3.04 ▲0.0423.95 ▲2.50

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hide Categories and Products for Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲6515.65 ▼0.404.92 ▼0.7274.52 ▼5.13
Dashboard /wp-admin2,933 ▲376.13 ▼0.04114.58 ▼17.18167.44 ▼2.93
Posts /wp-admin/edit.php2,737 ▼33.06 ▼0.1868.67 ▲6.15170.49 ▲34.09
Add New Post /wp-admin/post-new.php3,735 ▼1118.66 ▼0.06454.67 ▲28.79164.52 ▲0.74
Media Library /wp-admin/upload.php1,752 ▼05.55 ▲0.03143.97 ▼2.10186.41 ▲4.85

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hide-categories-products-woocommerce/hide-categories-products-wc.php:28

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: woocommerce, categories, storefront, hide, product

hide-categories-products-woocommerce/hide-categories-products-wc.php 85% from 13 tests

This is the main PHP file of "Hide Categories and Products for Woocommerce" version 1.2.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.9.7" instead of "3.0.0")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("hide-categories-products-woocommerce.php" instead of "hide-categories-products-wc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,299 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
SVG3111,060
PHP12771182
PO File14426
JavaScript15017
CSS10014

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.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 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.16MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png3.09KB1.99KB▼ 35.51%
assets/icon-256x256.png7.07KB4.00KB▼ 43.46%
assets/banner-1544x500.png21.71KB8.94KB▼ 58.83%
assets/screenshot-1.png126.25KB49.89KB▼ 60.49%
assets/banner-772x250.png9.11KB4.34KB▼ 52.36%