84% syntax-highlighting-code-block

Code Review | Syntax-highlighting Code Block (with Server-side Rendering)

WordPress plugin Syntax-highlighting Code Block (with Server-side Rendering) scored84%from 54 tests.

About plugin

  • Plugin page: syntax-highlighti...
  • Plugin version: 1.4.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2
  • WordPress version: 6.3.1
  • First release: Jul 30, 2019
  • Latest release: Aug 8, 2023
  • Number of updates: 41
  • Update frequency: every 35.9 days
  • Top authors: westonruter (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

1,000+ active /22,299 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.82ms] Passed 4 tests

This is a short check of server-side resources used by Syntax-highlighting Code Block (with Server-side Rendering)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0146.03 ▲4.87
Dashboard /wp-admin3.32 ▼0.0348.09 ▼18.88
Posts /wp-admin/edit.php3.37 ▲0.0148.77 ▼0.82
Add New Post /wp-admin/post-new.php5.90 ▲0.0291.09 ▼14.65
Media Library /wp-admin/upload.php3.24 ▲0.0137.97 ▲3.08

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Syntax-highlighting Code Block (with Server-side Rendering)
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.72 ▲0.371.79 ▼0.1845.65 ▲0.53
Dashboard /wp-admin2,189 ▲125.56 ▼0.1185.69 ▼9.2238.82 ▼3.67
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0139.77 ▲2.0735.30 ▼2.34
Add New Post /wp-admin/post-new.php1,535 ▲923.13 ▲0.19618.77 ▼73.1353.83 ▼1.25
Media Library /wp-admin/upload.php1,397 ▼34.22 ▲0.0496.92 ▼16.7342.72 ▼4.73

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • 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 no errors were found, this is by no means 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
Please fix the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Syntax_Highlighting_Code_Block\\add_action() in wp-content/plugins/syntax-highlighting-code-block/syntax-highlighting-code-block.php:254
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/syntax-highlighting-code-block/language-names.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Highlight\\Mode' not found in wp-content/plugins/syntax-highlighting-code-block/vendor/scrivo/highlight-php/Highlight/Language.php:48

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: code highlighting, code, syntax highlight, code syntax, block

syntax-highlighting-code-block/syntax-highlighting-code-block.php Passed 13 tests

The principal PHP file in "Syntax-highlighting Code Block (with Server-side Rendering)" v. 1.4.0 is loaded by WordPress automatically on each request
139 characters long description:
Extending the Code block with syntax highlighting rendered on the server, thus being AMP-compatible and having faster frontend performance.

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
Everything looks great! No dangerous files found in this plugin32,825 lines of code in 310 files:
LanguageFilesBlank linesComment linesLines of code
JSON1860023,737
CSS931,2616985,947
PHP296171,7443,139
JavaScript2002

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.45
Average class complexity20.60
▷ Minimum class complexity1.00
▷ Maximum class complexity113.00
Average method complexity3.66
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces5
Interfaces0
Traits1
Classes14
▷ Abstract classes321.43%
▷ Concrete classes1178.57%
▷ Final classes218.18%
Methods111
▷ Static methods2421.62%
▷ Public methods7567.57%
▷ Protected methods00.00%
▷ Private methods3632.43%
Functions40
▷ Named functions3690.00%
▷ Anonymous functions410.00%
Constants13
▷ Global constants00.00%
▷ Class constants13100.00%
▷ Public constants13100.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.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/scrivo/highlight-php/styles/brown-papersq.png17.77KB9.92KB▼ 44.16%
vendor/scrivo/highlight-php/styles/school-book.png0.47KB0.34KB▼ 27.37%