10% coding-blocks

Code Review | Coding Blocks

WordPress plugin Coding Blocks scored10%from 54 tests.

About plugin

  • Plugin page: coding-blocks
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0.2
  • WordPress version: 6.3.1
  • First release: Jul 26, 2021
  • Latest release: Sep 17, 2022
  • Number of updates: 23
  • Update frequency: every 18.2 days
  • Top authors: octagonsimon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,642 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

Server metrics [RAM: ▲0.08MB] [CPU: ▼7.57ms] Passed 4 tests

An overview of server-side resources used by Coding Blocks
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0846.76 ▲1.64
Dashboard /wp-admin3.39 ▲0.0551.58 ▼17.00
Posts /wp-admin/edit.php3.51 ▲0.1554.34 ▲0.89
Add New Post /wp-admin/post-new.php5.99 ▲0.1192.18 ▼15.57
Media Library /wp-admin/upload.php3.32 ▲0.0938.68 ▲1.39
New Snippet /wp-admin/admin.php?page=coding-blocks-new-snippet3.3133.07
Theme Preview /wp-admin/admin.php?page=coding-blocks-preview3.3137.73
Plugin Options /wp-admin/admin.php?page=coding-blocks-settings3.3036.02
Coding Blocks /wp-admin/admin.php?page=coding-blocks3.2833.16
Manage Snippets /wp-admin/admin.php?page=coding-blocks-snippets3.3434.65

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 228 new files
Database: 1 new table, 7 new options
New tables
wp_coding_blocks
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
coding_blocks_version

Browser metrics Passed 4 tests

Coding Blocks: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,976 ▲21514.36 ▼0.3712.38 ▲10.7940.02 ▼3.29
Dashboard /wp-admin2,243 ▲635.17 ▼0.4299.06 ▲12.1944.79 ▲0.59
Posts /wp-admin/edit.php2,148 ▲482.25 ▲0.3040.30 ▲2.6741.14 ▲5.27
Add New Post /wp-admin/post-new.php1,401 ▼12517.17 ▼5.88579.27 ▼103.7229.06 ▼38.32
Media Library /wp-admin/upload.php1,451 ▲544.66 ▲0.54105.28 ▼21.1144.12 ▼13.72
New Snippet /wp-admin/admin.php?page=coding-blocks-new-snippet1,3902.8048.8155.00
Theme Preview /wp-admin/admin.php?page=coding-blocks-preview1,6902.6451.2442.34
Plugin Options /wp-admin/admin.php?page=coding-blocks-settings1,1452.0331.2032.68
Coding Blocks /wp-admin/admin.php?page=coding-blocks1,0892.0230.5336.36
Manage Snippets /wp-admin/admin.php?page=coding-blocks-snippets1,0522.1931.8239.35

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie tables were found after uninstall: 1 table
    • wp_coding_blocks
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • coding_blocks_version
    • widget_recent-posts

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
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=coding-blocks-new-snippet
    • > Notice in wp-content/plugins/coding-blocks/admin/pages/new-snippet.php+12
    Trying to get property 'line_nums' of non-object
    • > GET request to /wp-admin/admin.php?page=coding-blocks-new-snippet
    • > Notice in wp-content/plugins/coding-blocks/admin/pages/new-snippet.php+14
    Trying to get property 'copy_btn' of non-object
    • > GET request to /wp-admin/admin.php?page=coding-blocks-settings
    • > Notice in wp-content/plugins/coding-blocks/admin/pages/settings.php+61
    Undefined variable: success
    • > GET request to /wp-admin/admin.php?page=coding-blocks-snippets
    • > Notice in wp-content/plugins/coding-blocks/admin/pages/snippets.php+226
    Undefined index: search

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/coding-blocks/public/partials/coding-blocks-public-display.php
    • > /wp-content/plugins/coding-blocks/admin/partials/coding-blocks-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: code-snippet, sunburst, shortcode, programming, code...

coding-blocks/coding-blocks.php Passed 13 tests

The entry point to "Coding Blocks" version 1.1.0 is a PHP file that has certain tags in its header comment area
120 characters long description:
Coding Blocks allows you to create reusable and attractive code snippets that can be embedded into your WordPress posts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected4,898 lines of code in 99 files:
LanguageFilesBlank linesComment linesLines of code
CSS391,1555772,925
PHP192656751,234
HTML3281374
JavaScript38204550365

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity1.72
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2482.76%
▷ Protected methods00.00%
▷ Private methods517.24%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
No PNG images were found in this plugin