84% prism-syntax-highlighter

Code Review | Prism Syntax Highlighter

WordPress plugin Prism Syntax Highlighter scored84%from 54 tests.

About plugin

  • Plugin page: prism-syntax-high...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.4.1
  • WordPress version: 6.3.1
  • First release: Aug 3, 2012
  • Latest release: Aug 3, 2012
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: gilbitron (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,719 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
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Prism Syntax Highlighter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.29 ▲5.33
Dashboard /wp-admin3.32 ▼0.0248.62 ▼19.28
Posts /wp-admin/edit.php3.37 ▲0.0245.34 ▼10.40
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.34 ▼8.76
Media Library /wp-admin/upload.php3.24 ▲0.0233.90 ▲2.83
Prism Settings /wp-admin/options-general.php?page=wp-prism3.2133.46

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Prism Syntax Highlighter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.39 ▲0.111.95 ▲0.3142.92 ▲1.68
Dashboard /wp-admin2,206 ▲265.59 ▼0.0688.14 ▼1.3340.18 ▲0.26
Posts /wp-admin/edit.php2,111 ▲112.01 ▲0.0238.51 ▲1.6734.02 ▼0.80
Add New Post /wp-admin/post-new.php1,533 ▲523.18 ▲0.24679.26 ▼0.3359.76 ▼13.08
Media Library /wp-admin/upload.php1,411 ▲84.24 ▲0.01104.38 ▼0.5544.19 ▼0.83
Prism Settings /wp-admin/options-general.php?page=wp-prism8592.0427.3427.20

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however 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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/prism-syntax-highlighter/wp-prism.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: code, pre, prism, syntax, highlighter

prism-syntax-highlighter/wp-prism.php 92% from 13 tests

The entry point to "Prism Syntax Highlighter" version 1.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("prism-syntax-highlighter.php" instead of "wp-prism.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin644 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS37821406
JavaScript4497122
PHP1181099
PO File11017

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity3.11
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.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
No PNG images were found in this plugin