84% prettycode

Code Review | PrettyCode • Code syntax highlighting with CodeMirror

WordPress plugin PrettyCode • Code syntax highlighting with CodeMirror scored84%from 54 tests.

About plugin

  • Plugin page: prettycode
  • Plugin version: 1.0.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-5.9
  • WordPress version: 6.3.1
  • First release: Mar 8, 2022
  • Latest release: Mar 11, 2022
  • Number of updates: 18
  • Update frequency: every 0.2 days
  • Top authors: maximebj (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,184 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by PrettyCode • Code syntax highlighting with CodeMirror
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.82 ▼5.70
Dashboard /wp-admin3.32 ▼0.0347.23 ▼19.69
Posts /wp-admin/edit.php3.37 ▲0.0151.11 ▼1.08
Add New Post /wp-admin/post-new.php5.91 ▲0.0283.91 ▼30.32
Media Library /wp-admin/upload.php3.24 ▲0.0135.12 ▼0.94

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for PrettyCode • Code syntax highlighting with CodeMirror
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲4614.27 ▼0.091.82 ▲0.0347.21 ▲3.21
Dashboard /wp-admin2,198 ▲185.62 ▼0.0391.23 ▼3.1940.63 ▼1.66
Posts /wp-admin/edit.php2,103 ▲31.97 ▼0.0439.60 ▲2.4134.48 ▲0.48
Add New Post /wp-admin/post-new.php6,371 ▲4,83429.37 ▲11.27907.06 ▲283.5561.78 ▼19.64
Media Library /wp-admin/upload.php1,400 ▼04.24 ▲0.05101.49 ▲0.6346.37 ▲0.65

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/prettycode/templates/code.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots lack descriptions #1, #2 in prettycode/assets to your readme.txt
The official readme.txt is a good inspiration

prettycode/prettycode.php Passed 13 tests

The main PHP script in "PrettyCode • Code syntax highlighting with CodeMirror" version 1.0.7 is automatically included on every request by WordPress
65 characters long description:
Code snippets highlighting made simple, for the WordPress editor.

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
Everything looks great! No dangerous files found in this plugin40,904 lines of code in 232 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1605,1093,59038,200
CSS604253002,312
PHP968119357
JSON20020
PO File10015

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity2.43
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes7
▷ Abstract classes342.86%
▷ Concrete classes457.14%
▷ Final classes00.00%
Methods14
▷ Static methods428.57%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin