84% codeblocks-extended

Code Review | Codeblocks Extended with PrismJS

WordPress plugin Codeblocks Extended with PrismJS scored84%from 54 tests.

About plugin

  • Plugin page: codeblocks-extended
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.1
  • WordPress version: 6.3.1
  • First release: Oct 23, 2016
  • Latest release: Jun 5, 2019
  • Number of updates: 5
  • Update frequency: every 191.0 days
  • Top authors: duplaja (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,129 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.01MB] [CPU: ▼5.62ms] Passed 4 tests

Analyzing server-side resources used by Codeblocks Extended with PrismJS
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0234.10 ▼2.17
Dashboard /wp-admin3.31 ▲0.0144.55 ▼1.86
Posts /wp-admin/edit.php3.36 ▲0.0044.26 ▼3.39
Add New Post /wp-admin/post-new.php5.89 ▲0.0181.28 ▼15.04
Media Library /wp-admin/upload.php3.23 ▲0.0035.04 ▲2.13

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Codeblocks Extended with PrismJS
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲10116.79 ▲2.4218.79 ▲16.8036.39 ▼11.31
Dashboard /wp-admin2,212 ▲245.84 ▼0.05102.62 ▼2.4538.50 ▼4.19
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0137.98 ▼2.3333.97 ▼2.91
Add New Post /wp-admin/post-new.php1,536 ▲823.18 ▲4.91684.58 ▲58.3448.23 ▼8.38
Media Library /wp-admin/upload.php1,388 ▼34.21 ▼0.03101.34 ▲0.2540.44 ▼4.08

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • 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)
Good news, no errors were detected

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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/codeblocks-extended/codeblocks-extended.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 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: clipboardjs, prismjs, code, pre, code highlighting

codeblocks-extended/codeblocks-extended.php Passed 13 tests

The main file in "Codeblocks Extended with PrismJS" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
65 characters long description:
A Custom Code Syntax Highlighter based on PrismJS and ClipboardJS

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
There were no executable files found in this plugin372 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS1438205
JavaScript41310115
PHP1161852

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.08
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
js/crystal.png0.41KB0.33KB▼ 18.27%