79% prettify-code-syntax

Code Review | Prettify Code Syntax

WordPress plugin Prettify Code Syntax scored79%from 54 tests.

About plugin

  • Plugin page: prettify-code-syntax
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5.1
  • WordPress version: 6.3.1
  • First release: Feb 15, 2013
  • Latest release: Mar 21, 2013
  • Number of updates: 26
  • Update frequency: every 1.3 days
  • Top authors: jesucarr (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

100+ active /11,587 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Server-side resources used by Prettify Code Syntax
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0445.57 ▲1.01
Dashboard /wp-admin3.35 ▲0.0549.39 ▼1.65
Posts /wp-admin/edit.php3.40 ▲0.0550.88 ▲0.95
Add New Post /wp-admin/post-new.php5.95 ▲0.0789.39 ▼3.21
Media Library /wp-admin/upload.php3.28 ▲0.0538.12 ▼4.14
Prettify Code Syntax /wp-admin/options-general.php?page=prettify-code-syntax3.2429.46

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 50 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Prettify Code Syntax
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲4013.52 ▼1.019.32 ▲7.7139.06 ▼8.62
Dashboard /wp-admin2,198 ▲185.61 ▼0.0190.60 ▼3.0640.85 ▼0.41
Posts /wp-admin/edit.php2,106 ▲92.00 ▲0.0439.36 ▲0.7834.70 ▼0.82
Add New Post /wp-admin/post-new.php1,530 ▲423.09 ▼0.05644.21 ▼58.4769.27 ▼2.23
Media Library /wp-admin/upload.php1,403 ▲34.22 ▲0.11103.88 ▼12.6946.90 ▼0.04
Prettify Code Syntax /wp-admin/options-general.php?page=prettify-code-syntax1,2022.1827.4430.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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=prettify-code-syntax
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=prettify-code-syntax
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 31 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=prettify-code-syntax
    • > Notice in wp-content/plugins/prettify-code-syntax/views/style-style-field-content.php+26
    Trying to access array offset on value of type bool
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=prettify-code-syntax
    • > Notice in wp-content/plugins/prettify-code-syntax/views/style-style-field-content.php+9
    Undefined variable: options
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=prettify-code-syntax
    • > Notice in wp-content/plugins/prettify-code-syntax/views/style-style-field-content.php+9
    Trying to access array offset on value of type null

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/prettify-code-syntax/views/languages-extra-languages-field-content.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/prettify-code-syntax/views/languages-section-description.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/prettify-code-syntax/views/style-style-field-content.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/prettify-code-syntax/views/style-section-description.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/prettify-code-syntax/views/options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/prettify-code-syntax/prettify-code-syntax.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: syntax, markup, highlighter, prettify, code

prettify-code-syntax/prettify-code-syntax.php Passed 13 tests

The main PHP file in "Prettify Code Syntax" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
104 characters long description:
Code syntax highlighter using Google Prettify, supporting the HTML5 recommendation, and caching plugins.

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 plugin2,047 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript292231,4451,459
CSS63918321
PHP77323228
PO File1121739

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.38
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.09MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bootstrap.png31.43KB5.50KB▼ 82.51%
images/default.png13.19KB13.13KB0.45%
images/sunburst.png12.38KB12.24KB▼ 1.13%
images/desert.png13.73KB12.92KB▼ 5.92%
images/sons-of-obsidian.png17.99KB17.08KB▼ 5.03%