77% control-block-patterns

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

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

About plugin

  • Plugin page: control-block-pat...
  • Plugin version: 1.3.5.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 12, 2021
  • Latest release: Aug 24, 2023
  • Number of updates: 97
  • Update frequency: every 7.7 days
  • Top authors: razib_ (87.63%)senseflame (13.4%)

Code review

54 tests

User reviews

2 reviews

Install metrics

3,000+ active /19,554 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: ▲1.67MB] [CPU: ▲3.42ms] 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,549.18ms on /wp-admin/edit.php?post_type=ctrl_block_patterns&page=directory)
PageMemory (MB)CPU Time (ms)
Home /5.09 ▲1.6349.11 ▲10.78
Dashboard /wp-admin4.98 ▲1.6359.86 ▼3.19
Posts /wp-admin/edit.php5.09 ▲1.7463.13 ▲15.06
Add New Post /wp-admin/post-new.php7.70 ▲1.8193.32 ▼7.97
Media Library /wp-admin/upload.php4.90 ▲1.6852.77 ▲14.04
Category /wp-admin/edit-tags.php?taxonomy=block_pattern_category&post_type=ctrl_block_patterns5.0248.81
Directory /wp-admin/edit.php?post_type=ctrl_block_patterns&page=directory5.541,549.18
Add New /wp-admin/post-new.php?post_type=ctrl_block_patterns7.7598.93
Block Patterns /wp-admin/edit.php?post_type=ctrl_block_patterns4.9951.89
Settings /wp-admin/edit.php?post_type=ctrl_block_patterns&page=block-patterns-options5.0251.60
Keywords /wp-admin/edit-tags.php?taxonomy=block_pattern_tag&post_type=ctrl_block_patterns5.0347.08
Dashboard /wp-admin/plugins.php?page=control-block-patterns4.9942.90

Server storage [IO: ▲6.74MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 493 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
cbp_remote_categories
db_upgraded
widget_theysaidso_widget
widget_control-block-patterns-widget

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 /2,837 ▲9114.31 ▼0.041.56 ▲0.0040.00 ▲1.62
Dashboard /wp-admin2,241 ▲675.60 ▼0.0285.50 ▲1.9936.16 ▼5.87
Posts /wp-admin/edit.php2,140 ▲401.99 ▼0.0135.86 ▼2.7732.12 ▼2.09
Add New Post /wp-admin/post-new.php1,572 ▲4618.17 ▼5.20603.66 ▼85.3868.81 ▲17.20
Media Library /wp-admin/upload.php1,440 ▲404.19 ▲0.0597.79 ▼18.8542.99 ▼5.98
Category /wp-admin/edit-tags.php?taxonomy=block_pattern_category&post_type=ctrl_block_patterns1,3142.1228.1129.13
Directory /wp-admin/edit.php?post_type=ctrl_block_patterns&page=directory1,0194.0374.9424.63
Add New /wp-admin/post-new.php?post_type=ctrl_block_patterns6,26620.21894.7138.50
Block Patterns /wp-admin/edit.php?post_type=ctrl_block_patterns1,1922.3545.3332.83
Settings /wp-admin/edit.php?post_type=ctrl_block_patterns&page=block-patterns-options2,5955.21139.6496.78
Keywords /wp-admin/edit-tags.php?taxonomy=block_pattern_tag&post_type=ctrl_block_patterns1,2892.1225.6828.88
Dashboard /wp-admin/plugins.php?page=control-block-patterns1,1162.0123.4666.31

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 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 8 options in the database
    • widget_recent-comments
    • widget_control-block-patterns-widget
    • cbp_remote_categories
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% 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
  • 8× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/control-block-patterns/includes/templates/audio.php
    • > /wp-content/plugins/control-block-patterns/includes/templates/image-input.php
    • > /wp-content/plugins/control-block-patterns/includes/templates/video.php
    • > /wp-content/plugins/control-block-patterns/includes/templates/upload.php
    • > /wp-content/plugins/control-block-patterns/classes/sections/products.php
    • > /wp-content/plugins/control-block-patterns/includes/templates/media.php
    • > /wp-content/plugins/control-block-patterns/includes/template-canvas.php
    • > /wp-content/plugins/control-block-patterns/includes/templates/image-advanced.php
  • 110× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ControlPatterns\\Fields\\Object_Choice' not found in wp-content/plugins/control-block-patterns/classes/Fields/User.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'ControlPatterns\\Field' not found in wp-content/plugins/control-block-patterns/classes/Fields/Typography.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'ControlPatterns\\Fields\\Taxonomy' not found in wp-content/plugins/control-block-patterns/classes/Fields/Taxonomy_Advanced.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'ControlPatterns\\Field' not found in wp-content/plugins/control-block-patterns/classes/Fields/Group.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'ControlPatterns\\Fields\\Media' not found in wp-content/plugins/control-block-patterns/classes/Fields/File_Upload.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'ControlPatterns\\Field' not found in wp-content/plugins/control-block-patterns/classes/Fields/Textarea.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/control-block-patterns/includes/settings/03-control-css.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'ControlPatterns\\Field' not found in wp-content/plugins/control-block-patterns/classes/Fields/Custom_Html.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/control-block-patterns/classes/sections/welcome.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ControlPatterns\\Fields\\Object_Choice' not found in wp-content/plugins/control-block-patterns/classes/Fields/Sidebar.php:12

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 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:
  • Screenshots: Please describe screenshot #9 in control-block-patterns/assets to your readme.txt
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
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.5.4 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 226 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 plugin47,849 lines of code in 445 files:
LanguageFilesBlank linesComment linesLines of code
PHP1892,7396,03212,606
CSS221,9241829,689
SVG6039,684
JavaScript1291,8921,9319,338
Sass981,1287636,527
JSON1005

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.34
Average class complexity9.28
▷ Minimum class complexity1.00
▷ Maximum class complexity62.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces18
Interfaces1
Traits0
Classes150
▷ Abstract classes74.67%
▷ Concrete classes14395.33%
▷ Final classes00.00%
Methods835
▷ Static methods37244.55%
▷ Public methods69382.99%
▷ Protected methods708.38%
▷ Private methods728.62%
Functions56
▷ Named functions4376.79%
▷ Anonymous functions1323.21%
Constants12
▷ Global constants12100.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
20 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/jqueryui/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
assets/img/jqueryui/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
assets/img/layout/left-dual-sidebar.png3.83KB2.06KB▼ 46.34%
assets/img/jqueryui/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
assets/img/jqueryui/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%