84% code-block

Code Review | Code Block

WordPress plugin Code Block scored 84% from 54 tests.

About plugin

  • Plugin page: code-block
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Oct 16, 2020
  • Latest release: Oct 16, 2020
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: jeromepaulos (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 665 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▲6.31ms] Passed 4 tests

Server-side resources used by Code Block
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0447.91 ▼0.53
Dashboard /wp-admin3.32 ▲0.0168.19 ▲11.88
Posts /wp-admin/edit.php3.37 ▲0.0154.02 ▲2.87
Add New Post /wp-admin/post-new.php7.14 ▲1.26111.68 ▲15.74
Media Library /wp-admin/upload.php3.24 ▲0.0147.42 ▲11.03

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Code Block
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲14922.59 ▲9.38315.06 ▲312.9738.47 ▼5.22
Dashboard /wp-admin2,206 ▼05.80 ▲0.93101.37 ▼10.4242.41 ▼0.14
Posts /wp-admin/edit.php2,086 ▼32.02 ▼0.0335.69 ▼1.4236.54 ▲3.02
Add New Post /wp-admin/post-new.php1,646 ▲11322.54 ▼0.82673.40 ▲65.7137.75 ▼22.80
Media Library /wp-admin/upload.php1,391 ▲64.20 ▼0.0497.31 ▼2.4041.35 ▼1.85

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

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 no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/code-block/code-block.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Requires php: Version not formatted correctly
Please take inspiration from this readme.txt

code-block/code-block.php Passed 13 tests

"Code Block" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
63 characters long description:
A Gutenberg block for displaying code with syntax highlighting.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin342 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
Sass2280166
JavaScript2172138
PHP191636
CSS2002

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin