94% block-manager

Code Review | Gutenberg Block Manager

WordPress plugin Gutenberg Block Manager scored 94% from 53 tests.

About plugin

  • Plugin page: block-manager
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 5.8.1
  • First release: Jan 7, 2020
  • Latest release: Aug 18, 2021
  • Number of updates: 42
  • Update frequency: every 14.1 days
  • Top authors: dcooney (100%)

Code review

53 tests

User reviews

6 reviews

Install metrics

1,000+ active / 8,381 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼290.44ms] 75% from 4 tests

Analyzing server-side resources used by Gutenberg Block Manager
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 3,491.96ms on /wp-admin/options-general.php?page=gutenberg-block-manager)
PageMemory (MB)CPU Time (ms)
Home /2.96 ▲0.2430.96 ▲10.55
Dashboard /wp-admin3.19 ▲0.1441.06 ▼3.76
Posts /wp-admin/edit.php3.30 ▲0.2048.75 ▲7.85
Add New Post /wp-admin/post-new.php5.52 ▲0.0997.30 ▼1,165.45
Media Library /wp-admin/upload.php3.13 ▲0.1337.24 ▼0.38
Block Manager /wp-admin/options-general.php?page=gutenberg-block-manager3.363,491.96

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 21 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Gutenberg Block Manager: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,685 ▲7916.21 ▲0.688.98 ▲0.3150.30 ▼0.39
Dashboard /wp-admin2,945 ▲956.23 ▲0.37142.39 ▲12.98101.73 ▼2.62
Posts /wp-admin/edit.php2,715 ▲92.70 ▲0.0263.30 ▼1.6993.87 ▲10.38
Add New Post /wp-admin/post-new.php1,610 ▼42821.68 ▲2.17282.01 ▼99.84138.41 ▲32.72
Media Library /wp-admin/upload.php1,781 ▲95.05 ▲0.05143.83 ▼10.52113.00 ▼4.49
Block Manager /wp-admin/options-general.php?page=gutenberg-block-manager3,26013.36271.59143.97

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-manager/api/blocks_reset.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-manager/api/toggle.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-manager/api/export.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-manager/class-admin.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-manager/api/category_switch.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-manager/api/bulk_process.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-manager/api/category_reset.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed: You can take inspiration from this readme.txt

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

The primary PHP file in "Gutenberg Block Manager" version 1.2.2 is used by WordPress to initiate all plugin functionality
57 characters long description:
Globally manage the active state of each Gutenberg block.

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
No dangerous file extensions were detected28,993 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript46,9696,04227,201
CSS214711,085
PHP9174305707

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity13.00
▷ Minimum class complexity7.00
▷ Maximum class complexity17.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods1050.00%
▷ Public methods1995.00%
▷ Protected methods00.00%
▷ Private methods15.00%
Functions19
▷ Named functions736.84%
▷ Anonymous functions1263.16%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
dist/img/icon.png3.96KB1.71KB▼ 56.98%