79% dev-content-blocks

Code Review | Dev Content Blocks

WordPress plugin Dev Content Blocks scored79%from 54 tests.

About plugin

  • Plugin page: dev-content-blocks
  • Plugin version: 1.4.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.0.2
  • WordPress version: 6.3.1
  • First release: Nov 3, 2017
  • Latest release: Dec 25, 2018
  • Number of updates: 19
  • Update frequency: every 22.3 days
  • Top authors: allonsacks@gmail.com (89.47%)Otto42 (15.79%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /2,705 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
Installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼6.76ms] Passed 4 tests

Analyzing server-side resources used by Dev Content Blocks
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1237.36 ▼13.79
Dashboard /wp-admin3.42 ▲0.1149.76 ▼6.96
Posts /wp-admin/edit.php3.53 ▲0.1748.07 ▼0.50
Add New Post /wp-admin/post-new.php6.00 ▲0.1296.71 ▼5.79
Media Library /wp-admin/upload.php3.34 ▲0.1139.22 ▲1.42
All Content Blocks /wp-admin/edit.php?post_type=dev_content_block3.3836.58
Add New Content Block /wp-admin/post-new.php?post_type=dev_content_block3.4750.49

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 48 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Dev Content Blocks: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.72 ▲0.311.67 ▼0.4737.23 ▼2.57
Dashboard /wp-admin2,219 ▲425.57 ▲0.0491.85 ▼4.0943.54 ▼2.14
Posts /wp-admin/edit.php2,127 ▲302.00 ▲0.0138.97 ▲3.2538.57 ▼1.37
Add New Post /wp-admin/post-new.php1,549 ▲2323.07 ▼0.23633.36 ▼37.0853.58 ▲0.60
Media Library /wp-admin/upload.php1,421 ▲274.22 ▲0.02104.83 ▲0.4142.55 ▼0.68
All Content Blocks /wp-admin/edit.php?post_type=dev_content_block1,0911.9730.4531.48
Add New Content Block /wp-admin/post-new.php?post_type=dev_content_block2,71610.09237.0770.76

Uninstaller [IO: ▲0.00MB] [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
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 7× PHP files output text when accessed directly:
    • > /wp-content/plugins/dev-content-blocks/metabox-info.php
    • > /wp-content/plugins/dev-content-blocks/revisions.php
    • > /wp-content/plugins/dev-content-blocks/shortcode.php
    • > /wp-content/plugins/dev-content-blocks/post-type.php
    • > /wp-content/plugins/dev-content-blocks/dev-content-blocks.php
    • > /wp-content/plugins/dev-content-blocks/metabox-options.php
    • > /wp-content/plugins/dev-content-blocks/metabox-blocks.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/dev-content-blocks/single.php:4

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 Passed 29 tests

readme.txt Passed 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
6 plugin tags: content blocks, reusable content, html, code, modular...

dev-content-blocks/dev-content-blocks.php Passed 13 tests

Analyzing the main PHP file in "Dev Content Blocks" version 1.4.1
96 characters long description:
This plugin adds content blocks with HTML, JS, and CSS blocks to be called by using a shortcode.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected2,055 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
CSS244481,350
PHP9104163534
JavaScript35282171

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity3.30
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%