73% custom-blocks-templates

Code Review | Custom Blocks Templates

WordPress plugin Custom Blocks Templates scored73%from 54 tests.

About plugin

  • Plugin page: custom-blocks-tem...
  • Plugin version: 1.3.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: May 1, 2020
  • Latest release: May 16, 2023
  • Number of updates: 15
  • Update frequency: every 74.0 days
  • Top authors: sirvelia (93.33%)joanrodas (13.33%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active /1,266 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.35MB] [CPU: ▼0.83ms] Passed 4 tests

A check of server-side resources used by Custom Blocks Templates
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.11 ▲0.6457.62 ▲18.16
Dashboard /wp-admin3.93 ▲0.6259.72 ▲8.66
Posts /wp-admin/edit.php3.99 ▲0.6358.57 ▲7.65
Add New Post /wp-admin/post-new.php5.50 ▼0.3963.19 ▼30.86
Media Library /wp-admin/upload.php3.79 ▲0.5546.27 ▲11.25
Create Template /wp-admin/post-new.php?post_type=block-template5.4655.37
Assign templates /wp-admin/edit.php?post_type=block-template&page=cbt-settings3.7750.95
Blocks Templates /wp-admin/edit.php?post_type=block-template3.9054.36

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 43 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Blocks Templates
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,108 ▲34726.31 ▲11.955.03 ▲3.1241.73 ▼4.05
Dashboard /wp-admin2,426 ▲24916.32 ▲10.65330.64 ▲238.2643.08 ▲1.06
Posts /wp-admin/edit.php2,368 ▲26515.37 ▲13.37128.19 ▲93.5739.64 ▲1.80
Add New Post /wp-admin/post-new.php6,253 ▲4,72528.25 ▲5.15788.51 ▲84.6535.87 ▼25.56
Media Library /wp-admin/upload.php1,264 ▼13611.95 ▲7.84185.84 ▲61.0043.43 ▼3.23
Create Template /wp-admin/post-new.php?post_type=block-template6,18828.00880.3330.77
Assign templates /wp-admin/edit.php?post_type=block-template&page=cbt-settings1,13415.02122.3324.80
Blocks Templates /wp-admin/edit.php?post_type=block-template1,25315.59133.6535.61

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=block-template
    • > User deprecated in wp-includes/functions.php+5828
    Hook block_categories is deprecated since version 5.8.0! Use block_categories_all instead.

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
The following issues need your attention
  • 14× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Sirvelia\\CBT\\add_action() in wp-content/plugins/custom-blocks-templates/lib/template-settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Sirvelia\\CBT\\add_filter() in wp-content/plugins/custom-blocks-templates/lib/block-templates.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Sirvelia\\CBT\\add_filter() in wp-content/plugins/custom-blocks-templates/lib/create-block-category.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Sirvelia\\CBT\\Accordion\\add_action() in wp-content/plugins/custom-blocks-templates/blocks/accordion/index.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Sirvelia\\CBT\\add_filter() in wp-content/plugins/custom-blocks-templates/lib/admin-cbt-edit.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Sirvelia\\CBT\\add_action() in wp-content/plugins/custom-blocks-templates/lib/enqueue-scripts.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Sirvelia\\CBT\\PrivateBlock\\add_action() in wp-content/plugins/custom-blocks-templates/blocks/private-block/index.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Sirvelia\\CBT\\Countdown\\add_action() in wp-content/plugins/custom-blocks-templates/blocks/countdown/index.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Sirvelia\\CBT\\add_filter() in wp-content/plugins/custom-blocks-templates/lib/admin-cbt-list.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Sirvelia\\CBT\\CsvTables\\add_action() in wp-content/plugins/custom-blocks-templates/blocks/csv-tables/index.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit.php?post_type=block-template
    • > Console-api (warning) in wp-includes/js/dist/deprecated.min.js?ver=73ad3591e7bc95f4777a+1:627
    `position` prop in wp.components.Dropdown is deprecated since version 6.2. Please use `popoverProps.placement` prop instead. Note: Note that the `position` prop will override any values passed through the `popoverProps.placement` prop.

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: fontawesome, gutenberg, dynamic, template, block

custom-blocks-templates/custom-blocks-templates.php Passed 13 tests

The main PHP file in "Custom Blocks Templates" ver. 1.3.2 adds more information about the plugin and also serves as the entry point for this plugin
60 characters long description:
Create and set Gutenberg blocks templates for any post type.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin12,387 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
SVG30129,299
PHP155846292,905
JavaScript4622169
CSS531514

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity193.50
▷ Minimum class complexity138.00
▷ Maximum class complexity249.00
Average method complexity5.28
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods90
▷ Static methods11.11%
▷ Public methods7583.33%
▷ Protected methods1516.67%
▷ Private methods00.00%
Functions52
▷ Named functions4178.85%
▷ Anonymous functions1121.15%
Constants22
▷ Global constants22100.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
No PNG images were found in this plugin