84% wp-prismjs-syntax-highlighter

Code Review | WP PrismJS - Syntax Highlighter

WordPress plugin WP PrismJS - Syntax Highlighter scored 84% from 54 tests.

About plugin

  • Plugin page: wp-prismjs-syntax...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-3.9.1
  • WordPress version: 6.3.1
  • First release: Jul 1, 2014
  • Latest release: Jul 1, 2014
  • Number of updates: 15
  • Update frequency: N/A
  • Top authors: anthonydmt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 940 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 gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼13.01ms] Passed 4 tests

Server-side resources used by WP PrismJS - Syntax Highlighter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.18 ▼37.90
Dashboard /wp-admin3.32 ▲0.0147.11 ▼3.47
Posts /wp-admin/edit.php3.37 ▲0.0147.77 ▼7.59
Add New Post /wp-admin/post-new.php5.90 ▲0.0196.94 ▲5.24
Media Library /wp-admin/upload.php3.24 ▲0.0133.81 ▼3.07

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WP PrismJS - Syntax Highlighter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,885 ▲13914.11 ▼0.6410.28 ▲8.0539.47 ▼19.42
Dashboard /wp-admin2,206 ▲184.85 ▼0.21113.54 ▼2.1941.65 ▲0.64
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0238.53 ▼3.9036.08 ▼0.61
Add New Post /wp-admin/post-new.php1,535 ▲123.41 ▲0.22607.18 ▼77.4352.35 ▼2.90
Media Library /wp-admin/upload.php1,391 ▲64.21 ▼0.0197.49 ▼4.8842.87 ▼3.20

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not 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
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-prismjs-syntax-highlighter/wp-prismjs.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: prism, syntax, highlighter, prismjs

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

This is the main PHP file of "WP PrismJS - Syntax Highlighter" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-prismjs-syntax-highlighter.php" instead of "wp-prismjs.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin266 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS22512134
JavaScript361799
PHP1242733

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin