84% disable-gutenberg-blocks

Code Review | Disable Gutenberg Blocks - Block Manager

WordPress plugin Disable Gutenberg Blocks - Block Manager scored84%from 54 tests.

About plugin

  • Plugin page: disable-gutenberg...
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Dec 4, 2018
  • Latest release: Oct 26, 2021
  • Number of updates: 18
  • Update frequency: every 58.7 days
  • Top authors: editorblocks (55.56%)DannyCooper (50%)

Code review

54 tests

User reviews

7 reviews

Install metrics

4,000+ active /47,292 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.00MB] [CPU: ▼4.44ms] Passed 4 tests

Analyzing server-side resources used by Disable Gutenberg Blocks - Block Manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.72 ▼12.01
Dashboard /wp-admin3.32 ▲0.0248.64 ▲1.87
Posts /wp-admin/edit.php3.37 ▲0.0150.12 ▼0.12
Add New Post /wp-admin/post-new.php5.85 ▼0.0489.61 ▼7.50
Media Library /wp-admin/upload.php3.24 ▲0.0140.32 ▲3.27
Disable Blocks /wp-admin/options-general.php?page=disable-blocks3.6337.71

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Disable Gutenberg Blocks - Block Manager
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.48 ▼0.271.81 ▲0.0943.65 ▲0.61
Dashboard /wp-admin2,210 ▲225.88 ▲1.00106.73 ▼6.6335.80 ▼6.62
Posts /wp-admin/edit.php2,096 ▲72.01 ▼0.0139.43 ▼0.0533.28 ▼4.63
Add New Post /wp-admin/post-new.php1,683 ▲16421.83 ▼1.19661.51 ▲10.7359.87 ▼5.23
Media Library /wp-admin/upload.php1,386 ▼54.18 ▼0.0397.68 ▼7.0845.53 ▲0.21
Disable Blocks /wp-admin/options-general.php?page=disable-blocks2,3518.66269.6847.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

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
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant DGB_PLUGIN_DIR_PATH - assumed 'DGB_PLUGIN_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/disable-gutenberg-blocks/class-dgb-admin-page.php on line 11
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/disable-gutenberg-blocks/class-dgb-list-table.php on line 11
    • > PHP Warning
      require_once(DGB_PLUGIN_DIR_PATHclass-dgb-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/disable-gutenberg-blocks/class-dgb-admin-page.php on line 11
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/disable-gutenberg-blocks/class-dgb-list-table.php on line 11
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/disable-gutenberg-blocks/class-dgb-list-table.php on line 11
    • > PHP Fatal error
      require_once(): Failed opening required 'DGB_PLUGIN_DIR_PATHclass-dgb-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/disable-gutenberg-blocks/class-dgb-admin-page.php on line 11

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: manage blocks, disable blocks, disable gutenberg blocks, gutenberg, blocks

disable-gutenberg-blocks/class-disable-gutenberg-blocks.php 85% from 13 tests

Analyzing the main PHP file in "Disable Gutenberg Blocks - Block Manager" version 1.0.9
It is important to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("disable-gutenberg-blocks.php" instead of "class-disable-gutenberg-blocks.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin364 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP3118156277
JavaScript312072
CSS14015

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity13.67
▷ Minimum class complexity4.00
▷ Maximum class complexity30.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods23
▷ Static methods14.35%
▷ Public methods2295.65%
▷ Protected methods00.00%
▷ Private methods14.35%
Functions1
▷ Named functions1100.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 were not PNG files found in your plugin