84% static-block

Code Review | Static Block

WordPress plugin Static Block scored 84% from 54 tests.

About plugin

  • Plugin page: static-block
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.7
  • WordPress version: 6.3.1
  • First release: Nov 4, 2015
  • Latest release: Mar 10, 2021
  • Number of updates: 7
  • Update frequency: every 279.3 days
  • Top authors: MohammadTanzilurRahman (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

3,000+ active / 15,200 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.04MB] [CPU: ▼1.31ms] Passed 4 tests

An overview of server-side resources used by Static Block
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.93 ▼2.66
Dashboard /wp-admin3.34 ▲0.0444.85 ▼0.13
Posts /wp-admin/edit.php3.39 ▲0.0448.81 ▼0.67
Add New Post /wp-admin/post-new.php5.98 ▲0.0994.67 ▼1.77
Media Library /wp-admin/upload.php3.26 ▲0.0436.61 ▲2.32
Static Blocks /wp-admin/edit.php?post_type=static-block3.3136.66
Add New /wp-admin/post-new.php?post_type=static-block5.9579.83

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

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

Browser metrics Passed 4 tests

Static Block: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲12013.32 ▼1.051.84 ▲0.1840.71 ▼8.00
Dashboard /wp-admin2,233 ▲425.88 ▲1.01104.55 ▲1.5041.94 ▲0.02
Posts /wp-admin/edit.php2,116 ▲302.02 ▼0.0341.01 ▲1.2734.15 ▼1.09
Add New Post /wp-admin/post-new.php1,640 ▲12618.02 ▲0.50601.60 ▼15.8551.87 ▼1.19
Media Library /wp-admin/upload.php1,418 ▲274.33 ▲0.1593.35 ▼9.7641.87 ▼5.26
Static Blocks /wp-admin/edit.php?post_type=static-block1,0952.0032.8828.16
Add New /wp-admin/post-new.php?post_type=static-block7,43520.02888.6042.80

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_static_block_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/static-block/static-block.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/static-block/widget.php:2

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)
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 uses markdown syntax to describe your plugin to the world
9 plugin tags: static block, wordpress content, block content, repeat content, static block content...

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

The entry point to "Static Block" version 2.2 is a PHP file that has certain tags in its header comment area
90 characters long description:
Using this free static block plugin you can show static content in many pages and widgets.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin494 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP26023494

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity6.75
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There are no PNG files in this plugin