84% wp-prism-syntax-highlighter

Code Review | WP Prism Syntax Highlighter

WordPress plugin WP Prism Syntax Highlighter scored84%from 54 tests.

About plugin

  • Plugin page: wp-prism-syntax-h...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 29, 2014
  • Latest release: Sep 7, 2014
  • Number of updates: 11
  • Update frequency: every 0.8 days
  • Top authors: GuiTeK (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /3,070 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼11.36ms] Passed 4 tests

Server-side resources used by WP Prism Syntax Highlighter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0542.97 ▼4.03
Dashboard /wp-admin3.35 ▲0.0053.73 ▼19.05
Posts /wp-admin/edit.php3.41 ▲0.0453.11 ▲1.08
Add New Post /wp-admin/post-new.php5.94 ▲0.0485.47 ▼19.31
Media Library /wp-admin/upload.php3.28 ▲0.0435.35 ▼3.05
Prism /wp-admin/options-general.php?page=prism3.2737.97

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
notice_warn_theme_css
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Prism Syntax Highlighter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲8214.35 ▼0.211.76 ▼0.0543.58 ▼4.64
Dashboard /wp-admin2,237 ▲635.82 ▲0.2488.03 ▼14.8644.54 ▼1.17
Posts /wp-admin/edit.php2,141 ▲592.39 ▲0.3936.47 ▼0.3132.50 ▼6.68
Add New Post /wp-admin/post-new.php1,565 ▲3723.35 ▲0.02658.95 ▲6.0651.68 ▲0.67
Media Library /wp-admin/upload.php1,440 ▲434.38 ▲0.28102.60 ▼6.4650.87 ▲6.50
Prism /wp-admin/options-general.php?page=prism1,0591.8325.4043.83

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • notice_warn_theme_css
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-prism-syntax-highlighter/wp-prism-syntax-highlighter.php
    • > /wp-content/plugins/wp-prism-syntax-highlighter/prism-options.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Integrated code editor), #2 (Highlighted C++ code), #3 (Plugin settings)
The official readme.txt might help

wp-prism-syntax-highlighter/wp-prism-syntax-highlighter.php Passed 13 tests

The principal PHP file in "WP Prism Syntax Highlighter" v. 1.0.5 is loaded by WordPress automatically on each request
89 characters long description:
A lightweight and convenient plugin to integrate Prism Syntax Highlighter into WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected440 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript23428171
PHP25757165
CSS1218104

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods110.00%
▷ Public methods880.00%
▷ Protected methods00.00%
▷ Private methods220.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
3 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png19.56KB9.68KB▼ 50.50%
screenshot-1.png16.11KB8.33KB▼ 48.32%
screenshot-3.png18.78KB10.58KB▼ 43.65%