89% wp-codemirror-block

Code Review | CodeMirror Blocks

WordPress plugin CodeMirror Blocks scored89%from 54 tests.

About plugin

  • Plugin page: wp-codemirror-block
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Dec 20, 2018
  • Latest release: Nov 26, 2022
  • Number of updates: 57
  • Update frequency: every 25.2 days
  • Top authors: vickyagravat (100%)

Code review

54 tests

User reviews

37 reviews

Install metrics

3,000+ active /36,147 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼2.74ms] Passed 4 tests

Analyzing server-side resources used by CodeMirror Blocks
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0840.06 ▼1.83
Dashboard /wp-admin3.36 ▲0.0648.30 ▼2.28
Posts /wp-admin/edit.php3.41 ▲0.0648.95 ▲3.62
Add New Post /wp-admin/post-new.php5.96 ▲0.0885.25 ▼10.45
Media Library /wp-admin/upload.php3.29 ▲0.0637.30 ▲5.00

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 435 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

CodeMirror Blocks: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5713.28 ▼1.101.68 ▼0.3340.14 ▼8.26
Dashboard /wp-admin2,221 ▲304.86 ▼0.05102.26 ▼2.3937.43 ▼5.04
Posts /wp-admin/edit.php2,083 ▼92.02 ▲0.0134.30 ▼0.7133.92 ▲2.38
Add New Post /wp-admin/post-new.php6,203 ▲4,68919.20 ▲1.68911.68 ▲262.9762.41 ▲11.27
Media Library /wp-admin/upload.php1,403 ▲154.27 ▲0.0694.64 ▼5.2142.72 ▲0.73

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: Too many tags (18 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

wp-codemirror-block/index.php 77% from 13 tests

The primary PHP file in "CodeMirror Blocks" version 1.2.4 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-codemirror-block.php" instead of "index.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 186 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin64,119 lines of code in 430 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2226,1034,11246,115
HTML1292,5401013,590
CSS755994133,539
PHP4148385875

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity20.33
▷ Minimum class complexity13.00
▷ Maximum class complexity31.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods32
▷ Static methods2268.75%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
tinymce/js/code-block-setting.png17.67KB6.56KB▼ 62.86%
tinymce/js/code-block.png9.62KB3.73KB▼ 61.21%