83% hide-category-by-user-role-for-woocommerce

Code Review | Hide Category by User Role for WooCommerce

WordPress plugin Hide Category by User Role for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: hide-category-by-...
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Jan 16, 2023
  • Latest release: Oct 12, 2023
  • Number of updates: 28
  • Update frequency: every 9.7 days
  • Top authors: themesupport (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /674 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.01MB] [CPU: ▼3.66ms] Passed 4 tests

A check of server-side resources used by Hide Category by User Role for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.10 ▼2.08
Dashboard /wp-admin3.31 ▼0.0443.21 ▼15.34
Posts /wp-admin/edit.php3.36 ▲0.0047.29 ▲5.35
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.78 ▲3.42
Media Library /wp-admin/upload.php3.23 ▲0.0033.51 ▼0.64

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Hide Category by User Role for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.37 ▲0.021.57 ▼0.2239.75 ▼3.90
Dashboard /wp-admin2,195 ▲175.60 ▼0.0983.53 ▼52.4237.47 ▼8.83
Posts /wp-admin/edit.php2,100 ▲31.97 ▲0.0233.26 ▼2.0134.29 ▲0.35
Add New Post /wp-admin/post-new.php1,538 ▲1223.19 ▼0.36620.57 ▼58.9256.43 ▼11.73
Media Library /wp-admin/upload.php1,400 ▼34.25 ▲0.0597.58 ▲3.3143.28 ▼3.03

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/hide-category-by-user-role-for-woocommerce/public/public-ui-setup.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Requires php: Version not formatted correctly
The official readme.txt might help

hide-category-by-user-role-for-woocommerce/themesupport-wchc.php 85% from 13 tests

"Hide Category by User Role for WooCommerce" version 2.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("hide-category-by-user-role-for-woocommerce.php" instead of "themesupport-wchc.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin11,281 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
CSS42,467710,183
PHP13402211811
JavaScript622223286
SVG1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions33
▷ Named functions33100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin