72% control-block-patterns

Code Review | Build & Control Block Patterns - Boost up Gutenberg Editor

WordPress plugin Build & Control Block Patterns - Boost up Gutenberg Editor scored 72% from 54 tests.

About plugin

  • Plugin page: control-block-pat...
  • Plugin version: 1.3.4.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.0-5.8.1
  • WordPress version: 5.8.1
  • First release: Aug 12, 2021
  • Latest release: Oct 11, 2021
  • Number of updates: 72
  • Update frequency: every 0.9 days
  • Top authors: razib_ (83.33%)senseflame (18.06%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active / 1,126 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Build & Control Block Patterns - Boost up Gutenberg Editor
It is recommended to improve the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,837.92ms on /wp-admin/edit.php?post_type=ctrl_block_patterns&page=directory)
PageMemory (MB)CPU Time (ms)
Home /2.98 ▲0.2645.96 ▲16.55
Dashboard /wp-admin3.38 ▲0.3356.12 ▲10.72
Posts /wp-admin/edit.php3.44 ▲0.3353.77 ▲2.99
Add New Post /wp-admin/post-new.php5.88 ▲0.45111.37 ▼621.19
Media Library /wp-admin/upload.php3.33 ▲0.3342.93 ▲6.33
Keywords /wp-admin/edit-tags.php?taxonomy=block_pattern_tag&post_type=ctrl_block_patterns3.2639.38
Directory /wp-admin/edit.php?post_type=ctrl_block_patterns&page=directory3.641,837.92
Block Patterns /wp-admin/edit.php?post_type=ctrl_block_patterns3.3841.03
Settings /wp-admin/edit.php?post_type=ctrl_block_patterns&page=block-patterns-options3.3984.56
Category /wp-admin/edit-tags.php?taxonomy=block_pattern_category&post_type=ctrl_block_patterns3.2740.33
Add New /wp-admin/post-new.php?post_type=ctrl_block_patterns5.88102.45

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 140 new files
Database: no new tables, 5 new options
New WordPress options
ctrl_block_patterns_settings
cbp_remote_categories
widget_control-block-patterns-widget
block_patterns_media_post_ID
control_block_patterns

Browser metrics Passed 4 tests

Checking browser requirements for Build & Control Block Patterns - Boost up Gutenberg Editor
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲16215.76 ▲0.1910.99 ▲0.8848.46 ▼5.62
Dashboard /wp-admin3,022 ▲915.87 ▼0.13145.03 ▼9.02120.78 ▼1.58
Posts /wp-admin/edit.php2,794 ▲552.86 ▲0.1472.29 ▼6.7596.14 ▼4.19
Add New Post /wp-admin/post-new.php1,941 ▲25819.98 ▲1.24404.39 ▲6.28145.80 ▲31.20
Media Library /wp-admin/upload.php1,862 ▲1115.03 ▲0.04156.56 ▼4.86129.57 ▲5.74
Keywords /wp-admin/edit-tags.php?taxonomy=block_pattern_tag&post_type=ctrl_block_patterns1,7662.5365.2091.23
Directory /wp-admin/edit.php?post_type=ctrl_block_patterns&page=directory2,2856.49196.48121.49
Block Patterns /wp-admin/edit.php?post_type=ctrl_block_patterns1,5553.0875.4672.77
Settings /wp-admin/edit.php?post_type=ctrl_block_patterns&page=block-patterns-options2,5686.23201.06117.21
Category /wp-admin/edit-tags.php?taxonomy=block_pattern_category&post_type=ctrl_block_patterns1,7942.5070.7379.02
Add New /wp-admin/post-new.php?post_type=ctrl_block_patterns5,84919.10480.90134.68

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 5 options in the database
    • control_block_patterns
    • ctrl_block_patterns_settings
    • widget_control-block-patterns-widget
    • cbp_remote_categories
    • block_patterns_media_post_ID

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 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
Please take a closer look at the following
  • 11× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/control-block-patterns/includes/functions.php
    • > /wp-content/plugins/control-block-patterns/includes/functions-docs-page.php
    • > /wp-content/plugins/control-block-patterns/includes/functions-admin.php
    • > /wp-content/plugins/control-block-patterns/classes/fields/checkbox.php
    • > /wp-content/plugins/control-block-patterns/classes/fields/tab.php
    • > /wp-content/plugins/control-block-patterns/classes/fields/textblock.php
    • > /wp-content/plugins/control-block-patterns/includes/functions-settings-page.php
    • > /wp-content/plugins/control-block-patterns/vendor/autoload.php
    • > /wp-content/plugins/control-block-patterns/classes/directory/iframe.php
    • > /wp-content/plugins/control-block-patterns/classes/fields/radio.php
  • 116× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/control-block-patterns/classes/fields/textarea-simple.php on line 13
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/control-block-patterns/classes/fields/page-select.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/control-block-patterns/classes/fields/spacing.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/control-block-patterns/classes/fields/html.php:29
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/admin.php' (include_path='.:/usr/share/php') in wp-content/plugins/control-block-patterns/classes/directory/pattern-install.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_editor() in wp-content/plugins/control-block-patterns/classes/fields/textarea.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/control-block-patterns/includes/meta-boxes.php:5
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/control-block-patterns/classes/fields/taxonomy-checkbox.php on line 13
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/control-block-patterns/classes/fields/post-select.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/control-block-patterns/classes/fields/custom-post-type-select.php:29

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit.php?post_type=ctrl_block_patterns&page=directory
    • > Javascript (severe) in unknown
    /wp-content/plugins/control-block-patterns/assets/js/directory.js?ver=1.3.4.3 2159:43 Uncaught TypeError: Cannot read properties of null (reading 'style')

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
  • Screenshots: Please describe screenshot #9 in control-block-patterns/assets to your readme.txt
The official readme.txt is a good inspiration

control-block-patterns/control-block-patterns.php 92% from 13 tests

The principal PHP file in "Build & Control Block Patterns - Boost up Gutenberg Editor" v. 1.3.4.3 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 224 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin20,183 lines of code in 130 files:
LanguageFilesBlank linesComment linesLines of code
PHP1043,6474,56212,010
JavaScript181,1161,2724,853
CSS58382453,188
SVG303132

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity41.82
▷ Minimum class complexity1.00
▷ Maximum class complexity249.00
Average method complexity4.46
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods262
▷ Static methods114.20%
▷ Public methods21080.15%
▷ Protected methods176.49%
▷ Private methods3513.36%
Functions152
▷ Named functions14595.39%
▷ Anonymous functions74.61%
Constants38
▷ Global constants38100.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
7 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/layout/right-sidebar.png3.90KB2.09KB▼ 46.42%
assets/images/cbp-logo-white.png1.31KB1.17KB▼ 11.37%
assets/images/layout/dual-sidebar.png3.88KB2.09KB▼ 46.20%
assets/images/layout/left-dual-sidebar.png3.83KB2.06KB▼ 46.34%
assets/images/layout/full-width.png3.89KB2.07KB▼ 46.79%