72% block-layouts

Code Review | Block Layouts

WordPress plugin Block Layouts scored72%from 54 tests.

About plugin

  • Plugin page: block-layouts
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.0-5.2.2
  • WordPress version: 6.3.1
  • First release: Jun 28, 2019
  • Latest release: Feb 14, 2020
  • Number of updates: 8
  • Update frequency: every 28.9 days
  • Top authors: derweili (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /826 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼0.15MB] [CPU: ▼11.40ms] Passed 4 tests

An overview of server-side resources used by Block Layouts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.32 ▼2.17
Dashboard /wp-admin3.33 ▲0.0344.87 ▼2.78
Posts /wp-admin/edit.php3.38 ▲0.0247.05 ▼6.80
Add New Post /wp-admin/post-new.php5.22 ▼0.6666.56 ▼33.83
Media Library /wp-admin/upload.php3.25 ▲0.0231.97 ▼0.54
Block Layouts /wp-admin/edit.php?post_type=block-layout3.2934.62
Add New /wp-admin/post-new.php?post_type=block-layout5.2154.99

Server storage [IO: ▲0.05MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

Block Layouts: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲7313.35 ▼1.034.54 ▲2.4841.53 ▼2.94
Dashboard /wp-admin2,233 ▲484.85 ▼0.01112.04 ▲9.4740.96 ▼0.98
Posts /wp-admin/edit.php2,119 ▲302.01 ▼0.0441.20 ▲1.3334.83 ▼4.17
Add New Post /wp-admin/post-new.php1,556 ▲1418.52 ▲0.25602.45 ▲4.2268.36 ▲16.48
Media Library /wp-admin/upload.php1,409 ▲184.25 ▲0.0897.89 ▼1.8241.77 ▼4.22
Block Layouts /wp-admin/edit.php?post_type=block-layout1,0801.9831.4329.18
Add New /wp-admin/post-new.php?post_type=block-layout1,51517.12930.3934.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=block-layout
    • > Notice in wp-content/plugins/block-layouts/lib/register-scripts.php+55
    Undefined variable: js_dependencies
    • > GET request to /wp-admin/post-new.php?post_type=block-layout
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

SRP 50% 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 fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Derweili\\Block_Layouts\\add_action() in wp-content/plugins/block-layouts/lib/register-scripts.php:74
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Derweili\\Block_Layouts\\add_filter() in wp-content/plugins/block-layouts/lib/meta.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Derweili\\Block_Layouts\\add_action() in wp-content/plugins/block-layouts/lib/register-post-type.php:19
    • > register script file

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/post-new.php?post_type=block-layout
    • > Console-api (warning) in wp-includes/js/dist/deprecated.min.js?ver=73ad3591e7bc95f4777a+1:627
    `wp.data.select( 'core/editor' ).getBlocks` is deprecated since version 5.3 and will be removed in version 6.2. Please use `wp.data.select( 'core/block-editor' ).getBlocks` instead.


Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: A description for screenshot #3 is required in block-layouts/assets to your readme.txt
  • Screenshots: Please add an image for screenshot #1 (screenshot-1.png)
The official readme.txt is a good inspiration

block-layouts/plugin.php 92% from 13 tests

The main PHP file in "Block Layouts" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("block-layouts.php" instead of "plugin.php")

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
Everything looks great! No dangerous files found in this plugin512 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PO File17727

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions7100.00%
▷ Anonymous functions00.00%
▷ 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
No PNG files were detected