84% syntax-highlighter-for-postpage-html-editor

Code Review | Syntax Highlighter for Post/Page HTML Editor

WordPress plugin Syntax Highlighter for Post/Page HTML Editor scored 84% from 54 tests.

About plugin

  • Plugin page: syntax-highlighte...
  • Plugin version: 2.50
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.8
  • WordPress version: 5.8.1
  • First release: Jan 31, 2017
  • Latest release: Sep 6, 2021
  • Number of updates: 70
  • Update frequency: every 24.0 days
  • Top authors: Arthur Gareginyan (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active / 15,330 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼136.44ms] Passed 4 tests

A check of server-side resources used by Syntax Highlighter for Post/Page HTML Editor
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.1036.02 ▲6.71
Dashboard /wp-admin3.16 ▲0.1153.05 ▲8.36
Posts /wp-admin/edit.php3.27 ▲0.1649.06 ▼3.75
Add New Post /wp-admin/post-new.php5.52 ▲0.0995.94 ▼557.07
Media Library /wp-admin/upload.php3.11 ▲0.1041.30 ▲9.40
Post / Page Editor /wp-admin/options-general.php?page=syntax-highlighter-for-postpage-html-editor3.2133.85

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 114 new files
Database: no new tables, 1 new option
New WordPress options
spacexchimp_p014_service_info

Browser metrics Passed 4 tests

Syntax Highlighter for Post/Page HTML Editor: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲4715.80 ▼0.107.88 ▼2.3849.71 ▲0.97
Dashboard /wp-admin2,972 ▲385.89 ▼0.05142.02 ▼3.73114.06 ▲5.58
Posts /wp-admin/edit.php2,744 ▲52.69 ▲0.0164.33 ▼1.5985.64 ▼6.30
Add New Post /wp-admin/post-new.php1,686 ▲18616.25 ▼2.39392.33 ▲8.83105.67 ▼1.42
Media Library /wp-admin/upload.php1,812 ▲55.02 ▲0.01164.47 ▲4.68117.67 ▼13.84
Post / Page Editor /wp-admin/options-general.php?page=syntax-highlighter-for-postpage-html-editor3,6933.63100.78121.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • spacexchimp_p014_service_info

Smoke tests 75% from 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 50% from 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
Almost there! Just fix the following items
  • 15× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/syntax-highlighter-for-postpage-html-editor/inc/php/sidebar.php
    • > /wp-content/plugins/syntax-highlighter-for-postpage-html-editor/inc/php/inline-js.php
    • > /wp-content/plugins/syntax-highlighter-for-postpage-html-editor/inc/php/messages.php
    • > /wp-content/plugins/syntax-highlighter-for-postpage-html-editor/inc/php/tabs/faq.php
    • > /wp-content/plugins/syntax-highlighter-for-postpage-html-editor/inc/php/page.php
    • > /wp-content/plugins/syntax-highlighter-for-postpage-html-editor/inc/php/tabs/usage.php
    • > /wp-content/plugins/syntax-highlighter-for-postpage-html-editor/inc/php/controls.php
    • > /wp-content/plugins/syntax-highlighter-for-postpage-html-editor/inc/php/functional.php
    • > /wp-content/plugins/syntax-highlighter-for-postpage-html-editor/inc/php/upgrade.php
    • > /wp-content/plugins/syntax-highlighter-for-postpage-html-editor/inc/php/versioning.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (24 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

syntax-highlighter-for-postpage-html-editor/syntax-highlighter-for-postpage-html-editor.php Passed 13 tests

The principal PHP file in "Syntax Highlighter for Post/Page HTML Editor" v. 2.50 is loaded by WordPress automatically on each request
124 characters long description:
Replaces the defaults WordPress Post/Page HTML Editor with an enhanced editor with syntax highlighting, line numbering, etc.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin20,814 lines of code in 95 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript171,3231,11411,108
SVG2102,677
CSS412762571,957
PO File57337511,634
Markdown386501,298
PHP162553261,158
HTML101381935
JSON10047

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.16
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.03MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/img/spacexchimp-logo.png21.01KB14.98KB▼ 28.69%
inc/img/thanks.png9.03KB9.47KB0.00%