90% disable-block

Code Review | Disable Block - Hide blocks in the frontend

WordPress plugin Disable Block - Hide blocks in the frontend scored90%from 54 tests.

About plugin

  • Plugin page: disable-block
  • Plugin version: 1.2.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Sep 29, 2022
  • Latest release: Sep 24, 2023
  • Number of updates: 12
  • Update frequency: every 30.0 days
  • Top authors: landwire (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /366 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.99ms] Passed 4 tests

Analyzing server-side resources used by Disable Block - Hide blocks in the frontend
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0245.52 ▲1.48
Dashboard /wp-admin3.33 ▼0.0252.92 ▼20.52
Posts /wp-admin/edit.php3.38 ▲0.0250.92 ▲1.65
Add New Post /wp-admin/post-new.php7.19 ▲1.30101.41 ▼3.66
Media Library /wp-admin/upload.php3.25 ▲0.0237.01 ▼1.27

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Disable Block - Hide blocks in the frontend
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.17 ▼0.391.96 ▲0.4147.25 ▲6.62
Dashboard /wp-admin2,195 ▲185.61 ▼0.1495.36 ▼1.3842.60 ▲1.13
Posts /wp-admin/edit.php2,097 ▼61.98 ▼0.0134.35 ▼7.6835.61 ▲0.72
Add New Post /wp-admin/post-new.php1,691 ▲16222.85 ▲0.06667.61 ▲26.0652.61 ▼5.11
Media Library /wp-admin/upload.php1,400 ▼04.22 ▲0.0199.00 ▼0.1442.90 ▼3.46

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: gutenberg, hide block, disable, disable block, block...

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

The entry point to "Disable Block - Hide blocks in the frontend" version 1.2.1 is a PHP file that has certain tags in its header comment area
102 characters long description:
Adds a button in the toolbar to disable that block, preventing rendering of the block in the frontend.

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
There were no executable files found in this plugin116 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP1184171
Markdown112023
SVG10117
JavaScript111764
CSS1011

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.52MB with 0.31MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png15.34KB6.21KB▼ 59.50%
assets/icon-256x256.png6.49KB2.64KB▼ 59.39%
assets/screenshot-1.png480.28KB185.62KB▼ 61.35%
assets/banner-1544x500.png32.56KB13.20KB▼ 59.45%