83% visibility-control-for-woocommerce

Code Review | Visibility Control for WooCommerce

WordPress plugin Visibility Control for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: visibility-contro...
  • Plugin version: 1.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 15, 2020
  • Latest release: Jun 5, 2023
  • Number of updates: 22
  • Update frequency: every 54.9 days
  • Top authors: liveaspankaj (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,698 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.63ms] 75% from 4 tests

Server-side resources used by Visibility Control for WooCommerce
The following require your attention
  • CPU: You should keep total CPU usage under 500.00ms (currently 5,436.33ms on /wp-admin/admin.php?page=grassblade-addons)
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.78 ▼2.51
Dashboard /wp-admin3.33 ▲0.0349.25 ▲0.93
Posts /wp-admin/edit.php3.44 ▲0.0952.23 ▼2.22
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.43 ▼18.27
Media Library /wp-admin/upload.php3.25 ▲0.0237.47 ▲0.49
Add-ons /wp-admin/admin.php?page=grassblade-addons3.445,436.33
Visibility Control for WooCommerce /wp-admin/admin.php?page=grassblade-visibility-control-woocommerce3.2434.38
GrassBlade /wp-admin/admin.php?page=grassblade-lrs-settings3.2533.23

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Visibility Control for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲8414.80 ▲0.501.79 ▲0.0851.49 ▲9.47
Dashboard /wp-admin2,221 ▲305.86 ▲0.9899.25 ▼8.3585.64 ▲39.76
Posts /wp-admin/edit.php2,122 ▲301.99 ▼0.0234.24 ▼7.6133.00 ▼2.55
Add New Post /wp-admin/post-new.php1,539 ▼317.58 ▼0.76743.46 ▲93.8052.84 ▼1.04
Media Library /wp-admin/upload.php1,412 ▲274.20 ▲0.0198.73 ▼1.2361.63 ▲16.99
Add-ons /wp-admin/admin.php?page=grassblade-addons2,8132.1630.3468.52
Visibility Control for WooCommerce /wp-admin/admin.php?page=grassblade-visibility-control-woocommerce8332.0125.6725.11
GrassBlade /wp-admin/admin.php?page=grassblade-lrs-settings8272.0225.4324.29

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • visibility_control_for_woocommerce
    • grassblade_free_addons
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • grassblade_addons
    • can_compress_scripts

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/visibility-control-for-woocommerce/visibility-control-for-woocommerce.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Donate link: Please fix this invalid URI: ""
The official readme.txt might help

visibility-control-for-woocommerce/visibility-control-for-woocommerce.php 92% from 13 tests

This is the main PHP file of "Visibility Control for WooCommerce" version 1.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 703 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin604 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP212220604

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.76
Average class complexity75.50
▷ Minimum class complexity35.00
▷ Maximum class complexity116.00
Average method complexity7.42
▷ Minimum method complexity2.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon_30x30.png4.58KB1.60KB▼ 65.15%
img/check.png0.98KB0.47KB▼ 52.44%
img/icon_128x128.png22.67KB6.87KB▼ 69.71%
img/no.png1.01KB0.62KB▼ 39.05%
img/icon-gb.png3.43KB0.84KB▼ 75.48%