10% syntax-highlighting

Code Review | Syntax Highlighting

WordPress plugin Syntax Highlighting scored10%from 54 tests.

About plugin

  • Plugin page: syntax-highlighting
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Apr 26, 2017
  • Latest release: Apr 26, 2017
  • Number of updates: 4
  • Update frequency: every 1.3 days
  • Top authors: webstartup (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /697 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/syntax-highlighting/plugin/widget.php+179
    Function create_function() is deprecated

Server metrics [RAM: ▼1.90MB] [CPU: ▼48.83ms] Passed 4 tests

A check of server-side resources used by Syntax Highlighting
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.405.25 ▼33.07
Dashboard /wp-admin2.11 ▼1.197.45 ▼36.66
Posts /wp-admin/edit.php2.11 ▼1.257.77 ▼41.28
Add New Post /wp-admin/post-new.php2.11 ▼3.787.46 ▼84.32
Media Library /wp-admin/upload.php2.11 ▼1.127.77 ▼25.76

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 93 new files
Database: no new tables, 11 new options
New WordPress options
slwsu_syntax_highlighting_delete_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
slwsu_syntax_highlighting_post_types
slwsu_syntax_highlighting_grouper
slwsu_syntax_highlighting_default_color
widget_syntax_highlighting
theysaidso_admin_options
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Syntax Highlighting
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5514.74 ▲0.393.86 ▲2.2643.39 ▼1.68
Dashboard /wp-admin2,212 ▲355.56 ▼0.1082.50 ▼5.8840.07 ▲1.96
Posts /wp-admin/edit.php2,120 ▲202.04 ▲0.0133.83 ▼6.1232.33 ▼6.16
Add New Post /wp-admin/post-new.php6,260 ▲4,73420.93 ▼2.56843.08 ▲195.2071.04 ▲15.12
Media Library /wp-admin/upload.php1,423 ▲204.24 ▼0.0595.71 ▲0.2940.84 ▼2.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/syntax-highlighting/plugin/widget.php+179
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_syntax_highlighting
    • theysaidso_admin_options

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/syntax-highlighting/plugin/widget.php:6

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 96% from 29 tests

readme.txt Passed 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
8 plugin tags: highlight js, syntax highlighting, highlighting, code highlight, highlighter...

syntax-highlighting/syntax-highlighting.php 92% from 13 tests

This is the main PHP file of "Syntax Highlighting" version 0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, 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 plugin8,180 lines of code in 85 files:
LanguageFilesBlank linesComment linesLines of code
CSS658444915,960
Markdown33740956
PHP13145283747
JavaScript385113402
PO File14344115

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity9.25
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods69
▷ Static methods1217.39%
▷ Public methods6086.96%
▷ Protected methods00.00%
▷ Private methods913.04%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
plugin/front/assets/hightlight/styles/school_book.png0.47KB0.34KB▼ 27.37%
plugin/front/assets/hightlight/styles/brown_papersq.png17.77KB9.92KB▼ 44.16%