90% highlighting-code-block

Code Review | Highlighting Code Block

WordPress plugin Highlighting Code Block scored90%from 54 tests.

About plugin

  • Plugin page: highlighting-code...
  • Plugin version: 2.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4
  • WordPress version: 6.3.1
  • First release: Dec 12, 2018
  • Latest release: Nov 12, 2023
  • Number of updates: 50
  • Update frequency: every 35.9 days
  • Top authors: looswebstudio (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

10,000+ active /126,874 total downloads

Benchmarks

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.13MB] [CPU: ▼1.80ms] Passed 4 tests

A check of server-side resources used by Highlighting Code Block
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1340.79 ▲0.10
Dashboard /wp-admin3.44 ▲0.1350.27 ▼1.30
Posts /wp-admin/edit.php3.55 ▲0.1946.87 ▲4.04
Add New Post /wp-admin/post-new.php6.03 ▲0.1483.29 ▼8.65
Media Library /wp-admin/upload.php3.36 ▲0.1336.80 ▲2.64
[HCB] Settings /wp-admin/options-general.php?page=hcb_settings3.3330.01

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 59 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
loos_hcb_installed
db_upgraded
loos_hcb_settings
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Highlighting Code Block
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲6413.79 ▼0.5711.40 ▲9.6641.33 ▼1.89
Dashboard /wp-admin2,202 ▲285.54 ▼0.1187.47 ▼13.7638.94 ▼5.68
Posts /wp-admin/edit.php2,107 ▲72.03 ▼0.1133.55 ▼0.8635.46 ▲3.77
Add New Post /wp-admin/post-new.php6,214 ▲4,68819.11 ▼3.91902.27 ▲268.8338.07 ▼12.22
Media Library /wp-admin/upload.php1,410 ▲104.18 ▼0.0898.63 ▼0.7941.34 ▼1.15
[HCB] Settings /wp-admin/options-general.php?page=hcb_settings9802.0524.0340.92

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: syntax highlight, code highlighting, guternberg, highlight, editor...

highlighting-code-block/highlighting-code-block.php 92% from 13 tests

The main file in "Highlighting Code Block" v. 2.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin14,523 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
YAML11,725012,303
JavaScript1476166718
Sass1412775634
PHP8126164511
PO File15969152
JSON500144
SVG50355
CSS6006

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity7.20
▷ Minimum class complexity3.00
▷ Maximum class complexity11.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods25
▷ Static methods1976.00%
▷ Public methods1872.00%
▷ Protected methods00.00%
▷ Private methods728.00%
Functions5
▷ Named functions00.00%
▷ Anonymous functions5100.00%
Constants7
▷ Global constants342.86%
▷ Class constants457.14%
▷ Public constants4100.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
There are no PNG files in this plugin