84% prism

Code Review | Prism Syntax Highlighter for WordPress

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

About plugin

  • Plugin page: prism
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Apr 20, 2014
  • Latest release: Oct 2, 2016
  • Number of updates: 20
  • Update frequency: every 44.8 days
  • Top authors: nico23 (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

90+ active /6,291 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
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼2.96ms] Passed 4 tests

Analyzing server-side resources used by Prism Syntax Highlighter for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0643.81 ▲2.19
Dashboard /wp-admin3.35 ▲0.0552.85 ▲0.04
Posts /wp-admin/edit.php3.40 ▲0.0548.13 ▲1.28
Add New Post /wp-admin/post-new.php5.96 ▲0.0788.14 ▼13.62
Media Library /wp-admin/upload.php3.28 ▲0.0537.59 ▲0.46

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Prism Syntax Highlighter for WordPress: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3613.78 ▼0.571.80 ▼0.1543.25 ▲1.08
Dashboard /wp-admin2,203 ▲235.00 ▼0.6895.99 ▲1.4545.40 ▲5.68
Posts /wp-admin/edit.php2,111 ▲112.22 ▲0.2339.59 ▲2.1534.19 ▼6.28
Add New Post /wp-admin/post-new.php1,534 ▼123.28 ▲5.13681.99 ▲47.5756.53 ▼11.91
Media Library /wp-admin/upload.php1,411 ▲144.69 ▲0.5599.43 ▼4.6043.85 ▼1.92

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/prism/prism.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Add an image for screenshot #1 (Demo)
You can look at the official readme.txt

prism/prism.php Passed 13 tests

Analyzing the main PHP file in "Prism Syntax Highlighter for WordPress" version 1.1.1
123 characters long description:
Most minimalistic yet most configurabale Prismjs integration plugin, includes shortcode for custom field content (detached)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected440 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP110027221
CSS1358204
JavaScript10115

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods17.14%
▷ Public methods1392.86%
▷ Protected methods00.00%
▷ Private methods17.14%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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 are no PNG files in this plugin