72% block-patterns-ui

Code Review | Block Patterns UI

WordPress plugin Block Patterns UI scored 72% from 54 tests.

About plugin

  • Plugin page: block-patterns-ui
  • Plugin version: 0.4.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-5.8
  • WordPress version: 6.3.1
  • First release: Aug 27, 2021
  • Latest release: Aug 28, 2021
  • Number of updates: 10
  • Update frequency: every 0.1 days
  • Top authors: chrismademe (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 463 total downloads

Benchmarks

Plugin footprint 83% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.11ms] Passed 4 tests

Server-side resources used by Block Patterns UI
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1242.79 ▲0.27
Dashboard /wp-admin3.40 ▲0.1053.23 ▲0.11
Posts /wp-admin/edit.php3.45 ▲0.0948.90 ▲0.68
Add New Post /wp-admin/post-new.php6.06 ▲0.1787.63 ▼17.48
Media Library /wp-admin/upload.php3.32 ▲0.0937.99 ▲2.74
All Patterns /wp-admin/edit.php?post_type=bpui_block_pattern3.3639.29
Add New /wp-admin/post-new.php?post_type=bpui_block_pattern3.2436.30
Settings /wp-admin/edit.php?post_type=bpui_block_pattern&page=block_patterns_ui3.3233.37

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Block Patterns UI
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲11614.48 ▲0.121.52 ▼0.5637.98 ▼4.63
Dashboard /wp-admin2,251 ▲635.88 ▼0.01102.62 ▼10.2540.18 ▼8.22
Posts /wp-admin/edit.php2,137 ▲511.98 ▼0.0336.61 ▲1.8533.52 ▼1.83
Add New Post /wp-admin/post-new.php1,564 ▲3623.25 ▲5.01657.88 ▲38.2851.78 ▼5.77
Media Library /wp-admin/upload.php1,434 ▲434.20 ▲0.0696.70 ▼3.5043.48 ▼0.90
All Patterns /wp-admin/edit.php?post_type=bpui_block_pattern1,1041.9833.9426.86
Add New /wp-admin/post-new.php?post_type=bpui_block_pattern6,53419.88955.6035.27
Settings /wp-admin/edit.php?post_type=bpui_block_pattern&page=block_patterns_ui1,0342.1436.2030.95

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=bpui_block_pattern
    • > Notice in wp-content/plugins/block-patterns-ui/lib/add-meta-boxes.php+101
    Undefined index: bpui_pattern_settings_fields
  • 20 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=bpui_block_pattern&page=block_patterns_ui
    • > Notice in wp-content/plugins/block-patterns-ui/templates/settings.php+34
    Trying to access array offset on value of type bool

SRP 0% 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
Please take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/block-patterns-ui/templates/partials/header.php
    • > /wp-content/plugins/block-patterns-ui/templates/partials/footer.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-patterns-ui/lib/admin-assets.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-patterns-ui/lib/register-block-patterns.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/block-patterns-ui/lib/admin-columns.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-patterns-ui/lib/init.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-patterns-ui/lib/admin-settings-page.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/block-patterns-ui/lib/admin-plugin-list.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/block-patterns-ui/templates/partials/page-header.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-patterns-ui/lib/add-meta-boxes.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-patterns-ui/lib/register-custom-post-type.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bpui_get_pattern_categories() in wp-content/plugins/block-patterns-ui/templates/settings.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: block patterns, block editor, gutenberg

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

The main PHP file in "Block Patterns UI" ver. 0.4.2 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected579 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP159358351
CSS440111
Sass560111
JavaScript2006

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity2.50
▷ Minimum class complexity2.00
▷ Maximum class complexity3.00
Average method complexity1.43
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods228.57%
▷ Public methods685.71%
▷ Protected methods00.00%
▷ Private methods114.29%
Functions18
▷ Named functions527.78%
▷ Anonymous functions1372.22%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
frontend/logo-h.png7.81KB4.30KB▼ 44.99%