83% better-block-patterns

Code Review | Better Block Patterns

WordPress plugin Better Block Patterns scored83%from 54 tests.

About plugin

  • Plugin page: better-block-patt...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-5.9.0
  • WordPress version: 6.3.1
  • First release: Nov 2, 2021
  • Latest release: Jan 24, 2022
  • Number of updates: 6
  • Update frequency: every 19.2 days
  • Top authors: ilovewpcom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

2,000+ active /8,727 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
Installer ran successfully

Server metrics [RAM: ▲0.47MB] [CPU: ▼10.46ms] Passed 4 tests

This is a short check of server-side resources used by Better Block Patterns
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.03 ▲0.5242.34 ▼1.44
Dashboard /wp-admin3.86 ▲0.4751.87 ▼18.02
Posts /wp-admin/edit.php3.91 ▲0.5182.01 ▲25.85
Add New Post /wp-admin/post-new.php6.38 ▲0.4588.97 ▼24.90
Media Library /wp-admin/upload.php3.72 ▲0.4539.54 ▲2.51
Getting Started /wp-admin/admin.php?page=better-block-patterns3.6839.10
Settings /wp-admin/admin.php?page=better-block-patterns-settings3.6835.51

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 174 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
better_block_patterns
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Better Block Patterns
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5114.22 ▼0.142.12 ▲0.3844.22 ▲4.62
Dashboard /wp-admin2,221 ▲415.62 ▲0.0284.76 ▼7.4939.93 ▼6.92
Posts /wp-admin/edit.php2,126 ▲262.02 ▲0.0447.49 ▲7.2143.30 ▲6.52
Add New Post /wp-admin/post-new.php1,548 ▲1323.64 ▲0.32642.03 ▲5.0755.29 ▲3.12
Media Library /wp-admin/upload.php1,417 ▲144.22 ▲0.0898.99 ▼1.6245.55 ▲2.99
Getting Started /wp-admin/admin.php?page=better-block-patterns9511.8735.1455.74
Settings /wp-admin/admin.php?page=better-block-patterns-settings1,4402.0147.8574.94

Uninstaller [IO: ▲0.02MB] [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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • better_block_patterns
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following items
  • 35× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/better-block-patterns/patterns/general-features/portfolio-2/block-data.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/better-block-patterns/patterns/general-features/contact-1/block-data.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/better-block-patterns/includes/class-customizer.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/better-block-patterns/patterns/general-features/testimonials-2/block-data.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-block-patterns/includes/customizer/helpers-css.php:269
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/better-block-patterns/patterns/general-features/feature-simple-1/block-data.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-block-patterns/includes/class-blocks-manager.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/better-block-patterns/patterns/general-features/featured-pages-2/block-data.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/better-block-patterns/patterns/general-features/portfolio-1/block-data.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/better-block-patterns/patterns/general-features/contact-2/block-data.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% 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
6 plugin tags: shortcodes, block patterns, block styles, gutenberg, block templates...

better-block-patterns/better-block-patterns.php 77% from 13 tests

The main file in "Better Block Patterns" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 206 characters long)
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("languages")
  • Domain Path: The domain path must begin with a forward slash character ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin15,551 lines of code in 91 files:
LanguageFilesBlank linesComment linesLines of code
SVG3009,552
PHP428756643,266
CSS39354811,477
JavaScript71901591,256

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity31.62
▷ Minimum class complexity1.00
▷ Maximum class complexity116.00
Average method complexity5.02
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes112.50%
Methods61
▷ Static methods46.56%
▷ Public methods4980.33%
▷ Protected methods00.00%
▷ Private methods1219.67%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
46 PNG files occupy 0.50MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
patterns/general-features/pricing-1/screenshot.png14.58KB5.83KB▼ 60.00%
assets/images/bbp-logo-dark.png1.40KB1.48KB0.00%
assets/images/solid-color-6.png0.14KB0.14KB0.00%
patterns/general-features/description-2/screenshot.png14.56KB5.82KB▼ 60.04%
assets/images/bbp-doc-step-3.png16.32KB16.04KB▼ 1.71%