100% block-visibility

Code Review | Block Visibility — Conditional Visibility Control for the Block Editor

WordPress plugin Block Visibility — Conditional Visibility Control for the Block Editor scored 100% from 54 tests.

About plugin

  • Plugin page: block-visibility
  • Plugin version: 2.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.8
  • WordPress version: 5.8.1
  • First release: Aug 11, 2020
  • Latest release: Oct 29, 2021
  • Number of updates: 30
  • Update frequency: every 15.0 days
  • Top authors: ndiego (100%)

Code review

54 tests

User reviews

24 reviews

Install metrics

2,000+ active / 17,685 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼142.68ms] Passed 4 tests

Analyzing server-side resources used by Block Visibility — Conditional Visibility Control for the Block Editor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.12 ▲0.2829.29 ▼4.54
Dashboard /wp-admin3.25 ▲0.2044.01 ▲1.20
Posts /wp-admin/edit.php3.36 ▲0.2643.64 ▲1.90
Add New Post /wp-admin/post-new.php5.64 ▲0.2087.06 ▼569.29
Media Library /wp-admin/upload.php3.20 ▲0.1934.37 ▲2.80
Block Visibility /wp-admin/options-general.php?page=block-visibility-settings3.2232.21

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Block Visibility — Conditional Visibility Control for the Block Editor
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,718 ▲12215.83 ▲0.379.88 ▼0.1646.95 ▼1.01
Dashboard /wp-admin2,975 ▲415.97 ▼0.08132.42 ▼18.29110.15 ▼18.49
Posts /wp-admin/edit.php2,744 ▲52.69 ▼0.0065.21 ▼3.4295.36 ▲9.35
Add New Post /wp-admin/post-new.php1,705 ▲2220.76 ▲1.93425.10 ▲57.71124.31 ▲12.92
Media Library /wp-admin/upload.php1,815 ▲55.02 ▲0.03158.48 ▲0.81121.79 ▲9.93
Block Visibility /wp-admin/options-general.php?page=block-visibility-settings1,81514.26267.43161.54

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
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
The SRP test was a success

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)
No browser errors were detected


Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: restrict blocks, visibility, conditional content, conditional blocks, dynamic content

block-visibility/block-visibility.php Passed 13 tests

Analyzing the main PHP file in "Block Visibility — Conditional Visibility Control for the Block Editor" version 2.2.0
82 characters long description:
Provides visibility controls and scheduling functionality to all WordPress blocks.

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
Everything looks great! No dangerous files found in this plugin1,982 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.68
Average class complexity12.00
▷ Minimum class complexity7.00
▷ Maximum class complexity17.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
▷ Static methods417.39%
▷ Public methods2086.96%
▷ Protected methods00.00%
▷ Private methods313.04%
▷ Named functions41100.00%
▷ Anonymous functions00.00%
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin