84% lite-syntax-highlighting

Code Review | Lite Syntax Highlighting

WordPress plugin Lite Syntax Highlighting scored84%from 54 tests.

About plugin

  • Plugin page: lite-syntax-highl...
  • Plugin version: 0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.1.1
  • WordPress version: 6.3.1
  • First release: Jan 4, 2016
  • Latest release: Mar 24, 2019
  • Number of updates: 25
  • Update frequency: every 47.0 days
  • Top authors: z-17 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /2,112 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.29MB] [CPU: ▼21.29ms] Passed 4 tests

Server-side resources used by Lite Syntax Highlighting
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.68 ▼5.87
Dashboard /wp-admin3.36 ▲0.0150.37 ▼15.97
Posts /wp-admin/edit.php3.47 ▲0.1149.21 ▼0.68
Add New Post /wp-admin/post-new.php4.65 ▼1.2443.91 ▼62.64
Media Library /wp-admin/upload.php3.28 ▲0.0543.08 ▲7.46
Syntax Highlighting /wp-admin/options-general.php?page=highlighting3.2536.63

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 20 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
syntax_highlighting_options

Browser metrics Passed 4 tests

Checking browser requirements for Lite Syntax Highlighting
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲16913.60 ▼0.785.76 ▲3.9043.29 ▲2.14
Dashboard /wp-admin2,228 ▲225.82 ▲0.93104.07 ▼0.8939.96 ▼2.81
Posts /wp-admin/edit.php2,104 ▲12.03 ▲0.0537.31 ▲2.1933.45 ▼3.04
Add New Post /wp-admin/post-new.php1,532 ▲617.56 ▲0.13684.43 ▲34.5150.00 ▼5.69
Media Library /wp-admin/upload.php1,404 ▲44.15 ▼0.17106.09 ▼1.3146.18 ▼0.20
Syntax Highlighting /wp-admin/options-general.php?page=highlighting9391.9921.9829.75

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lite-syntax-highlighting/lite-syntax-highlighting.php:16

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 on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Example for PHP code), #2 (Settings page), #3 (Editor), #4 (Dark style)
The official readme.txt might help

lite-syntax-highlighting/lite-syntax-highlighting.php Passed 13 tests

The main PHP script in "Lite Syntax Highlighting" version 0.5 is automatically included on every request by WordPress
55 characters long description:
Lite Syntax Highlighting for PHP, JS, CSS ans HTML code

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected878 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1212456
PHP43315204
CSS2280126
PO File3183092

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity9.00
▷ Minimum class complexity3.00
▷ Maximum class complexity13.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods10
▷ Static methods990.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png14.85KB7.01KB▼ 52.76%
screenshot-2.png29.89KB12.77KB▼ 57.26%