84% code-syntax-block

Code Review | Code Syntax Block

WordPress plugin Code Syntax Block scored84%from 54 tests.

About plugin

  • Plugin page: code-syntax-block
  • Plugin version: 3.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.0
  • WordPress version: 6.3.1
  • First release: Jun 27, 2019
  • Latest release: Jun 24, 2022
  • Number of updates: 43
  • Update frequency: every 25.4 days
  • Top authors: mkaz (100%)

Code review

54 tests

User reviews

45 reviews

Install metrics

9,000+ active /135,910 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼10.72ms] Passed 4 tests

Analyzing server-side resources used by Code Syntax Block
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.00 ▼8.64
Dashboard /wp-admin3.32 ▲0.0243.32 ▼14.50
Posts /wp-admin/edit.php3.37 ▲0.0152.33 ▲2.00
Add New Post /wp-admin/post-new.php5.90 ▲0.0183.97 ▼18.64
Media Library /wp-admin/upload.php3.24 ▲0.0136.59 ▼1.09
Code Syntax Block /wp-admin/options-general.php?page=mkaz_code_syntax_block_settings3.2130.36

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 313 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Code Syntax Block
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.33 ▼0.231.62 ▲0.0640.07 ▼3.21
Dashboard /wp-admin2,199 ▲195.64 ▼0.0194.98 ▲1.9941.22 ▼3.54
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0137.31 ▼3.4635.51 ▼1.50
Add New Post /wp-admin/post-new.php1,694 ▲16821.86 ▼1.82639.95 ▼18.3253.71 ▲3.61
Media Library /wp-admin/upload.php1,404 ▲74.39 ▲0.17102.57 ▼13.2141.62 ▼2.92
Code Syntax Block /wp-admin/options-general.php?page=mkaz_code_syntax_block_settings8382.0027.5328.51

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

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 everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/code-syntax-block/settings.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/code-syntax-block/settings.php:6

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: syntax highlight, code highlighting, code, code syntax

code-syntax-block/index.php 92% from 13 tests

"Code Syntax Block" version 3.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("code-syntax-block.php" instead of "index.php")

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
Success! There were no dangerous files found in this plugin1,563 lines of code in 310 files:
LanguageFilesBlank linesComment linesLines of code
CSS816066978
JavaScript2981018343
PHP44292242

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions12
▷ Named functions650.00%
▷ Anonymous functions650.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot.png47.91KB16.38KB▼ 65.80%