84% block-conditions

Code Review | Block Conditions - Hide WordPress block for various conditions

WordPress plugin Block Conditions - Hide WordPress block for various conditions scored84%from 54 tests.

About plugin

  • Plugin page: block-conditions
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7.1
  • WordPress version: 6.3.1
  • First release: Jan 19, 2021
  • Latest release: May 7, 2021
  • Number of updates: 5
  • Update frequency: every 21.8 days
  • Top authors: chinteshprajapati (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /420 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼5.09ms] Passed 4 tests

A check of server-side resources used by Block Conditions - Hide WordPress block for various conditions
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0633.87 ▼6.37
Dashboard /wp-admin3.39 ▲0.0945.36 ▼2.82
Posts /wp-admin/edit.php3.52 ▲0.1648.65 ▼4.15
Add New Post /wp-admin/post-new.php5.98 ▲0.0985.08 ▼7.03
Media Library /wp-admin/upload.php3.32 ▲0.0937.40 ▲6.25
Block Conditions /wp-admin/options-general.php?page=block-conditions3.2834.41

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

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

Browser metrics Passed 4 tests

Block Conditions - Hide WordPress block for various conditions: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,015 ▲28023.12 ▲8.455.04 ▲3.2640.62 ▼8.82
Dashboard /wp-admin2,307 ▲12212.35 ▲6.49292.36 ▲190.3841.85 ▼1.03
Posts /wp-admin/edit.php2,186 ▲9711.93 ▲9.8786.72 ▲47.5330.45 ▼7.33
Add New Post /wp-admin/post-new.php1,685 ▲14824.43 ▲6.18512.82 ▼95.0536.28 ▼12.80
Media Library /wp-admin/upload.php1,510 ▲12212.54 ▲8.33143.77 ▲33.6640.67 ▼2.59
Block Conditions /wp-admin/options-general.php?page=block-conditions95111.5483.6725.89

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/block-conditions/admin/partials/block-conditions-admin-display.php
    • > /wp-content/plugins/block-conditions/public/partials/block-conditions-public-display.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 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
8 plugin tags: visibility, restrict blocks, responsive, conditional blocks, conditional content...

block-conditions/block-conditions.php 92% from 13 tests

The primary PHP file in "Block Conditions - Hide WordPress block for various conditions" version 1.0.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 177 characters long)

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
Everything looks great! No dangerous files found in this plugin22,217 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript32,7952,48721,859
PHP12150558332
CSS23826

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.43
▷ Minimum class complexity1.00
▷ Maximum class complexity32.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2482.76%
▷ Protected methods00.00%
▷ Private methods517.24%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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 are no PNG files in this plugin