10% custom-block-styles

Code Review | Custom Block Styles for Gutenberg

WordPress plugin Custom Block Styles for Gutenberg scored 10% from 54 tests.

About plugin

  • Plugin page: custom-block-styles
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7.2
  • WordPress version: 6.3.1
  • First release: Aug 29, 2019
  • Latest release: May 19, 2021
  • Number of updates: 43
  • Update frequency: every 14.7 days
  • Top authors: altafhpatel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,372 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'cbsStyles' does not have a method 'activate'

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.72ms] Passed 4 tests

Analyzing server-side resources used by Custom Block Styles for Gutenberg
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.33 ▼7.73
Dashboard /wp-admin3.31 ▲0.0146.68 ▼0.66
Posts /wp-admin/edit.php3.36 ▲0.0147.94 ▲1.53
Add New Post /wp-admin/post-new.php5.89 ▲0.0192.27 ▲0.26
Media Library /wp-admin/upload.php3.23 ▲0.0133.44 ▼2.76

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Custom Block Styles for Gutenberg: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲9213.28 ▼1.142.03 ▲0.2241.65 ▼4.47
Dashboard /wp-admin2,208 ▲204.82 ▼0.28107.58 ▼9.2238.53 ▼11.10
Posts /wp-admin/edit.php2,091 ▲22.19 ▲0.1639.95 ▲6.1035.94 ▲2.89
Add New Post /wp-admin/post-new.php1,535 ▼723.49 ▲0.35648.34 ▼51.7252.21 ▼1.62
Media Library /wp-admin/upload.php1,390 ▲84.18 ▼0.0295.05 ▼5.9546.20 ▲0.99

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • 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
Even though everything seems fine, this is not 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 take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/custom-block-styles/cbs-editor-style.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === custom-block-styles === )
  • Donate link: Please fix this invalid URI: ""
The official readme.txt might help

custom-block-styles/cbs-editor-style.php 85% from 13 tests

The primary PHP file in "Custom Block Styles for Gutenberg" version 1.0.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 227 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("custom-block-styles.php" instead of "cbs-editor-style.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected116 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
CSS1251679
PHP111022
HTML12015

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
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
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin