90% product-visibility-by-user-role-for-woocommerce

Code Review | Product Visibility by User Role for WooCommerce

WordPress plugin Product Visibility by User Role for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: product-visibilit...
  • Plugin version: 1.8.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2
  • WordPress version: 6.3.1
  • First release: Aug 31, 2017
  • Latest release: Jul 14, 2023
  • Number of updates: 71
  • Update frequency: every 30.2 days
  • Top authors: wpwham (52.11%)algoritmika (49.3%)

Code review

54 tests

User reviews

18 reviews

Install metrics

8,000+ active /94,457 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Product Visibility by User Role for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.03 ▼5.00
Dashboard /wp-admin3.31 ▲0.0049.78 ▼6.09
Posts /wp-admin/edit.php3.36 ▲0.0048.31 ▼4.04
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.54 ▼26.34
Media Library /wp-admin/upload.php3.23 ▲0.0033.87 ▼5.24

Server storage [IO: ▲0.14MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Product Visibility by User Role for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.31 ▲0.161.63 ▼0.1240.92 ▼3.83
Dashboard /wp-admin2,189 ▲155.64 ▲0.1293.95 ▲2.4338.96 ▼6.86
Posts /wp-admin/edit.php2,103 ▲31.99 ▼0.0244.00 ▼0.7836.40 ▲1.09
Add New Post /wp-admin/post-new.php1,526 ▼023.24 ▲0.35640.35 ▼17.3844.64 ▼18.01
Media Library /wp-admin/upload.php1,397 ▼34.24 ▲0.07102.50 ▲5.1647.48 ▲3.80

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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 did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

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
5 plugin tags: woo commerce, woocommerce, user role, visibility, product

product-visibility-by-user-role-for-woocommerce/product-visibility-by-user-role-for-woocommerce.php Passed 13 tests

Analyzing the main PHP file in "Product Visibility by User Role for WooCommerce" version 1.8.1
53 characters long description:
Display WooCommerce products by customer's user role.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,823 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP101775731,456
PO File183112279
JavaScript113988

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity21.67
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity4.26
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods57
▷ Static methods47.02%
▷ Public methods5698.25%
▷ Protected methods00.00%
▷ Private methods11.75%
Functions9
▷ Named functions9100.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
There were not PNG files found in your plugin