84% block-editor-colors

Code Review | Block Editor Colors

WordPress plugin Block Editor Colors scored84%from 54 tests.

About plugin

  • Plugin page: block-editor-colors
  • Plugin version: 1.2.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 9, 2020
  • Latest release: Apr 6, 2023
  • Number of updates: 30
  • Update frequency: every 37.5 days
  • Top authors: endzevich (46.67%)jetmonsters (36.67%)MotoPress (23.33%)

Code review

54 tests

User reviews

11 reviews

Install metrics

3,000+ active /20,270 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼5.27ms] Passed 4 tests

Server-side resources used by Block Editor Colors
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2341.01 ▼7.36
Dashboard /wp-admin3.53 ▲0.2351.11 ▲2.06
Posts /wp-admin/edit.php3.64 ▲0.2950.74 ▲4.30
Add New Post /wp-admin/post-new.php6.12 ▲0.2384.48 ▼17.09
Media Library /wp-admin/upload.php3.46 ▲0.2339.24 ▲1.30
Editor Colors /wp-admin/options-general.php?page=editor-colors3.4335.25

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
bec_css_prefix

Browser metrics Passed 4 tests

This is an overview of browser requirements for Block Editor Colors
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.24 ▼0.521.79 ▼0.7937.14 ▼6.57
Dashboard /wp-admin2,202 ▲225.62 ▼0.0684.91 ▼13.2935.36 ▼5.64
Posts /wp-admin/edit.php2,101 ▼21.98 ▼0.0236.41 ▼2.9232.21 ▼6.89
Add New Post /wp-admin/post-new.php1,531 ▲322.88 ▼0.26586.65 ▼101.0957.23 ▼1.57
Media Library /wp-admin/upload.php1,404 ▲44.19 ▼0.0397.42 ▼7.9644.38 ▲1.23
Editor Colors /wp-admin/options-general.php?page=editor-colors2,9402.97101.2832.84

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • bec_css_prefix
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, 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
The following issues need your attention
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BlockEditorColors\\register_post_type() in wp-content/plugins/block-editor-colors/includes/CustomColorsService.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BlockEditorColors\\add_action() in wp-content/plugins/block-editor-colors/includes/BlockEditorColors.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BlockEditorColors\\add_option() in wp-content/plugins/block-editor-colors/includes/OptionsService.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'BlockEditorColors\\DefaultColorsService' not found in wp-content/plugins/block-editor-colors/includes/ColorsService.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BlockEditorColors\\get_theme_support() in wp-content/plugins/block-editor-colors/includes/DefaultColorsService.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BlockEditorColors\\add_action() in wp-content/plugins/block-editor-colors/includes/admin/AdminPages.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed: The official readme.txt might help

block-editor-colors/plugin.php 92% from 13 tests

The principal PHP file in "Block Editor Colors" v. 1.2.4 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("block-editor-colors.php" instead of "plugin.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 detected1,094 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP821622906
CSS1270131
JavaScript18057

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity10.29
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods52
▷ Static methods713.46%
▷ Public methods4280.77%
▷ Protected methods00.00%
▷ Private methods1019.23%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
PNG images were not found in this plugin