90% block-visibility

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

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

About plugin

  • Plugin page: block-visibility
  • Plugin version: 3.1.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.3
  • WordPress version: 6.3.1
  • First release: Aug 11, 2020
  • Latest release: Oct 14, 2023
  • Number of updates: 59
  • Update frequency: every 19.8 days
  • Top authors: ndiego (100%)

Code review

54 tests

User reviews

56 reviews

Install metrics

10,000+ active /160,181 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▲0.00ms] 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 /4.85 ▲1.3951.05 ▲14.52
Dashboard /wp-admin3.56 ▲0.2546.95 ▲1.50
Posts /wp-admin/edit.php3.67 ▲0.3146.20 ▲0.86
Add New Post /wp-admin/post-new.php6.24 ▲0.3581.44 ▼4.84
Media Library /wp-admin/upload.php3.48 ▲0.2534.77 ▲2.48
Block Visibility /wp-admin/options-general.php?page=block-visibility-settings3.4834.86

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

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

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 /2,796 ▲3514.08 ▼0.192.34 ▲0.5744.08 ▲3.15
Dashboard /wp-admin2,193 ▲165.53 ▼0.1783.25 ▼3.5240.26 ▼1.09
Posts /wp-admin/edit.php2,104 ▲71.99 ▲0.0134.03 ▲0.0835.48 ▼1.53
Add New Post /wp-admin/post-new.php1,703 ▲17525.88 ▲2.79692.91 ▲21.8037.04 ▼19.31
Media Library /wp-admin/upload.php1,404 ▲44.19 ▲0.0298.05 ▲0.5743.74 ▼1.57
Block Visibility /wp-admin/options-general.php?page=block-visibility-settings1,12410.40256.3655.48

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

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

Optimizations

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: visibility, conditional blocks, restrict blocks, dynamic content, conditional 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 3.1.2
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 plugin7,047 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
PHP422,0153,2707,009
JavaScript203235
CSS3003

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.75
Average class complexity109.75
▷ Minimum class complexity6.00
▷ Maximum class complexity358.00
Average method complexity4.92
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces10
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods111
▷ Static methods76.31%
▷ Public methods4843.24%
▷ Protected methods6054.05%
▷ Private methods32.70%
Functions146
▷ Named functions14397.95%
▷ Anonymous functions32.05%
Constants60
▷ Global constants813.33%
▷ Class constants5286.67%
▷ Public constants52100.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