83% block-pattern-builder

Code Review | Block Pattern Builder

WordPress plugin Block Pattern Builder scored83%from 54 tests.

About plugin

  • Plugin page: block-pattern-bui...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5
  • WordPress version: 6.3.1
  • First release: Apr 3, 2020
  • Latest release: Aug 14, 2020
  • Number of updates: 3
  • Update frequency: every 44.3 days
  • Top authors: greenshady (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active /20,695 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.21ms] Passed 4 tests

Analyzing server-side resources used by Block Pattern Builder
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0634.98 ▼1.22
Dashboard /wp-admin3.36 ▲0.0543.06 ▼6.23
Posts /wp-admin/edit.php3.41 ▲0.0545.46 ▲0.12
Add New Post /wp-admin/post-new.php6.00 ▲0.1180.10 ▼12.24
Media Library /wp-admin/upload.php3.27 ▲0.0432.95 ▼1.13
New Pattern /wp-admin/post-new.php?post_type=bpb_pattern5.9974.81
Patterns /wp-admin/edit.php?post_type=bpb_pattern3.3231.58

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Block Pattern Builder
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲9513.22 ▼1.071.68 ▲0.0141.27 ▼1.69
Dashboard /wp-admin2,233 ▲454.84 ▼1.07109.60 ▲3.5938.36 ▼2.87
Posts /wp-admin/edit.php2,116 ▲482.02 ▲0.0038.60 ▲2.0933.78 ▲0.91
Add New Post /wp-admin/post-new.php1,544 ▲818.37 ▼4.95604.85 ▼61.9032.45 ▼18.20
Media Library /wp-admin/upload.php1,415 ▲244.22 ▲0.0399.99 ▼4.1742.07 ▼2.28
New Pattern /wp-admin/post-new.php?post_type=bpb_pattern1,51217.29879.9831.98
Patterns /wp-admin/edit.php?post_type=bpb_pattern1,0771.9835.3528.53

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/block-pattern-builder/uninstall.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Block Patterns management screen.), #2 (Creating a custom block pattern.), #3 (Inserting a block pattern into the post editor.)
You can look at the official readme.txt

block-pattern-builder/plugin.php 85% from 13 tests

"Block Pattern Builder" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Domain Path: The domain path is invalid: folder "/public/lang" does not exist
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("block-pattern-builder.php" instead of "plugin.php")

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
No dangerous file extensions were detected695 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP7101317311
Markdown3770303
JavaScript217378
JSON1003

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity3.67
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods13
▷ Static methods17.69%
▷ Public methods1076.92%
▷ Protected methods215.38%
▷ Private methods17.69%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.11MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png36.21KB13.67KB▼ 62.26%
screenshot-2.png76.21KB24.24KB▼ 68.19%